:root {
  color-scheme: dark;
  --bg: #07080b;
  --panel: rgba(24, 26, 34, 0.72);
  --panel-solid: #15171d;
  --text: #f7f8fb;
  --muted: #9da2ae;
  --line: rgba(255, 255, 255, 0.09);
  --green: #55f0a1;
  --apple-green: #34c759;
  --yellow: #ffd05c;
  --red: #ff6b70;
  --gold: #d8bb79;
  --ease: cubic-bezier(.2, .75, .25, 1);
  /* Set to 0 to hide the small split-kite inlay beneath the wordmark. */
  --show-headstock-extra-inlay: 1;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -12%, rgba(71, 79, 107, .38), transparent 42rem),
    linear-gradient(180deg, #0b0d12, var(--bg) 72%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.app-shell {
  width: min(100%, 500px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(22px, env(safe-area-inset-bottom));
  transition: opacity .35s ease, transform .45s var(--ease);
  will-change: opacity, transform;
}
.splash-active .app-shell { opacity: 0; }
.app-header { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; }
.brand { text-align: center; }
.brand h1 { margin: 0; font-size: 1.12rem; font-weight: 650; letter-spacing: -.02em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: .72rem; }
.icon-button, .close-button {
  display: grid; place-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.045);
  cursor: pointer; transition: background .2s ease, transform .2s var(--ease);
}
.icon-button { width: 42px; height: 42px; border-radius: 14px; letter-spacing: 2px; }
.icon-button:hover { background: rgba(255,255,255,.09); }
.icon-button:active, .close-button:active { transform: scale(.94); }

.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.status {
  padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.035); color: var(--muted); font-size: .68rem; white-space: nowrap;
}
.status.active { color: var(--green); border-color: rgba(85,240,161,.3); background: rgba(85,240,161,.08); }
.status.error { color: var(--red); border-color: rgba(255,107,112,.32); background: rgba(255,107,112,.08); }
.mode-switcher {
  display: grid; grid-template-columns: 1fr 1.35fr; gap: 3px; padding: 3px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.035);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
}
.mode-button {
  min-height: 30px; padding: 5px 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-size: .69rem; font-weight: 650; cursor: pointer;
  transition: color .25s ease, background .25s ease, box-shadow .25s ease;
}
.mode-button.active { color: var(--text); background: rgba(255,255,255,.1); box-shadow: 0 5px 14px rgba(0,0,0,.2); }
.auto-control { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .61rem; font-weight: 760; letter-spacing: .08em; }
.auto-toggle {
  position: relative; width: 50px; height: 28px; padding: 2px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px; background: rgba(255,255,255,.12); cursor: pointer;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.auto-toggle > span {
  display: block; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 7px rgba(0,0,0,.35); transform: translateX(0);
  transition: transform .25s ease, background .25s ease;
}
.auto-toggle[aria-checked="true"] {
  background: #55d79a; border-color: rgba(85,215,154,.65); box-shadow: 0 0 14px rgba(85,215,154,.22);
}
.auto-toggle[aria-checked="true"] > span { transform: translateX(22px); }
.auto-toggle[aria-checked="false"] { background: rgba(255,255,255,.09); }
.language-control {
  display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: .58rem; font-weight: 700; letter-spacing: .03em;
}
.language-picker { position: relative; }
.language-button {
  display: inline-flex; align-items: center; gap: 6px; min-width: 116px; height: 32px; padding: 0 10px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(255,255,255,.065);
  color: var(--text); font-size: .66rem; font-weight: 680; cursor: pointer;
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 5px 18px rgba(0,0,0,.16);
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.language-button:hover, .language-button[aria-expanded="true"] {
  border-color: rgba(85,240,161,.36); background: rgba(255,255,255,.1); box-shadow: 0 0 0 3px rgba(85,240,161,.08);
}
.language-flag {
  display: inline-block; position: relative; width: 21px; height: 14px; flex: 0 0 21px;
  overflow: hidden; border: 1px solid rgba(255,255,255,.22); border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.28);
}
.flag-gb {
  background:
    linear-gradient(90deg, transparent 0 50%, rgba(255,255,255,.95) 50% 54%, transparent 54% 100%),
    linear-gradient(0deg, transparent 0 42%, rgba(255,255,255,.95) 42% 58%, transparent 58% 100%),
    linear-gradient(90deg, transparent 0 50%, #c8102e 50% 52%, transparent 52% 100%),
    linear-gradient(0deg, transparent 0 46%, #c8102e 46% 54%, transparent 54% 100%),
    linear-gradient(0deg, #b22234 0 14%, #fff 14% 28%, #b22234 28% 42%, #fff 42% 56%, #b22234 56% 70%, #fff 70% 84%, #b22234 84% 100%);
}
.language-image-flag {
  background: url("assets/english-language-flag.webp") center / cover no-repeat !important;
}
.language-image-flag.language-fa-flag {
  background-image: url("assets/persian-language-flag.webp") !important;
}
.language-image-flag.language-tr-flag {
  background-image: url("assets/turkish-language-flag.webp") !important;
}
.flag-gb::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 50%;
  height: 52%;
  background: #3c3b6e;
  box-shadow: 0 0 0 1px rgba(0,0,0,.08);
}
.flag-gb::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 50%;
  height: 100%;
  background:
    linear-gradient(90deg, transparent 0 38%, #fff 38% 62%, transparent 62%),
    linear-gradient(0deg, transparent 0 36%, #fff 36% 64%, transparent 64%),
    linear-gradient(90deg, transparent 0 44%, #c8102e 44% 56%, transparent 56%),
    linear-gradient(0deg, transparent 0 42%, #c8102e 42% 58%, transparent 58%),
    #1b3f8f;
}
.flag-ir {
  background: linear-gradient(#239f40 0 33%, #fff 33% 66%, #da0000 66%);
}
.flag-tr {
  background: #e30a17;
}
.flag-tr::after {
  content: "☾"; position: absolute; left: 4px; top: 1px; color: #fff; font-size: 11px; line-height: 1;
}
.flag-tr::before {
  content: "•"; position: absolute; left: 8px; top: 2px; z-index: 1; color: #e30a17; font-size: 8px; line-height: 1;
}
.language-chevron { margin-left: auto; color: var(--muted); font-size: .95rem; line-height: 1; transform: translateY(-2px); }
.language-menu {
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 30; display: grid; min-width: 150px; padding: 5px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px; background: rgba(24,26,34,.94);
  -webkit-backdrop-filter: blur(22px) saturate(1.3); backdrop-filter: blur(22px) saturate(1.3);
  box-shadow: 0 18px 42px rgba(0,0,0,.45), inset 0 1px rgba(255,255,255,.05);
  opacity: 0; visibility: hidden; transform: translateY(-5px) scale(.97); transform-origin: top right;
  transition: opacity .18s ease, visibility .18s ease, transform .2s var(--ease);
}
.language-picker.open .language-menu { opacity: 1; visibility: visible; transform: none; }
.language-menu button {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 7px 9px;
  border: 0; border-radius: 10px; background: transparent; color: rgba(247,248,251,.82);
  font-size: .68rem; text-align: left; cursor: pointer; transition: background .18s ease, color .18s ease;
}
.language-menu button span { line-height: 1; }
.language-menu button:hover, .language-menu button[aria-selected="true"] { background: rgba(85,240,161,.12); color: var(--text); }
#languageSelect { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.persian-ui {
  font-family: Tahoma, "Segoe UI", sans-serif;
}
.persian-ui .brand,
.persian-ui .headstock-live-feedback,
.persian-ui .readings,
.persian-ui .settings-sheet,
.persian-ui .warmup-sheet,
.persian-ui .top-bar,
.persian-ui .strings,
.persian-ui .controls,
.persian-ui footer {
  direction: ltr;
}
.persian-ui .headstock-live-copy,
.persian-ui .headstock-primary-guidance,
.persian-ui .active-reading,
.persian-ui #target,
.persian-ui #frequency,
.persian-ui #cents,
.persian-ui #message,
.persian-ui .settings-sheet,
.persian-ui .warmup-sheet {
  text-align: inherit;
}
.persian-ui .settings-note,
.persian-ui .editor-credit,
.persian-ui .bio {
  direction: rtl;
  unicode-bidi: plaintext;
}
.turkish-ui {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.visual-stage { position: relative; height: clamp(330px, 82vw, 410px); margin-top: 16px; }
.mode-view {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; visibility: hidden;
  pointer-events: none; transform: translate3d(0, 8px, 0) scale(.975);
  transition: opacity .32s ease, visibility .32s ease, transform .46s var(--ease), filter .4s ease;
  filter: blur(3px);
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}
.mode-view.active { opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
.mode-view[data-mode-view="headstock"] {
  grid-template-rows: auto 1fr;
  align-content: start;
  gap: 13px;
  padding-top: 5px;
}
.gauge {
  position: relative; display: grid; place-items: center; width: min(330px, 84vw); aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.065), rgba(0,0,0,.25) 68%);
  box-shadow: 0 24px 65px rgba(0,0,0,.48), inset 0 0 32px rgba(255,255,255,.025);
}
.gauge-ring { position: absolute; border: 1px solid rgba(255,255,255,.065); border-radius: 50%; }
.ring-one { inset: 15px; }
.ring-two { inset: 38px; opacity: .7; }
.gauge-mark { position: absolute; top: 25px; color: var(--muted); font-size: .75rem; }
.mark-flat { left: 32px; } .mark-center { left: 50%; color: var(--green); transform: translateX(-50%); } .mark-sharp { right: 32px; }
.needle {
  position: absolute; top: 27px; left: 50%; width: 3px; height: 139px; border-radius: 999px;
  background: #fff; color: #fff; transform: translateX(-50%) rotate(0);
  transform-origin: 50% 100%; box-shadow: 0 0 16px currentColor;
  transition: transform .28s cubic-bezier(.22,.78,.25,1), background .28s ease, color .28s ease, box-shadow .28s ease;
  will-change: transform, background-color, color;
}
.tuning-feedback-bubble {
  position: absolute;
  z-index: 5;
  right: 50%;
  bottom: 47px;
  width: 86px;
  height: 54px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 18px;
  background: rgba(13,15,20,.74);
  -webkit-backdrop-filter: blur(22px) saturate(1.22);
  backdrop-filter: blur(22px) saturate(1.22);
  box-shadow: 0 12px 30px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.055);
  transform: translate3d(50%,0,0);
  color: #c7cbd3;
  pointer-events: none;
  transition:
    border-color .28s ease,
    background .28s ease,
    box-shadow .28s ease,
    color .28s ease;
  will-change: transform, opacity;
}
.feedback-offset,
.feedback-success {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  transition: opacity .24s ease, transform .38s cubic-bezier(.2, .9, .25, 1.18);
  will-change: opacity, transform;
}
.feedback-offset strong {
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.feedback-offset small,
.feedback-success small {
  margin-top: 5px;
  color: rgba(220,223,230,.64);
  font-size: .56rem;
  font-weight: 570;
  letter-spacing: .025em;
}
.feedback-success {
  color: var(--apple-green);
  opacity: 0;
  transform: scale(.68) translate3d(0,5px,0);
}
.feedback-success span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--apple-green);
  color: #051008;
  font-size: .78rem;
  font-weight: 900;
  box-shadow: 0 0 13px rgba(52,199,89,.28);
}
.feedback-success small { color: var(--apple-green); }
.tuning-feedback-bubble.is-sharp {
  color: #e0a56e;
  border-color: rgba(224,165,110,.22);
  background: rgba(32,24,20,.72);
}
.tuning-feedback-bubble.is-flat { color: #c7cbd3; }
.tuning-feedback-bubble.is-idle { opacity: .64; }
.tuning-feedback-bubble.is-in-tune {
  border-color: rgba(52,199,89,.28);
  background: rgba(18,42,27,.62);
  box-shadow: 0 9px 25px rgba(0,0,0,.24), 0 0 18px rgba(52,199,89,.09), inset 0 1px rgba(255,255,255,.05);
}
.tuning-feedback-bubble.is-in-tune .feedback-offset {
  opacity: 0;
  transform: scale(.84) translate3d(0,-4px,0);
}
.tuning-feedback-bubble.is-in-tune .feedback-success {
  opacity: 1;
  transform: scale(1) translate3d(0,0,0);
}
.note-area { position: relative; z-index: 1; min-width: 170px; text-align: center; }
#note { font-size: 4.6rem; font-weight: 250; line-height: 1; letter-spacing: -.06em; }
#octave { margin-top: 8px; color: var(--muted); font-size: .78rem; }

.headstock-live-feedback {
  position: relative;
  z-index: 6;
  display: grid;
  width: min(286px, 78vw);
  min-height: 96px;
  padding: 10px 13px 9px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 22px;
  background:
    radial-gradient(circle at 82% 45%, rgba(255,255,255,.045), transparent 42%),
    rgba(18,20,27,.7);
  box-shadow: 0 12px 34px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.035);
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
  transition: border-color .3s ease, background .3s ease, box-shadow .3s ease;
}
.headstock-analysis-row {
  display: grid;
  grid-template-columns: 7px 1fr auto;
  align-items: center;
  gap: 6px;
  color: rgba(199,203,211,.72);
  font-size: .55rem;
  font-weight: 610;
  letter-spacing: .02em;
}
.headstock-analysis-row small {
  color: rgba(157,162,174,.62);
  font-size: .52rem;
  font-weight: 570;
}
.headstock-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(157,162,174,.5);
  box-shadow: 0 0 0 0 transparent;
  transition: background .25s ease, box-shadow .25s ease;
}
.headstock-live-main {
  display: grid;
  grid-template-columns: minmax(82px, .8fr) 1.25fr;
  align-items: end;
  gap: 12px;
  margin-top: 7px;
}
.headstock-live-copy {
  display: grid;
  min-width: 0;
  align-content: center;
}
.headstock-live-copy > span {
  color: rgba(199,203,211,.72);
  font-size: .59rem;
  font-weight: 620;
  letter-spacing: .025em;
}
.headstock-live-copy > strong {
  margin-top: 1px;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 520;
  line-height: 1.05;
  letter-spacing: -.045em;
}
.headstock-live-copy > small {
  margin-top: 4px;
  overflow: hidden;
  color: rgba(157,162,174,.75);
  font-size: .58rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.headstock-primary-guidance {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  min-width: 0;
  padding-left: 11px;
  border-left: 1px solid rgba(255,255,255,.075);
}
.headstock-primary-guidance > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(255,255,255,.055);
  color: rgba(199,203,211,.7);
  font-size: .68rem;
  font-weight: 800;
  transition: color .25s ease, background .25s ease, transform .35s var(--ease), box-shadow .25s ease;
}
.headstock-primary-guidance > strong {
  overflow: hidden;
  color: rgba(247,248,251,.94);
  font-size: .98rem;
  font-weight: 690;
  line-height: 1.08;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.headstock-primary-guidance > small {
  margin-top: 3px;
  overflow: hidden;
  color: rgba(157,162,174,.72);
  font-size: .54rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.headstock-signal-track {
  height: 2px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.055);
}
.headstock-signal-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: rgba(199,203,211,.56);
  transition: width .14s ease, background .25s ease;
}
.headstock-live-feedback[data-headstock-live-state="listening"] .headstock-live-dot,
.headstock-live-feedback[data-headstock-live-state="detecting"] .headstock-live-dot {
  background: #8e94a1;
  animation: liveListenPulse 1.25s ease-in-out infinite;
}
.headstock-live-feedback[data-headstock-live-state="detecting"] {
  border-color: rgba(216,187,121,.18);
}
.headstock-live-feedback[data-headstock-live-state="detecting"] .headstock-live-dot,
.headstock-live-feedback[data-headstock-live-state="flat"] .headstock-live-dot,
.headstock-live-feedback[data-headstock-live-state="sharp"] .headstock-live-dot {
  background: var(--gold);
  box-shadow: 0 0 9px rgba(216,187,121,.42);
}
.headstock-live-feedback[data-headstock-live-state="flat"],
.headstock-live-feedback[data-headstock-live-state="sharp"] {
  border-color: rgba(216,187,121,.2);
  background:
    radial-gradient(circle at 82% 45%, rgba(216,187,121,.075), transparent 44%),
    rgba(18,20,27,.72);
}
.headstock-live-feedback[data-headstock-live-state="flat"] .headstock-primary-guidance > strong,
.headstock-live-feedback[data-headstock-live-state="sharp"] .headstock-primary-guidance > strong {
  color: #edcf91;
}
.headstock-live-feedback[data-headstock-live-state="flat"] .headstock-primary-guidance > span,
.headstock-live-feedback[data-headstock-live-state="sharp"] .headstock-primary-guidance > span {
  background: rgba(216,187,121,.12);
  color: #edcf91;
}
.headstock-live-feedback[data-headstock-live-state="in-tune"] {
  border-color: rgba(52,199,89,.32);
  background:
    radial-gradient(circle at 82% 45%, rgba(52,199,89,.11), transparent 44%),
    rgba(15,27,20,.76);
  box-shadow: 0 12px 34px rgba(0,0,0,.18), 0 0 22px rgba(52,199,89,.07), inset 0 1px rgba(255,255,255,.04);
}
.headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-live-dot,
.headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-signal-track span {
  background: var(--apple-green);
  box-shadow: 0 0 10px rgba(52,199,89,.45);
}
.headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-primary-guidance > strong,
.headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-primary-guidance > small {
  color: var(--apple-green);
}
.headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-primary-guidance > span {
  background: var(--apple-green);
  color: #061009;
  transform: scale(1.06);
  box-shadow: 0 0 13px rgba(52,199,89,.25);
}
@keyframes liveListenPulse {
  50% { opacity: .45; transform: scale(.78); }
}

.headstock-panel {
  position: relative; align-self: end; height: clamp(238px, 59vw, 286px); aspect-ratio: 900 / 1748; overflow: hidden;
  padding: 0; border: none; outline: 0; border-radius: 30px; background: transparent;
  box-shadow: none;
  transition: border-color .3s ease, box-shadow .35s ease;
  isolation: isolate;
}
.headstock-panel.has-live-lock {
  border-color: transparent;
  box-shadow: none;
}
.headstock-panel.is-in-tune {
  border-color: transparent;
  box-shadow: none;
}
.headstock-panel::before,
.headstock-panel::after {
  content: none;
}
.headstock-picture { position: absolute; inset: 0; display: block; }
.headstock-photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.headstock-light-photo { display: none; }
.headstock-inlay {
  position: absolute;
  z-index: 4;
  top: 12.2%;
  left: 50%;
  width: 55%;
  height: auto;
  transform: translateX(-50%);
  overflow: visible;
  opacity: .92;
  mix-blend-mode: luminosity;
  pointer-events: none;
}
.headstock-inlay[hidden] { display: none !important; }
.headstock-inlay text,
.inlay-script-mask {
  font-family: "Segoe Script", "Lucida Handwriting", "URW Chancery L", cursive;
  font-size: 45px;
  font-style: italic;
  font-weight: 700;
  letter-spacing: -1.8px;
}
.inlay-cavity {
  fill: none;
  stroke: rgba(0,0,0,.98);
  stroke-width: 5.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url("#routedCavity");
  opacity: .96;
}
.inlay-cavity text {
  fill: rgba(0,0,0,.98);
  stroke: rgba(0,0,0,.98);
  stroke-width: 2.8;
  paint-order: stroke fill;
}
.inlay-pearl {
  fill: url("#pearlBase");
  stroke: rgba(255,251,226,.58);
  stroke-width: .75;
  stroke-linecap: round;
  stroke-linejoin: round;
  paint-order: stroke fill;
}
.inlay-pearl path,
.inlay-flourish-mask {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.inlay-flourish-mask {
  stroke: #fff;
}
.inlay-script-mask {
  fill: #fff;
  stroke: #fff;
  stroke-width: 1.2;
  paint-order: stroke fill;
}
.inlay-reflection {
  opacity: .26;
  mix-blend-mode: screen;
}
.headstock-extra-inlay {
  opacity: calc(var(--show-headstock-extra-inlay) * .72);
  transition: opacity .2s ease;
}
.extra-cavity {
  fill: none;
  stroke: rgba(0,0,0,.98);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url("#routedCavity");
}
.extra-pearl {
  fill: url("#pearlBase");
  stroke: rgba(255,251,226,.55);
  stroke-width: 1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: url("#pearlBevel");
}
@media (prefers-reduced-motion: no-preference) {
  .inlay-reflection {
    animation: pearlReflection 12s ease-in-out infinite alternate;
  }
}
@keyframes pearlReflection {
  from { transform: translateX(-14px); opacity: .18; }
  to { transform: translateX(14px); opacity: .3; }
}
.string-overlay {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  pointer-events: none; mix-blend-mode: screen;
}
.string-overlay path {
  fill: none; stroke: transparent; stroke-width: 1.1; vector-effect: non-scaling-stroke;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 0 transparent); transition: stroke .22s ease, filter .22s ease;
}
.string-overlay path.active { stroke: rgba(255,210,116,.94); filter: drop-shadow(0 0 3px var(--gold)); }
.headstock-panel.manual-lock .string-overlay path.active {
  stroke: #fff; filter: drop-shadow(0 0 4px rgba(255,255,255,.7));
}
.headstock-panel.manual-lock .peg-button.active span {
  color: #fff;
  border-color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.12);
}
.string-overlay path.in-tune { stroke: var(--apple-green); filter: drop-shadow(0 0 4px var(--apple-green)); }
.string-overlay path {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform, filter, opacity;
}
.string-overlay path.vibrating {
  animation: stringPluck var(--vibration-duration, 1.6s) linear both;
}
@keyframes stringPluck {
  0% { transform: translate3d(calc(-1.8px * var(--vibration-intensity, 1)),0,0) scaleX(1.004); filter: blur(.7px) drop-shadow(0 0 5px currentColor); }
  4% { transform: translate3d(calc(1.65px * var(--vibration-intensity, 1)),0,0) scaleX(.997); }
  9% { transform: translate3d(calc(-1.35px * var(--vibration-intensity, 1)),0,0); }
  15% { transform: translate3d(calc(1.05px * var(--vibration-intensity, 1)),0,0); filter: blur(.48px) drop-shadow(0 0 4px currentColor); }
  23% { transform: translate3d(calc(-.78px * var(--vibration-intensity, 1)),0,0); }
  34% { transform: translate3d(calc(.54px * var(--vibration-intensity, 1)),0,0); filter: blur(.3px) drop-shadow(0 0 3px currentColor); }
  48% { transform: translate3d(calc(-.34px * var(--vibration-intensity, 1)),0,0); }
  65% { transform: translate3d(calc(.18px * var(--vibration-intensity, 1)),0,0); filter: blur(.12px) drop-shadow(0 0 2px currentColor); }
  82% { transform: translate3d(calc(-.07px * var(--vibration-intensity, 1)),0,0); }
  100% { transform: translate3d(0,0,0); filter: blur(0) drop-shadow(0 0 0 transparent); }
}
.peg-button {
  position: absolute; z-index: 3; width: 45px; height: 45px; padding: 0; transform: translate(-50%,-50%);
  border: 1px solid transparent; border-radius: 50%; background: transparent; cursor: pointer;
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease, transform .18s var(--ease);
}
.peg-button::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid transparent;
  border-radius: 50%;
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.peg-button span {
  position: absolute; top: 50%; min-width: 24px; padding: 3px 5px; transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,.09); border-radius: 999px; background: rgba(7,8,11,.54);
  -webkit-backdrop-filter: blur(12px) saturate(.9);
  backdrop-filter: blur(12px) saturate(.9);
  color: rgba(235,237,242,.64); font-size: .52rem; font-weight: 680; letter-spacing: -.01em;
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
  transition: color .22s ease, border-color .22s ease, background .22s ease, opacity .22s ease;
}
.peg-0 { left: 31.1%; top: 58.3%; }
.peg-1 { left: 31.2%; top: 41.6%; }
.peg-2 { left: 30.7%; top: 25.7%; }
.peg-3 { left: 69.4%; top: 25.6%; }
.peg-4 { left: 68.9%; top: 41.5%; }
.peg-5 { left: 69.4%; top: 58.4%; }
.peg-0 span,.peg-1 span,.peg-2 span { right: 35px; } .peg-3 span,.peg-4 span,.peg-5 span { left: 35px; }
.peg-button:hover::before { border-color: rgba(216,187,121,.72); background: rgba(216,187,121,.09); }
.peg-button:active { transform: translate(-50%,-50%) scale(.9); }
.peg-button.active {
  border-color: transparent; background: transparent; box-shadow: none;
}
.peg-button.active::before {
  border-color: var(--gold); background: rgba(216,187,121,.13);
  box-shadow: 0 0 0 4px rgba(216,187,121,.08), 0 0 17px rgba(216,187,121,.58);
}
.peg-button.active span {
  color: #f0d79e;
  border-color: rgba(216,187,121,.3);
  background: rgba(22,18,12,.68);
}
.peg-button.in-tune span {
  color: #8ae5a0;
  border-color: rgba(52,199,89,.3);
  background: rgba(11,29,17,.7);
}
.peg-button.in-tune::before {
  border-color: var(--apple-green); background: rgba(52,199,89,.1);
  box-shadow: 0 0 0 4px rgba(52,199,89,.1), 0 0 19px rgba(52,199,89,.72);
}
.peg-button.playing::before { animation: pegPulse .55s var(--ease) infinite alternate; }
@keyframes pegPulse { to { box-shadow: 0 0 0 8px rgba(216,187,121,.09), 0 0 25px rgba(216,187,121,.7); } }
.string-health {
  display: flex;
  width: max-content;
  max-width: 90%;
  min-height: 26px;
  margin: 2px auto 0;
  padding: 5px 10px;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 999px;
  background: rgba(255,255,255,.025);
  color: rgba(157,162,174,.72);
  font-size: .62rem;
  font-weight: 590;
  letter-spacing: .01em;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: color .3s ease, border-color .3s ease, background .3s ease;
}
.string-health-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(157,162,174,.46);
  transition: background .3s ease, box-shadow .3s ease;
}
.string-health[data-health-state="good"] {
  color: rgba(113,218,137,.88);
  border-color: rgba(52,199,89,.13);
  background: rgba(52,199,89,.035);
}
.string-health[data-health-state="good"] .string-health-dot {
  background: var(--apple-green);
  box-shadow: 0 0 7px rgba(52,199,89,.32);
}
.string-health[data-health-state="fair"] {
  color: rgba(226,187,103,.88);
  border-color: rgba(216,187,121,.14);
  background: rgba(216,187,121,.035);
}
.string-health[data-health-state="fair"] .string-health-dot {
  background: var(--gold);
  box-shadow: 0 0 7px rgba(216,187,121,.28);
}
.string-health[data-health-state="unstable"] {
  color: rgba(211,139,142,.78);
  border-color: rgba(255,107,112,.1);
  background: rgba(255,107,112,.025);
}
.string-health[data-health-state="unstable"] .string-health-dot {
  background: rgba(255,107,112,.7);
}
.readings {
  width: min(310px, 88vw);
  min-height: 126px;
  margin: 8px auto 0;
  text-align: center;
}
.active-reading {
  color: rgba(247,248,251,.92);
  font-size: .72rem;
  font-weight: 660;
  letter-spacing: .01em;
}
#target { margin-top: 5px; color: rgba(157,162,174,.76); font-size: .68rem; }
#frequency {
  margin-top: 8px;
  color: var(--text);
  font-size: 1.08rem;
  font-weight: 470;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
#cents {
  margin-top: 5px;
  color: rgba(157,162,174,.82);
  font-size: .69rem;
  font-variant-numeric: tabular-nums;
  transition: color .28s ease;
}
#message {
  min-height: 37px;
  margin-top: 4px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: .77rem;
  font-weight: 680;
}
.check-mark {
  display: none; width: 18px; height: 18px; place-items: center;
  border: 1px solid rgba(52,199,89,.7); border-radius: 50%; background: rgba(52,199,89,.12); color: var(--apple-green);
  font-size: .62rem; box-shadow: 0 0 12px rgba(52,199,89,.22);
}
.check-mark.visible { display: grid; animation: checkIn .25s var(--ease); }
@keyframes checkIn { from { opacity: 0; transform: scale(.6); } }

@media (prefers-reduced-motion: reduce) {
  .feedback-offset,
  .feedback-success,
  .tuning-feedback-bubble,
  .needle {
    transition-duration: .01ms;
  }
}

.strings { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 3px; }
.string-button {
  min-width: 0; padding: 9px 2px 8px; border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255,255,255,.035); color: var(--muted); cursor: pointer;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .18s var(--ease);
}
.string-button strong { display: block; font-size: 1rem; }
.string-button small { display: block; margin-top: 2px; font-size: .6rem; }
.play-hint { display: none; }
.string-button:hover { background: rgba(255,255,255,.075); }
.string-button:active { transform: scale(.94); }
.string-button.active { color: var(--green); border-color: rgba(85,240,161,.35); background: rgba(85,240,161,.09); }
.string-button.playing { color: var(--gold); border-color: rgba(216,187,121,.48); animation: labelPulse .55s ease infinite alternate; }
@keyframes labelPulse { to { background: rgba(216,187,121,.14); } }
.controls { display: flex; flex-direction: column; align-items: center; margin-top: 18px; }
.primary-button {
  min-width: 160px; padding: 13px 24px; border: 0; border-radius: 999px; background: var(--green);
  color: #07100b; font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px rgba(85,240,161,.25);
  transition: transform .2s var(--ease), box-shadow .2s ease, opacity .2s ease;
}
.primary-button:hover { box-shadow: 0 15px 35px rgba(85,240,161,.36); transform: translateY(-1px); }
.primary-button:active { transform: scale(.97); }
.warmup-launch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  padding: 8px 13px;
  border: 1px solid rgba(216,187,121,.18);
  border-radius: 999px;
  background: rgba(216,187,121,.055);
  color: #d8c28e;
  font-size: .68rem;
  font-weight: 650;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s ease, border-color .2s ease;
}
.warmup-launch:hover { background: rgba(216,187,121,.11); border-color: rgba(216,187,121,.34); }
.warmup-launch:active { transform: scale(.96); }
.controls p { margin: 11px 0 0; color: var(--muted); font-size: .7rem; text-align: center; }
footer { margin-top: 17px; color: rgba(157,162,174,.6); font-size: .65rem; text-align: center; }

.splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 38%, rgba(216,187,121,.13), transparent 25rem), #07080b;
  transition: opacity .4s ease, visibility .4s ease;
}
.splash.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-content { text-align: center; animation: splashIn .7s var(--ease); }
.splash-content h1 { margin: 22px 0 0; font-size: 1.6rem; letter-spacing: -.03em; }
.splash-content p, .eyebrow { color: var(--gold); font-size: .61rem; font-weight: 750; letter-spacing: .22em; }
@keyframes splashIn { from { opacity: 0; transform: translateY(8px) scale(.95); } }
.portrait-shell {
  width: 132px; height: 132px; margin: auto; padding: 3px; border-radius: 50%;
  background: linear-gradient(145deg,#f0dfb4,var(--gold) 50%,rgba(216,187,121,.15));
  box-shadow: 0 20px 55px rgba(0,0,0,.5);
}
.portrait-shell.compact { width: 84px; height: 84px; padding: 2px; }
.portrait { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; border-radius: inherit; }

/* Apple-style light splash screen. The splash follows the resolved theme
   immediately, including when the saved theme is applied during startup. */
body[data-theme="light"] .splash {
  background:
    radial-gradient(circle at 50% 36%, rgba(255,255,255,.92), transparent 26rem),
    linear-gradient(180deg, #eef1f4 0%, #d7dce2 100%);
  color: #1b222b;
}
body[data-theme="light"] .splash-content h1 { color: #1b222b; }
body[data-theme="light"] .splash-content p {
  color: #687585;
}
body[data-theme="light"] .splash .portrait-shell {
  background: linear-gradient(145deg, #ffffff 0%, #c8cfd7 48%, #8f9aa7 100%);
  box-shadow: 0 20px 55px rgba(55,65,78,.24), 0 0 0 1px rgba(255,255,255,.72);
}

body.modal-open { overflow: hidden; }
.settings-backdrop {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; padding: 12px;
  overflow: hidden;
  background: rgba(0,0,0,.58); backdrop-filter: blur(14px); opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
}
.warmup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 10px;
  background: rgba(0,0,0,.62);
  -webkit-backdrop-filter: blur(18px) saturate(.8);
  backdrop-filter: blur(18px) saturate(.8);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s ease;
}
.warmup-backdrop.open { opacity: 1; visibility: visible; }
.warmup-sheet {
  width: min(460px,100%);
  padding: 9px 17px calc(18px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 29px;
  background:
    radial-gradient(circle at 50% 0, rgba(216,187,121,.11), transparent 32%),
    rgba(18,20,26,.965);
  box-shadow: 0 -28px 80px rgba(0,0,0,.68), inset 0 1px rgba(255,255,255,.06);
  transform: translate3d(0,105%,0);
  transition: transform .46s cubic-bezier(.22,.88,.24,1);
  will-change: transform;
}
.warmup-backdrop.open .warmup-sheet { transform: translate3d(0,0,0); }
.warmup-handle {
  display: block;
  width: 40px;
  height: 5px;
  margin: 0 auto 12px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  cursor: pointer;
}
.warmup-header { display: flex; align-items: center; justify-content: space-between; }
.warmup-header h2 { margin: 3px 0 0; font-size: 1.12rem; letter-spacing: -.025em; }
.warmup-eyebrow { margin: 0; color: var(--gold); font-size: .56rem; font-weight: 750; letter-spacing: .2em; }
.exercise-list { display: grid; gap: 7px; margin-top: 15px; }
.exercise-card {
  display: grid;
  grid-template-columns: 28px 1fr 22px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 9px 11px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 15px;
  background: rgba(255,255,255,.028);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s ease, border-color .2s ease;
}
.exercise-card:active { transform: scale(.985); }
.exercise-card.active { border-color: rgba(216,187,121,.31); background: rgba(216,187,121,.075); }
.exercise-number { color: rgba(216,187,121,.65); font-size: .61rem; font-variant-numeric: tabular-nums; }
.exercise-card strong, .exercise-card small { display: block; }
.exercise-card strong { font-size: .78rem; }
.exercise-card small { margin-top: 3px; color: var(--muted); font-size: .61rem; }
.exercise-check { color: var(--gold); opacity: 0; transform: scale(.6); transition: opacity .2s ease, transform .24s var(--ease); }
.exercise-card.active .exercise-check { opacity: 1; transform: scale(1); }
.warmup-player {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(4,5,8,.37);
}
.warmup-display { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; }
.warmup-step {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(216,187,121,.28);
  border-radius: 13px;
  background: rgba(216,187,121,.08);
  color: #eed99f;
  font-family: "Baskerville", Georgia, serif;
  font-size: 1.22rem;
  animation: warmupBeat .24s var(--ease);
}
@keyframes warmupBeat { from { transform: scale(.86); opacity: .55; } }
.warmup-display strong, .warmup-display small { display: block; }
.warmup-display strong { font-size: .77rem; }
.warmup-display small { margin-top: 3px; color: var(--muted); font-size: .59rem; line-height: 1.35; }
.warmup-time { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.warmup-sequence { display: flex; gap: 5px; margin-top: 12px; overflow: hidden; }
.warmup-sequence span {
  flex: 1;
  min-width: 23px;
  padding: 5px 2px;
  border-radius: 8px;
  background: rgba(255,255,255,.04);
  color: rgba(157,162,174,.72);
  font-size: .64rem;
  text-align: center;
  transition: background .18s ease, color .18s ease, transform .18s var(--ease);
}
.warmup-sequence span.active { background: rgba(85,240,161,.12); color: var(--green); transform: translateY(-1px); }
.warmup-progress { height: 3px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.warmup-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,var(--gold),#f3dfa8);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s linear;
}
.warmup-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.tempo-control { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .61rem; }
.tempo-control select {
  padding: 7px 8px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 9px;
  background: #171920;
  color: var(--text);
  font: inherit;
}
.warmup-start {
  min-width: 112px;
  padding: 9px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #06100a;
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
}
.warmup-start.running { background: rgba(255,255,255,.1); color: var(--text); }
.settings-backdrop.open { opacity: 1; visibility: visible; }
.settings-sheet {
  box-sizing: border-box;
  width: min(440px,100%); height: min(88vh, 760px); max-height: calc(100dvh - 24px);
  min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-y;
  /* Keep scrolling available without letting a native bar escape the rounded sheet. */
  scrollbar-width: none;
  scrollbar-gutter: auto;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); border: 1px solid var(--line);
  border-radius: 28px; background: radial-gradient(circle at 50% 0,rgba(216,187,121,.09),transparent 38%),rgba(19,21,28,.97);
  box-shadow: 0 -22px 70px rgba(0,0,0,.6); transform: translateY(30px) scale(.98); transition: transform .32s var(--ease);
}
.settings-sheet::-webkit-scrollbar { width: 0; height: 0; display: none; }
.settings-backdrop.open .settings-sheet { transform: none; }
.sheet-handle { width: 36px; height: 4px; margin: 0 auto 12px; border-radius: 999px; background: rgba(255,255,255,.18); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; }
.sheet-header h2 { margin: 0; font-size: 1.05rem; }
.close-button { width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 1.2rem; }
.contact-tabs { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; margin-top: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); }
.contact-tab { min-height: 34px; padding: 4px 3px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: inherit; font-size: .64rem; font-weight: 750; line-height: 1.15; cursor: pointer; }
.contact-tab.active { background: rgba(216,187,121,.16); color: var(--text); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.contact-panel[hidden] { display: none; }
.manager-panel { min-height: 12px; padding: 0; border: 0; background: transparent; }
.profile-tab {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 15px; padding: 9px 11px;
  border: 1px solid rgba(216,187,121,.2); border-radius: 18px;
  background: linear-gradient(120deg, rgba(216,187,121,.12), rgba(255,255,255,.035));
  color: var(--text); text-align: left; cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s var(--ease);
}
.profile-tab:hover { border-color: rgba(216,187,121,.48); background: linear-gradient(120deg, rgba(216,187,121,.18), rgba(255,255,255,.055)); }
.profile-tab:active { transform: scale(.99); }
.profile-tab-avatar { width: 38px; height: 38px; flex: 0 0 auto; overflow: hidden; border: 1px solid rgba(216,187,121,.45); border-radius: 50%; }
.profile-tab-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.profile-tab-copy { display: grid; gap: 3px; min-width: 0; }
.profile-tab-copy small { color: var(--gold); font-size: .52rem; font-weight: 800; letter-spacing: .14em; }
.profile-tab-copy strong { overflow: hidden; font-size: .83rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-tab-chevron { margin-left: auto; color: var(--muted); font-size: 1.05rem; transition: transform .25s ease; }
.profile-tab[aria-expanded="true"] .profile-tab-chevron { transform: rotate(180deg); }
.teacher-card {
  margin-top: 17px; padding: 21px 16px 17px; border: 1px solid var(--line); border-radius: 22px;
  background: linear-gradient(145deg,rgba(255,255,255,.055),transparent 46%),rgba(255,255,255,.025); text-align: center;
}
.editor-profile-panel[hidden] { display: none; }
.editor-profile-panel { overflow: hidden; padding: 0 0 17px; }
.profile-hero { position: relative; min-height: 190px; overflow: hidden; text-align: left; }
.profile-hero .portrait { display: block; width: 100%; height: 230px; object-fit: cover; object-position: center 20%; border-radius: 20px 20px 0 0; filter: saturate(.92) contrast(1.04); }
.student-profile-panel .profile-hero {
  min-height: 0;
}
.student-profile-panel .student-entry {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.student-profile-panel .profile-hero .portrait {
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  border-radius: 20px 20px 0 0;
}
.editor-profile-panel .profile-hero {
  min-height: 0;
}
.editor-profile-panel .profile-hero .portrait {
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}
.owner-profile-panel .profile-hero {
  min-height: 0;
}
.owner-profile-panel .profile-hero .portrait {
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
}
.profile-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 28%, rgba(4,5,8,.83) 100%); pointer-events: none; }
.profile-hero-title { position: absolute; right: 17px; bottom: 14px; left: 17px; }
.profile-hero-title .eyebrow { margin: 0; }
.profile-hero-title h3 { margin: 5px 0 0; }
.editor-profile-panel .bio, .editor-profile-panel .editor-credit { padding: 0 16px; }
.editor-profile-panel .contact-row { padding: 0 16px; grid-template-columns: repeat(2,1fr); }
.teacher-card .eyebrow { margin: 14px 0 0; }
.teacher-card h3 { margin: 6px 0 0; font-size: 1.25rem; }
.bio { max-width: 330px; margin: 9px auto 0; color: var(--muted); font-size: .77rem; line-height: 1.55; }
.editor-credit { max-width: 330px; margin: 10px auto 0; color: rgba(255,255,255,.82); font-size: .73rem; line-height: 1.45; }
.editor-credit strong { color: var(--accent); }
.contact-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 17px; }
.contact-button {
  display: grid; place-items: center; min-height: 42px; padding: 7px 4px; border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255,255,255,.04); color: var(--text); font-size: .68rem; text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}
.contact-button:hover { border-color: rgba(216,187,121,.35); background: rgba(216,187,121,.09); }
.settings-section {
  margin-top: 12px; padding: 14px; border: 1px solid rgba(255,255,255,.085); border-radius: 19px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  box-shadow: inset 0 1px rgba(255,255,255,.035);
}
.settings-section-heading {
  display: flex; align-items: center; gap: 9px;
}
.settings-section-icon {
  display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto;
  border: 1px solid rgba(216,187,121,.25); border-radius: 10px; background: rgba(216,187,121,.09);
  color: var(--gold); font-size: .82rem;
}
.settings-eyebrow {
  margin: 0; color: rgba(157,162,174,.66); font-size: .54rem; font-weight: 760; letter-spacing: .11em;
}
.settings-section h3 { margin: 3px 0 0; font-size: .88rem; }
.settings-preference {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(255,255,255,.06);
}
.settings-preference strong { display: block; font-size: .7rem; font-weight: 680; }
.settings-preference small { display: block; margin-top: 3px; color: var(--muted); font-size: .59rem; line-height: 1.4; }
.preference-value {
  flex: 0 0 auto; padding: 5px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px;
  color: var(--muted); font-size: .57rem; white-space: nowrap;
}
.preference-value.active {
  border-color: rgba(85,240,161,.25); background: rgba(85,240,161,.08); color: var(--green);
}
.theme-preference { align-items: center; }
.theme-segmented {
  display: inline-flex; flex: 0 0 auto; padding: 3px; gap: 2px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: rgba(0,0,0,.18);
}
.theme-segmented button {
  padding: 6px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font-size: .54rem; font-weight: 700; cursor: pointer; transition: color .2s ease, background .2s ease;
}
.theme-segmented button.active { background: rgba(255,255,255,.13); color: var(--text); }
.version-badge {
  margin-left: auto; padding: 5px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px;
  color: var(--muted); font-size: .55rem;
}
.settings-feature-row {
  display: grid; grid-template-columns: 9px 1fr 9px 1fr; gap: 7px; align-items: center;
  margin-top: 13px; color: rgba(157,162,174,.78); font-size: .59rem;
}
.settings-feature-row > span:nth-child(odd) { color: var(--green); font-size: .5rem; }
.settings-note { margin: 14px 3px 0; color: rgba(157,162,174,.7); font-size: .66rem; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 90; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 999px; background: rgba(22,24,31,.96); font-size: .73rem; white-space: nowrap;
  opacity: 0; pointer-events: none; transform: translate(-50%,10px); transition: opacity .2s ease, transform .2s ease;
}
.toast.visible { opacity: 1; transform: translate(-50%,0); }

/* Apple-style light appearance. */
body[data-theme="light"] {
  --bg: #dce1e7;
  --panel: rgba(235,238,242,.88);
  --panel-solid: #edf0f4;
  --text: #15191f;
  --muted: #5e6875;
  --line: rgba(36,43,54,.18);
  --green: #16a765;
  --apple-green: #1c9b57;
  --gold: #a77722;
  background:
    radial-gradient(circle at 50% -12%, rgba(255,255,255,.82), transparent 31rem),
    radial-gradient(circle at 12% 30%, rgba(179,188,201,.48), transparent 24rem),
    linear-gradient(180deg,#e9edf2,var(--bg) 72%);
}
body[data-theme="light"] .app-shell { color: var(--text); }
body[data-theme="light"] .headstock-live-feedback,
body[data-theme="light"] .settings-section,
body[data-theme="light"] .teacher-card,
body[data-theme="light"] .warmup-sheet,
body[data-theme="light"] .settings-sheet {
  position: relative;
  background: rgba(225,230,237,.9);
  box-shadow: 0 15px 38px rgba(57,68,85,.17), inset 0 1px rgba(255,255,255,.78);
}
body[data-theme="light"] .settings-sheet {
  overflow-y: auto;
  overflow-x: hidden;
}
body[data-theme="light"] .headstock-live-feedback::before,
body[data-theme="light"] .settings-section::before,
body[data-theme="light"] .teacher-card::before,
body[data-theme="light"] .warmup-sheet::before,
body[data-theme="light"] .settings-sheet::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: -1;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.62) 50%, transparent 62%);
  animation: lightCardSheen 8s ease-in-out infinite;
}
@keyframes lightCardSheen {
  0%, 25% { transform: translateX(-32%) rotate(6deg); opacity: .12; }
  58% { transform: translateX(32%) rotate(6deg); opacity: .42; }
  100% { transform: translateX(32%) rotate(6deg); opacity: .12; }
}
body[data-theme="light"] .mode-switcher,
body[data-theme="light"] .language-button,
body[data-theme="light"] .status,
body[data-theme="light"] .string-button,
body[data-theme="light"] .icon-button {
  background: linear-gradient(145deg, rgba(244,246,249,.86), rgba(196,204,214,.84));
  box-shadow: inset 0 1px rgba(255,255,255,.78), 0 6px 16px rgba(54,64,80,.12);
}
body[data-theme="light"] .mode-button.active,
body[data-theme="light"] .theme-segmented button.active {
  color: #111318; background: rgba(82,94,110,.24); box-shadow: inset 0 1px rgba(255,255,255,.6);
}
body[data-theme="light"] .language-menu {
  background: rgba(225,230,237,.97); box-shadow: 0 18px 42px rgba(47,57,73,.24);
}
body[data-theme="light"] .language-menu button { color: #303743; }
body[data-theme="light"] .language-menu button:hover,
body[data-theme="light"] .language-menu button[aria-selected="true"] { background: rgba(22,167,101,.12); color: #111318; }
body[data-theme="light"] .settings-note,
body[data-theme="light"] footer { color: rgba(75,84,96,.7); }
body[data-theme="light"] .headstock-live-feedback,
body[data-theme="light"] .headstock-live-feedback *,
body[data-theme="light"] .settings-section,
body[data-theme="light"] .settings-section *,
body[data-theme="light"] .teacher-card,
body[data-theme="light"] .teacher-card *,
body[data-theme="light"] .settings-sheet,
body[data-theme="light"] .settings-sheet *,
body[data-theme="light"] .warmup-sheet,
body[data-theme="light"] .warmup-sheet * {
  color: #26303c;
}
body[data-theme="light"] .headstock-live-feedback small,
body[data-theme="light"] .settings-section small,
body[data-theme="light"] .teacher-card .bio,
body[data-theme="light"] .settings-eyebrow,
body[data-theme="light"] .settings-note {
  color: #687483 !important;
}
body[data-theme="light"] .headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-primary-guidance > strong,
body[data-theme="light"] .headstock-live-feedback[data-headstock-live-state="in-tune"] .headstock-primary-guidance > small {
  color: #14834d !important;
}
body[data-theme="light"] .theme-segmented,
body[data-theme="light"] .tuning-feedback-bubble,
body[data-theme="light"] .string-health {
  background: rgba(194,202,212,.68);
  border-color: rgba(51,60,73,.16);
}
body[data-theme="light"] .headstock-panel {
  filter: drop-shadow(0 18px 24px rgba(49,57,70,.15));
}
body[data-theme="light"] .headstock-dark-photo { display: none; }
body[data-theme="light"] .headstock-light-photo {
  display: block;
  mix-blend-mode: normal;
  filter: drop-shadow(0 18px 24px rgba(49,57,70,.14));
}
body[data-theme="light"] .headstock-panel {
  overflow: visible;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body[data-theme="light"] .headstock-picture {
  overflow: visible;
  border-radius: 0;
  background: transparent;
}
body[data-theme="light"] .peg-button.active::before {
  border-color: #aeb8c4;
  background: rgba(190,199,210,.2);
  box-shadow: 0 0 0 4px rgba(174,184,196,.13), 0 0 17px rgba(182,194,207,.72);
}
body[data-theme="light"] .peg-button.active span {
  color: #4d5968;
  border-color: rgba(128,142,157,.38);
  background: rgba(232,236,241,.76);
}
body[data-theme="light"] .string-overlay path.active {
  stroke: #d6dde5;
  filter: drop-shadow(0 0 4px rgba(155,169,184,.9));
}

@media (min-width: 600px) {
  .settings-backdrop { align-items: center; }
  .warmup-backdrop { align-items: center; }
}
@media (max-width: 370px) {
  .app-shell { padding-inline: 12px; }
  .top-bar { gap: 6px; }
  .mode-button { padding-inline: 9px; }
  .visual-stage { height: 330px; }
  .mode-view[data-mode-view="headstock"] { gap: 9px; }
  .headstock-live-feedback { width: min(270px, 82vw); }
  .headstock-panel { height: 235px; }
}

/* Mobile portrait layout: compact and close to the supplied reference. */
@media (max-width: 599px) {
  .app-shell {
    width: min(100%, 430px);
    padding: max(12px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
  }
  .app-header { grid-template-columns: 36px 1fr 36px; }
  .icon-button { width: 36px; height: 36px; border-radius: 12px; }
  .brand h1 { font-size: 1rem; }
  .brand p { font-size: .62rem; }
  .top-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "status status" "mode auto" "language language";
    gap: 9px;
    margin-top: 14px;
  }
  .top-bar > .status { grid-area: status; width: 100%; text-align: center; }
  .top-bar > .mode-switcher { grid-area: mode; justify-self: start; }
  .top-bar > .auto-control { grid-area: auto; justify-self: end; }
  .top-bar > .language-control { grid-area: language; justify-self: end; }
  .visual-stage { height: 570px; margin-top: 12px; }
  .mode-view[data-mode-view="headstock"] { gap: 10px; padding-top: 0; }
  .headstock-live-feedback { width: 100%; min-height: 110px; padding: 12px 14px 10px; border-radius: 20px; }
  .headstock-live-main { grid-template-columns: minmax(96px, .86fr) 1.14fr; gap: 10px; margin-top: 9px; }
  .headstock-live-copy > strong { font-size: 1.62rem; }
  .headstock-primary-guidance > strong { font-size: 1.05rem; }
  .headstock-panel { align-self: center; height: min(420px, 104vw); max-height: 420px; border-radius: 24px; }
  .readings { width: min(330px, 92vw); min-height: 122px; margin-top: 4px; }
  #frequency { font-size: 1.22rem; }
  #message { font-size: .84rem; }
  .strings {
    display: flex; gap: 8px; margin: 2px -12px 0; padding: 0 12px 5px;
    overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
  }
  .strings::-webkit-scrollbar { display: none; }
  .string-button {
    flex: 0 0 76px; min-height: 72px; padding: 10px 5px 8px;
    scroll-snap-align: center; border-radius: 15px;
  }
  .string-button strong { font-size: 1.08rem; }
  .string-button small { font-size: .62rem; }
  .controls { margin-top: 12px; }
  .primary-button { min-width: 148px; padding: 12px 21px; }
  footer { margin-top: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
    
/* =========================================
   AZARAKHSH_HEADSTOCK_HIGHLIGHT_PATCH
   Headstock per-string visual states
   ========================================= */

.string-overlay path.flat {
  stroke: rgba(140, 182, 255, 0.95);
  filter: drop-shadow(0 0 3px rgba(140, 182, 255, 0.7));
}

.string-overlay path.sharp {
  stroke: rgba(255, 196, 140, 0.95);
  filter: drop-shadow(0 0 3px rgba(255, 196, 140, 0.7));
}

.peg-button.flat span {
  color: #A5D8FF;
}

.peg-button.sharp span {
  color: #FFD8A8;
}
