/* ==========================================================================
   NR-CSS: Next Rep V7.5.3 unified coach visual system + palette correction
   Source split note: this file is bundled into single-file and PWA builds.
   ========================================================================== */
    :root {
      color-scheme: dark;
      --bg: #090a0c;
      --panel: #14161a;
      --panel-2: #1c2026;
      --panel-3: #242a32;
      --text: #f6f3eb;
      --muted: #c8c0b4;
      --soft: #938a7e;
      --line: #3a4049;
      --line-strong: #66707f;
      --mint: #61d6a8;
      --mint-dark: #14392c;
      --amber: #f0bd62;
      --coral: #ff8a72;
      --blue: #8ec7ff;
      --danger: #ff6b6b;
      --shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
      --radius: 8px;
      --tap: 48px;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    html {
      min-height: 100%;
      background: var(--bg);
    }

    body {
      min-height: 100%;
      margin: 0;
      background:
        radial-gradient(circle at top left, rgba(97, 214, 168, 0.08), transparent 32rem),
        linear-gradient(180deg, #0d0e11 0%, #090a0c 58%, #07080a 100%);
      color: var(--text);
    }

    button,
    input,
    select,
    textarea {
      font: inherit;
    }

    button,
    select,
    input[type="checkbox"],
    input[type="range"] {
      cursor: pointer;
    }

    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
      outline: 3px solid var(--amber);
      outline-offset: 2px;
    }

    .app-shell {
      width: min(1100px, 100%);
      margin: 0 auto;
      padding: 18px;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
      padding: 8px 0 22px;
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      min-width: 0;
    }

    .brand-mark {
      display: grid;
      place-items: center;
      width: 44px;
      height: 44px;
      border: 1px solid var(--line-strong);
      background: #101215;
      color: var(--mint);
      border-radius: var(--radius);
      font-weight: 850;
    }

    .brand h1 {
      margin: 0;
      font-size: clamp(1.45rem, 2.5vw, 2rem);
      line-height: 1;
      letter-spacing: 0;
    }

    .brand p {
      margin: 5px 0 0;
      color: var(--muted);
      font-size: 0.94rem;
    }

    .top-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 10px;
      flex-wrap: wrap;
    }

    .pack-picker {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--muted);
      font-size: 0.92rem;
    }

    .select,
    .text-input,
    .textarea {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0f1114;
      color: var(--text);
      min-height: var(--tap);
    }

    .select {
      padding: 0 38px 0 13px;
    }

    .textarea {
      min-height: 146px;
      padding: 16px;
      resize: vertical;
      line-height: 1.45;
      font-size: 1.08rem;
    }

    .text-input {
      padding: 0 13px;
    }

    .button {
      border: 1px solid var(--line-strong);
      border-radius: var(--radius);
      min-height: var(--tap);
      padding: 0 16px;
      background: var(--panel-2);
      color: var(--text);
      font-weight: 760;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
      text-decoration: none;
    }

    .button:hover {
      background: var(--panel-3);
      transform: translateY(-1px);
    }

    .button:active {
      transform: translateY(0);
    }

    .button.primary {
      background: var(--mint);
      color: #06110d;
      border-color: var(--mint);
      min-height: 56px;
      font-size: 1rem;
    }

    .button.primary:hover {
      background: #7de4ba;
    }

    .button.warn {
      border-color: rgba(255, 107, 107, 0.75);
      color: #ffd8d8;
    }

    .button.success {
      border-color: rgba(97, 214, 168, 0.75);
      color: var(--mint);
    }

    .button.ghost {
      background: transparent;
    }

    .button.small {
      min-height: 40px;
      padding: 0 12px;
      font-size: 0.9rem;
    }

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .screen {
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: var(--radius);
      background: rgba(20, 22, 26, 0.78);
      box-shadow: var(--shadow);
      padding: clamp(18px, 4vw, 34px);
    }

    .prompt-kicker,
    .eyebrow {
      color: var(--amber);
      text-transform: uppercase;
      font-size: 0.78rem;
      font-weight: 850;
      letter-spacing: 0.08em;
    }

    .prompt-head {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 14px;
    }

    .hero-title {
      margin: 12px 0 10px;
      font-size: clamp(2rem, 6vw, 4rem);
      line-height: 1.02;
      letter-spacing: 0;
      max-width: 12ch;
    }

    .hero-copy {
      max-width: 720px;
      color: var(--muted);
      font-size: clamp(1.02rem, 2vw, 1.2rem);
      line-height: 1.55;
      margin: 0 0 24px;
    }

    .input-label {
      display: block;
      color: var(--text);
      font-weight: 780;
      margin-bottom: 10px;
    }

    .task-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
      margin: 18px 0 14px;
    }

    .task-button {
      min-height: 58px;
      border: 1px solid var(--line);
      background: #101215;
      color: var(--text);
      border-radius: var(--radius);
      font-weight: 850;
    }

    .task-button[aria-pressed="true"] {
      background: var(--mint-dark);
      border-color: var(--mint);
      color: var(--mint);
    }

    .chip-row {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin: 14px 0 22px;
    }

    .chip {
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #0f1114;
      color: var(--text);
      padding: 0 14px;
      font-weight: 700;
    }

    .chip:hover {
      border-color: var(--amber);
    }

    .primary-row {
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    .privacy-note {
      color: var(--soft);
      font-size: 0.9rem;
      line-height: 1.45;
      margin: 14px 0 0;
    }

    .home-helper-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
      gap: 12px;
      margin-top: 18px;
    }

    .home-panel {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: rgba(12, 14, 17, 0.62);
      padding: 14px;
    }

    .home-panel-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 10px;
    }

    .home-panel h3 {
      margin: 0;
      font-size: 1rem;
      color: var(--text);
      letter-spacing: 0;
    }

    .home-panel-note {
      margin: 0;
      color: var(--soft);
      font-size: 0.9rem;
      line-height: 1.35;
    }

    .environment-panel {
      grid-column: 1 / -1;
      border-color: rgba(240, 189, 98, 0.42);
      background: linear-gradient(135deg, rgba(240, 189, 98, 0.08), rgba(97, 214, 168, 0.035));
    }

    .environment-list {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .environment-chip {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0f1114;
      padding: 10px;
      min-height: 72px;
    }

    .environment-chip strong {
      display: block;
      color: var(--text);
      margin-bottom: 4px;
    }

    .environment-chip span {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.35;
    }

    .environment-chip.good {
      border-color: rgba(97, 214, 168, 0.55);
    }

    .environment-chip.warn {
      border-color: rgba(240, 189, 98, 0.58);
    }

    .environment-chip.bad {
      border-color: rgba(255, 138, 114, 0.62);
    }

    .starter-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .starter-card {
      min-height: 92px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0f1114;
      color: var(--text);
      text-align: left;
      padding: 12px;
      display: grid;
      align-content: start;
      gap: 6px;
    }

    .starter-card:hover {
      border-color: var(--amber);
      background: #14171c;
    }

    .quick-tools-panel {
      border-color: rgba(97, 214, 168, 0.34);
      background: linear-gradient(135deg, rgba(97, 214, 168, 0.06), rgba(240, 189, 98, 0.035));
    }

    .quick-tool-row {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .quick-tool-button {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #101318;
      color: var(--text);
      min-height: 64px;
      padding: 10px 12px;
      text-align: left;
      display: grid;
      gap: 3px;
      align-content: center;
    }

    .quick-tool-button strong {
      display: block;
      font-size: 0.96rem;
    }

    .quick-tool-button span {
      color: var(--muted);
      font-size: 0.82rem;
      line-height: 1.25;
    }

    .quick-tool-button.primary-tool {
      border-color: rgba(240, 189, 98, 0.55);
      background: rgba(240, 189, 98, 0.08);
    }

    .starter-pack {
      color: var(--amber);
      font-size: 0.76rem;
      font-weight: 900;
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }

    .starter-text {
      color: var(--text);
      font-weight: 850;
      line-height: 1.3;
    }

    .home-shelf {
      display: grid;
      gap: 8px;
    }

    .home-shelf-item {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0f1114;
      padding: 10px;
      display: grid;
      gap: 6px;
    }

    .home-shelf-title {
      color: var(--text);
      font-weight: 850;
      line-height: 1.3;
      margin: 0;
    }

    .home-shelf-meta {
      margin: 0;
      color: var(--muted);
      font-size: 0.88rem;
      line-height: 1.35;
    }


    .result-screen {
      display: grid;
      gap: 16px;
    }

    .result-top {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      align-items: flex-start;
      flex-wrap: wrap;
    }

    .rep-card,
    .step-card,
    .tool-band,
    .settings-section,
    .saved-item {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #111317;
    }

    .rep-card,
    .step-card,
    .tool-band {
      padding: clamp(16px, 3vw, 24px);
    }

    .rep-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-bottom: 12px;
    }

    .pill {
      display: inline-flex;
      align-items: center;
      min-height: 30px;
      padding: 0 10px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: var(--muted);
      background: #0c0d10;
      font-weight: 750;
      font-size: 0.82rem;
    }

    .pill.good {
      color: var(--mint);
      border-color: rgba(97, 214, 168, 0.5);
      background: rgba(97, 214, 168, 0.08);
    }

    .rep-card h2 {
      margin: 0 0 10px;
      font-size: clamp(1.5rem, 4vw, 2.55rem);
      line-height: 1.05;
      letter-spacing: 0;
    }

    .coach-note {
      color: var(--muted);
      font-size: 1.05rem;
      line-height: 1.55;
      margin: 0;
    }

    .rep-practice-panel {
      display: grid;
      grid-template-columns: minmax(0, 1.8fr) minmax(120px, 0.7fr) minmax(0, 1.4fr);
      gap: 10px;
      margin-top: 16px;
    }

    .rep-practice-item {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0c0e11;
      padding: 12px;
    }

    .rep-practice-label {
      color: var(--amber);
      font-size: 0.74rem;
      font-weight: 900;
      letter-spacing: 0.08em;
      margin-bottom: 6px;
      text-transform: uppercase;
    }

    .rep-practice-value {
      color: var(--text);
      font-size: 1rem;
      font-weight: 800;
      line-height: 1.35;
    }

    .mobile-rep-brief,
    .practice-focus-strip {
      display: none;
    }

    .practice-lane {
      border: 1px solid rgba(97, 214, 168, 0.42);
      border-radius: var(--radius);
      background: rgba(97, 214, 168, 0.055);
      padding: clamp(14px, 2.5vw, 18px);
    }

    .practice-lane-header {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 12px;
    }

    .practice-lane h3 {
      margin: 0;
      font-size: 1rem;
      color: var(--mint);
      letter-spacing: 0;
    }

    .flow-status {
      margin: 0;
      color: var(--muted);
      font-weight: 800;
    }

    .flow-buttons {
      display: grid;
      grid-template-columns: 1.15fr repeat(3, minmax(0, 0.72fr));
      gap: 8px;
    }

    .flow-buttons .button {
      min-height: 58px;
    }

    .step-tabs {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .step-tab {
      min-height: 52px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0e1013;
      color: var(--muted);
      font-weight: 850;
    }

    .step-tab[aria-selected="true"] {
      background: rgba(240, 189, 98, 0.15);
      border-color: var(--amber);
      color: var(--text);
    }

    .step-card h3,
    .tool-band h3 {
      margin: 0 0 10px;
      font-size: 1.25rem;
    }

    .step-card p,
    .tool-band p {
      margin: 0 0 12px;
      color: var(--muted);
      line-height: 1.55;
    }

    .step-list {
      margin: 12px 0 0;
      padding-left: 1.2rem;
      color: var(--text);
      line-height: 1.55;
    }

    .step-list li + li {
      margin-top: 6px;
    }

    .practice-callout {
      border-left: 4px solid var(--mint);
      background: rgba(97, 214, 168, 0.08);
      padding: 12px;
      border-radius: 0 var(--radius) var(--radius) 0;
      margin-top: 14px;
      color: var(--text);
      line-height: 1.45;
      font-weight: 700;
    }

    .step-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      margin-top: 14px;
    }

    .explain-box {
      margin-top: 14px;
    }

    .tool-buttons,
    .action-bar,
    .modal-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .action-bar {
      align-items: center;
    }

    .muted-line {
      color: var(--muted);
      line-height: 1.45;
      margin: 8px 0 0;
    }

    .drawer {
      position: fixed;
      inset: 0;
      z-index: 40;
      display: grid;
      grid-template-columns: minmax(0, 1fr) min(560px, 100%);
      background: rgba(0, 0, 0, 0.58);
    }

    .drawer-panel,
    .modal-panel {
      background: #101216;
      border-left: 1px solid var(--line);
      box-shadow: var(--shadow);
      overflow: auto;
    }

    .drawer-panel {
      padding: 20px;
    }

    .drawer-scrim {
      min-width: 0;
      border: 0;
      background: transparent;
    }

    .drawer-flow-actions {
      position: sticky;
      bottom: -20px;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin: 16px -20px -20px;
      padding: 12px 20px 20px;
      border-top: 1px solid var(--line);
      background: rgba(16, 18, 22, 0.98);
    }

    .drawer-header,
    .modal-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 14px;
      margin-bottom: 16px;
    }

    .drawer-header h2,
    .modal-header h2 {
      margin: 0;
      font-size: 1.45rem;
      letter-spacing: 0;
    }

    .tool-group {
      margin: 18px 0;
    }

    .tool-group.recommended {
      border: 1px solid rgba(97, 214, 168, 0.45);
      border-radius: var(--radius);
      background: rgba(97, 214, 168, 0.06);
      padding: 12px;
    }

    .tool-group h3 {
      margin: 0 0 8px;
      color: var(--amber);
      font-size: 0.9rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .more-tools-panel {
      border: 1px dashed var(--line-strong);
      border-radius: var(--radius);
      padding: 12px;
      margin: 12px 0;
      background: #0c0e11;
    }

    .tool-choice-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
    }

    .tool-choice {
      min-height: 50px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #15181d;
      color: var(--text);
      font-weight: 800;
      text-align: left;
      padding: 10px;
    }

    .tool-choice strong {
      display: block;
      color: var(--text);
      font-size: 0.94rem;
    }

    .tool-choice span {
      display: block;
      color: var(--muted);
      font-size: 0.8rem;
      margin-top: 3px;
      line-height: 1.25;
    }

    .tool-choice[aria-pressed="true"] {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.1);
    }

    .tool-choice[aria-pressed="true"] strong {
      color: var(--mint);
    }

    .active-tool-banner {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid rgba(240, 189, 98, 0.42);
      border-radius: var(--radius);
      background: rgba(240, 189, 98, 0.08);
      padding: 10px 12px;
      margin: 4px 0 12px;
    }

    .active-tool-banner strong {
      display: block;
      font-size: 0.98rem;
    }

    .active-tool-banner span {
      display: block;
      color: var(--muted);
      font-size: 0.86rem;
      margin-top: 2px;
    }

    .active-tool-panel {
      margin-top: 0;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius-lg);
      background: #111419;
      padding: 16px;
      box-shadow: var(--shadow-soft);
    }

    .active-tool-panel h3 {
      margin-top: 0;
    }

    .tool-content {
      margin-top: 16px;
      border-top: 1px solid var(--line);
      padding-top: 16px;
    }

    .tool-content h3 {
      margin: 0 0 12px;
      font-size: 1.25rem;
    }

    .tool-content p,
    .tool-content li {
      color: var(--muted);
      line-height: 1.5;
    }

    .field-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }

    .field {
      display: grid;
      gap: 7px;
      align-content: start;
      color: var(--muted);
      font-weight: 700;
    }

    .field.full {
      grid-column: 1 / -1;
    }

    .chord-tool-layout {
      display: grid;
      grid-template-columns: minmax(130px, 180px) minmax(0, 1fr);
      gap: 14px;
      align-items: start;
    }

    .chord-list {
      display: grid;
      gap: 7px;
      max-height: 420px;
      overflow: auto;
      padding-right: 4px;
    }

    .chord-pick {
      min-height: 42px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      color: var(--text);
      font-weight: 850;
    }

    .chord-pick.is-active,
    .chord-pick[aria-pressed="true"].is-active {
      border-color: var(--amber);
      color: var(--amber);
      background: rgba(240, 189, 98, 0.08);
    }

    .chord-name {
      font-size: clamp(2rem, 8vw, 4rem);
      line-height: 1;
      margin: 0 0 10px;
    }

    .chord-table-wrap {
      overflow-x: auto;
    }

    .chord-table {
      width: min(520px, 100%);
      border-collapse: collapse;
      table-layout: fixed;
      background: #0c0d10;
    }

    .chord-table th,
    .chord-table td {
      border: 1px solid var(--line-strong);
      text-align: center;
      min-width: 44px;
      height: 46px;
      padding: 4px;
    }

    .chord-table thead th {
      color: var(--muted);
      font-size: 0.82rem;
      height: 34px;
    }

    .chord-table .fret-label {
      width: 46px;
      color: var(--soft);
      font-weight: 800;
    }

    .string-state {
      font-weight: 900;
      color: var(--amber);
    }

    .finger-dot {
      display: inline-grid;
      place-items: center;
      width: 32px;
      height: 32px;
      border-radius: 999px;
      background: var(--mint);
      color: #06110d;
      font-weight: 950;
    }

    .metro-face {
      display: grid;
      gap: 16px;
    }

    .beat-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px;
    }

    .beat {
      min-height: 90px;
      display: grid;
      place-items: center;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      color: var(--muted);
      font-size: 2rem;
      font-weight: 950;
    }

    .beat.active {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.16);
      color: var(--mint);
    }

    .beat.accent {
      border-color: var(--amber);
      color: var(--amber);
    }

    .bpm-display {
      font-size: 4.25rem;
      line-height: 1;
      font-weight: 950;
      color: var(--text);
    }

    .metro-control-row {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
    }

    .trainer-status {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      margin: 14px 0;
    }

    .trainer-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0c0e11;
      padding: 14px;
      min-height: 112px;
    }

    .trainer-card.current {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.1);
    }

    .trainer-label {
      color: var(--muted);
      font-size: 0.82rem;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    .trainer-chord {
      color: var(--text);
      font-size: clamp(2.6rem, 12vw, 5rem);
      line-height: 1;
      font-weight: 950;
      margin-top: 8px;
    }

    .trainer-beat {
      color: var(--amber);
      font-weight: 900;
      margin-top: 8px;
    }

    .trainer-pulse-row {
      display: grid;
      grid-template-columns: repeat(8, minmax(22px, 1fr));
      gap: 6px;
      margin: 10px 0 14px;
    }

    .trainer-pulse {
      min-height: 22px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: #0a0c0f;
    }

    .trainer-pulse.active {
      border-color: var(--mint);
      background: var(--mint);
      box-shadow: 0 0 18px rgba(97, 214, 168, 0.32);
    }

    .stats-grid,
    .trainer-metrics {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px;
      margin: 12px 0;
    }

    .stat-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 10px;
      min-height: 72px;
    }

    .stat-label {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    .stat-value {
      color: var(--text);
      font-size: 1.45rem;
      font-weight: 950;
      line-height: 1.1;
      margin-top: 6px;
    }

    .rep-card-actions {
      display: grid;
      grid-template-columns: minmax(0, 1.3fr) minmax(160px, 0.45fr);
      gap: 10px;
      margin-top: 14px;
    }

    .start-rep-button {
      min-height: 68px;
      font-size: clamp(1.08rem, 2.4vw, 1.35rem);
    }

    .today-rep-button {
      border-color: rgba(97, 214, 168, 0.78);
      color: var(--mint);
      background: rgba(97, 214, 168, 0.08);
    }

    .current-rep-dock {
      position: fixed;
      left: 50%;
      bottom: 14px;
      transform: translateX(-50%);
      z-index: 62;
      width: min(560px, calc(100% - 24px));
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 8px;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius);
      background: rgba(12, 14, 17, 0.96);
      box-shadow: var(--shadow);
      padding: 8px;
    }

    .current-rep-dock .button {
      width: 100%;
      min-height: 52px;
    }

    .mobile-practice-shell,
    .flow-check-sheet,
    .rep-details-sheet {
      display: none;
    }

    .mobile-tools-peek {
      width: 100%;
      min-height: 48px;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius) var(--radius) 0 0;
      background: rgba(17, 19, 23, 0.98);
      color: var(--text);
      padding: 9px 12px;
      text-align: left;
      font-weight: 850;
    }

    .mobile-tools-label {
      display: block;
    }

    .mobile-tools-summary {
      display: block;
      margin-top: 3px;
      color: var(--muted);
      font-size: 0.82rem;
      font-weight: 700;
    }

    .mobile-bottom-bar {
      display: grid;
      gap: 8px;
      border: 1px solid var(--line-strong);
      border-top: 0;
      border-radius: 0 0 var(--radius) var(--radius);
      background: rgba(10, 12, 15, 0.98);
      box-shadow: var(--shadow);
      padding: 8px;
    }

    .mobile-stage-start,
    .mobile-stage-check {
      display: grid;
      gap: 8px;
    }

    .mobile-stage-start {
      grid-template-columns: minmax(0, 0.72fr) minmax(0, 0.72fr) minmax(0, 1.16fr);
    }

    .mobile-stage-check {
      grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .mobile-bottom-bar .button {
      min-height: 54px;
      padding: 0 10px;
    }

    .flow-check-sheet,
    .rep-details-sheet {
      position: fixed;
      inset: 0;
      z-index: 66;
      align-items: flex-end;
      background: rgba(0, 0, 0, 0.58);
    }

    .flow-check-panel,
    .rep-details-panel {
      width: 100%;
      border: 1px solid var(--line-strong);
      border-bottom: 0;
      border-radius: 18px 18px 0 0;
      background: #101216;
      box-shadow: var(--shadow);
      padding: 18px;
    }

    .flow-check-panel h2,
    .rep-details-panel h2 {
      margin: 0 0 10px;
      font-size: 1.35rem;
    }

    .flow-check-panel p,
    .rep-details-panel p {
      color: var(--muted);
      line-height: 1.45;
    }

    .flow-check-actions {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 8px;
      margin-top: 14px;
    }

    .rep-details-panel {
      max-height: min(82vh, 760px);
      overflow: auto;
    }

    .rep-details-content {
      display: grid;
      gap: 12px;
    }

    .rep-detail-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 8px;
    }

    .rep-detail-card,
    .rep-detail-step,
    .rep-detail-tools {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 12px;
    }

    .rep-detail-label {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 6px;
    }

    .rep-detail-value {
      color: var(--text);
      font-weight: 850;
      line-height: 1.35;
    }

    .rep-detail-step h3 {
      margin: 0 0 8px;
      color: var(--amber);
    }

    .rep-detail-tool-buttons,
    .mobile-detail-actions {
      display: grid;
      gap: 8px;
    }

    .rep-detail-tool-buttons {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-detail-actions {
      grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
      margin-top: 14px;
      position: sticky;
      bottom: -18px;
      background: #101216;
      padding-top: 10px;
    }

    .inline-check {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--muted);
      font-weight: 750;
    }

    .nash-grid {
      display: grid;
      grid-template-columns: repeat(7, minmax(86px, 1fr));
      gap: 8px;
      overflow-x: auto;
      padding-bottom: 4px;
    }

    .nash-cell {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 12px;
      min-height: 118px;
    }

    .nash-num {
      color: var(--amber);
      font-size: 1.25rem;
      font-weight: 950;
    }

    .nash-chord {
      font-size: 1.8rem;
      font-weight: 950;
      margin: 8px 0;
    }

    .function-copy {
      color: var(--muted);
      font-size: 0.9rem;
      line-height: 1.35;
    }

    .output-box,
    .tab-box,
    .prompt-output {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0b0c0f;
      color: var(--text);
      padding: 14px;
      min-height: 58px;
      white-space: pre-wrap;
      line-height: 1.45;
    }

    .chart-transition-list {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .chart-transition {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 10px 12px;
      color: var(--text);
      font-weight: 850;
    }

    .capo-options {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .capo-key-result {
      display: grid;
      justify-items: center;
      gap: 2px;
      margin-top: 12px;
      padding: 18px;
      border: 1px solid rgba(97, 214, 168, .28);
      border-radius: var(--radius);
      background: rgba(97, 214, 168, .09);
      text-align: center;
    }

    .capo-key-result span {
      color: var(--muted);
      font-size: .75rem;
      font-weight: 850;
      letter-spacing: .08em;
      text-transform: uppercase;
    }

    .capo-key-result strong {
      color: var(--mint);
      font-size: clamp(2.8rem, 12vw, 4.5rem);
      line-height: 1;
    }

    .capo-key-result p {
      margin: 6px 0 0;
      font-weight: 800;
    }

    .capo-map {
      margin-top: 10px;
    }

    .capo-reverse {
      margin-top: 12px;
      padding: 12px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
    }

    .capo-reverse summary {
      cursor: pointer;
      font-weight: 850;
    }

    .capo-reverse .field {
      margin-top: 12px;
    }

    .capo-option {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 12px;
      color: var(--text);
    }

    .capo-option span {
      color: var(--muted);
    }

    .tab-box {
      overflow-x: auto;
      font-family: "Cascadia Mono", Consolas, monospace;
      font-size: 1rem;
    }

    .strum-grid {
      display: grid;
      grid-template-columns: repeat(8, minmax(42px, 1fr));
      gap: 6px;
      overflow-x: auto;
    }

    .strum-cell {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 10px 6px;
      text-align: center;
      min-height: 72px;
    }

    .strum-count {
      color: var(--muted);
      font-weight: 850;
      margin-bottom: 8px;
    }

    .strum-mark {
      min-height: 28px;
      font-size: 1.25rem;
      font-weight: 950;
      color: var(--mint);
    }

    .checklist {
      display: grid;
      gap: 9px;
      margin: 12px 0;
    }

    .check-row {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 12px;
      color: var(--text);
      line-height: 1.4;
    }

    .check-row input {
      width: 22px;
      height: 22px;
      flex: 0 0 auto;
      margin-top: 1px;
    }

    .quiz-options {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    .quiz-option {
      min-height: 46px;
      text-align: left;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      color: var(--text);
      padding: 10px 12px;
      font-weight: 800;
    }

    .quiz-option.correct {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.1);
    }

    .quiz-option.wrong {
      border-color: var(--danger);
      background: rgba(255, 107, 107, 0.08);
    }

    .modal {
      position: fixed;
      inset: 0;
      z-index: 50;
      display: grid;
      place-items: center;
      background: rgba(0, 0, 0, 0.62);
      padding: 18px;
    }

    .practice-mode {
      position: fixed;
      inset: 0;
      z-index: 65;
      background: #050607;
      color: var(--text);
      padding: clamp(10px, 3vw, 22px);
      padding-bottom: 172px;
      overflow: auto;
    }

    .practice-panel {
      width: min(1040px, 100%);
      margin: 0 auto;
      min-height: calc(100vh - 44px);
      display: grid;
      gap: 14px;
      align-content: start;
    }

    .practice-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--line);
    }

    .practice-header h2 {
      margin: 0;
      font-size: clamp(1.35rem, 5vw, 2.4rem);
      letter-spacing: 0;
    }

    .practice-header-actions {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 8px;
      flex-wrap: wrap;
    }

    .practice-summary {
      display: grid;
      grid-template-columns: 1.3fr 0.65fr 1fr;
      gap: 10px;
    }

    .practice-info {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0c0e11;
      padding: 12px;
      min-height: 84px;
    }

    .practice-info-label {
      color: var(--muted);
      font-size: 0.78rem;
      font-weight: 850;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 6px;
    }

    .practice-info-value {
      color: var(--text);
      font-size: clamp(1rem, 2.2vw, 1.35rem);
      font-weight: 850;
      line-height: 1.3;
    }

    .practice-chord-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
    }

    .practice-chord-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0b0d10;
      padding: clamp(14px, 3vw, 22px);
      min-height: 180px;
      display: grid;
      align-content: center;
    }

    .practice-chord-card.current {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.09);
    }

    .practice-chord-large {
      font-size: clamp(4.6rem, 22vw, 10rem);
      line-height: 0.88;
      font-weight: 950;
      letter-spacing: 0;
    }

    .practice-pulse {
      min-height: 96px;
      border: 1px solid var(--line-strong);
      border-radius: var(--radius);
      background: #0a0c0f;
      display: grid;
      place-items: center;
      color: var(--muted);
      font-size: clamp(2.8rem, 12vw, 6rem);
      font-weight: 950;
      transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
    }

    .practice-pulse.active {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.18);
      color: var(--mint);
    }

    .practice-diagrams {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 10px;
      align-items: start;
    }

    .practice-diagrams .chord-name {
      font-size: 2.1rem;
    }

    .practice-diagrams .chord-table th,
    .practice-diagrams .chord-table td {
      min-width: 34px;
      height: 36px;
    }

    .practice-timer {
      color: var(--amber);
      font-size: clamp(2rem, 8vw, 4rem);
      font-weight: 950;
      line-height: 1;
    }

    .practice-action-bar {
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      z-index: 68;
      padding: 0 12px max(12px, env(safe-area-inset-bottom));
      background: linear-gradient(180deg, rgba(5, 6, 7, 0), #050607 22%, #050607 100%);
    }

    .practice-action-inner {
      width: min(720px, 100%);
      margin: 0 auto;
      border: 1px solid var(--line-strong);
      border-radius: 18px 18px 0 0;
      background: rgba(12, 14, 17, 0.98);
      box-shadow: var(--shadow);
      padding: 10px;
      display: grid;
      gap: 8px;
    }

    .practice-media-row,
    .practice-difficulty-row {
      display: grid;
      gap: 8px;
    }

    .practice-media-row {
      grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .practice-difficulty-row {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-icon-button {
      min-height: 58px;
      padding: 0;
      font-size: 1.55rem;
      line-height: 1;
      font-weight: 950;
    }

    .practice-icon-button[aria-pressed="true"] {
      background: rgba(97, 214, 168, 0.16);
      border-color: var(--mint);
      color: var(--mint);
    }

    .practice-difficulty-row .button {
      min-height: 56px;
      font-size: 1rem;
    }

    .modal-panel {
      width: min(760px, 100%);
      max-height: min(88vh, 900px);
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 20px;
    }

    .settings-section {
      padding: 16px;
      margin: 14px 0;
    }

    .settings-section h3 {
      margin: 0 0 12px;
      color: var(--amber);
      font-size: 1rem;
    }

    .saved-list {
      display: grid;
      gap: 10px;
      margin-top: 12px;
    }

    .saved-item {
      padding: 12px;
    }

    .saved-item h4 {
      margin: 0 0 6px;
      font-size: 1rem;
    }

    .saved-item p {
      margin: 0 0 10px;
      color: var(--muted);
      line-height: 1.4;
    }

    .saved-item.favorite {
      border-color: rgba(240, 189, 98, 0.72);
      background: rgba(240, 189, 98, 0.06);
    }

    .history-list {
      display: grid;
      gap: 8px;
      margin-top: 10px;
    }

    .history-item {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 10px 12px;
    }

    .history-item h4 {
      margin: 0 0 6px;
      font-size: 0.98rem;
    }

    .history-item p {
      margin: 0;
      color: var(--muted);
      line-height: 1.4;
    }



    .rep-pack-showcase {
      border: 1px solid rgba(240, 189, 98, 0.32);
      border-radius: var(--radius);
      background: rgba(240, 189, 98, 0.045);
      padding: clamp(14px, 2.6vw, 20px);
      margin: 18px 0 20px;
    }

    .rep-pack-showcase.compact {
      margin: 0;
      background: rgba(240, 189, 98, 0.035);
    }

    .rep-pack-showcase h3 {
      margin: 0 0 6px;
      color: var(--text);
      font-size: clamp(1.1rem, 2.4vw, 1.45rem);
      letter-spacing: 0;
    }

    .rep-pack-showcase-copy {
      margin: 0 0 14px;
      color: var(--muted);
      line-height: 1.45;
    }

    .rep-pack-grid {
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .rep-pack-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 14px;
      min-height: 210px;
      display: grid;
      gap: 10px;
      align-content: start;
    }

    .rep-pack-card.active {
      border-color: var(--mint);
      background: rgba(97, 214, 168, 0.08);
    }

    .rep-pack-card h4 {
      margin: 0;
      font-size: 1.05rem;
      letter-spacing: 0;
    }

    .rep-pack-tagline {
      color: var(--muted);
      line-height: 1.42;
      margin: 0;
      min-height: 44px;
    }

    .rep-pack-flavor {
      color: var(--soft);
      line-height: 1.35;
      margin: 0;
      font-size: 0.92rem;
    }

    .rep-pack-meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 2px;
    }

    .rep-pack-actions {
      display: grid;
      gap: 8px;
      margin-top: 2px;
    }

    .rep-pack-details {
      border-top: 1px solid var(--line);
      padding-top: 10px;
      color: var(--muted);
      line-height: 1.42;
      font-size: 0.92rem;
    }

    .rep-pack-details summary {
      cursor: pointer;
      color: var(--amber);
      font-weight: 850;
    }

    .rep-pack-details ul {
      margin: 8px 0 0;
      padding-left: 1.15rem;
    }

    .rep-pack-coming-soon {
      border: 1px dashed var(--line-strong);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.03);
      padding: 12px;
      margin-top: 12px;
      color: var(--muted);
      line-height: 1.4;
    }

    .rep-pack-coming-soon strong {
      color: var(--text);
    }


    .rep-pack-permissions {
      display: grid;
      gap: 8px;
      margin-top: 12px;
    }

    .rep-pack-permission {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: #0d0f12;
      padding: 10px 12px;
    }

    .rep-pack-permission-head {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      margin-bottom: 5px;
    }

    .rep-pack-permission-title {
      color: var(--text);
      font-weight: 900;
    }

    .permission-law {
      border: 1px solid rgba(240, 189, 98, 0.34);
      border-radius: var(--radius);
      background: rgba(240, 189, 98, 0.07);
      color: var(--muted);
      padding: 10px 12px;
      margin: 12px 0;
      line-height: 1.45;
    }



    .permission-gate-body {
      display: grid;
      gap: 12px;
    }

    .permission-gate-card {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: rgba(255, 255, 255, 0.035);
      padding: 12px;
      line-height: 1.45;
    }

    .permission-gate-card strong {
      color: var(--text);
    }

    .permission-tool-note {
      border: 1px solid rgba(240, 189, 98, 0.28);
      border-radius: var(--radius);
      background: rgba(240, 189, 98, 0.06);
      padding: 10px 12px;
      margin: 10px 0 12px;
      color: var(--muted);
      line-height: 1.45;
    }



    .tuner-panel {
      display: grid;
      gap: 12px;
    }

    .tuner-readout {
      display: grid;
      place-items: center;
      min-height: 150px;
      border: 1px solid var(--line);
      border-radius: calc(var(--radius) + 6px);
      background: radial-gradient(circle at top, rgba(240, 189, 98, 0.12), rgba(255, 255, 255, 0.035));
      padding: 18px;
      text-align: center;
    }

    .tuner-note {
      font-size: clamp(3rem, 16vw, 5.2rem);
      line-height: 0.9;
      font-weight: 900;
      letter-spacing: -0.08em;
      color: var(--text);
    }

    .tuner-frequency {
      color: var(--muted);
      margin-top: 8px;
      font-size: 0.95rem;
    }

    .tuner-meter {
      position: relative;
      height: 44px;
      border: 1px solid var(--line);
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.04);
      overflow: hidden;
    }

    .tuner-meter::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 2px;
      background: rgba(240, 189, 98, 0.78);
      transform: translateX(-50%);
    }

    .tuner-needle {
      position: absolute;
      top: 6px;
      bottom: 6px;
      left: 50%;
      width: 4px;
      border-radius: 999px;
      background: var(--text);
      transform: translateX(-50%);
      transition: left 0.12s ease;
    }

    .tuner-cents {
      display: flex;
      justify-content: space-between;
      color: var(--muted);
      font-size: 0.82rem;
      padding: 0 4px;
    }

    .tuner-status-line {
      min-height: 1.4em;
      color: var(--muted);
      line-height: 1.45;
    }

    .tuner-string-row {
      display: grid;
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 6px;
    }

    .tuner-string-pill {
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 8px 6px;
      text-align: center;
      color: var(--muted);
      background: rgba(255, 255, 255, 0.035);
      font-weight: 800;
      font-size: 0.86rem;
    }

    .tuner-string-pill.active {
      color: var(--text);
      border-color: rgba(240, 189, 98, 0.62);
      background: rgba(240, 189, 98, 0.11);
    }

    .tuner-detail {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
      margin-top: 10px;
      color: var(--muted);
      font-size: 0.86rem;
    }

    .tuner-chip {
      border: 1px solid var(--line);
      border-radius: 999px;
      padding: 5px 8px;
      background: rgba(255, 255, 255, 0.035);
    }

    .toast {
      position: fixed;
      left: 50%;
      bottom: 18px;
      transform: translateX(-50%);
      z-index: 70;
      max-width: min(92vw, 520px);
      border: 1px solid var(--line-strong);
      border-radius: var(--radius);
      background: #171a20;
      color: var(--text);
      box-shadow: var(--shadow);
      padding: 12px 14px;
      font-weight: 800;
    }

    .hidden,
    [hidden] {
      display: none !important;
    }

    @media (max-width: 1024px) {
      body {
        padding-bottom: 142px;
      }

      .app-shell {
        padding: clamp(12px, 2.2vw, 20px);
      }

      .topbar {
        align-items: flex-start;
        flex-direction: column;
      }

      .top-actions {
        width: 100%;
        justify-content: space-between;
      }

      .pack-picker {
        flex: 1;
      }

      .pack-picker .select {
        min-width: 0;
      }

      .rep-pack-grid,
      .task-grid,
      .step-tabs,
      .field-grid,
      .tool-choice-grid,
      .chord-tool-layout,
      .rep-practice-panel,
      .rep-card-actions,
      .flow-buttons,
      .drawer-flow-actions,
      .trainer-status,
      .trainer-metrics,
      .stats-grid,
      .practice-summary,
      .practice-chord-grid,
      .practice-diagrams,
      .practice-controls,
      .practice-secondary {
        grid-template-columns: 1fr;
      }

      .drawer {
        display: flex;
        align-items: flex-end;
        justify-content: stretch;
        padding: 0;
      }

      .drawer-scrim {
        display: block;
        position: absolute;
        inset: 0;
      }

      .drawer-panel {
        position: relative;
        width: 100%;
        border-left: 0;
        border-top: 1px solid var(--line-strong);
        border-radius: 18px 18px 0 0;
        height: min(76vh, 720px);
        padding-bottom: max(22px, env(safe-area-inset-bottom));
      }

      .drawer-flow-actions {
        position: static;
        bottom: auto;
        margin: 16px 0 0;
        padding: 12px 0 0;
        background: #101216;
      }

      .hero-title {
        max-width: 100%;
      }

      .primary-row .button.primary,
      .action-bar .button,
      .tool-buttons .button,
      .current-rep-dock {
        width: 100%;
      }

      .result-screen {
        gap: 10px;
      }

      .rep-card {
        padding: 14px;
      }

      .coach-note {
        display: none;
      }

      .rep-card h2 {
        font-size: clamp(1.32rem, 8vw, 1.85rem);
      }

      .rep-meta {
        display: none;
      }

      .rep-practice-panel {
        margin-top: 12px;
      }

      .rep-practice-item {
        padding: 10px;
      }

      .rep-card-actions,
      .practice-lane,
      .tool-band,
      .action-bar {
        display: none;
      }

      .step-tabs,
      .step-card {
        display: none;
      }

      .mobile-practice-shell {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 63;
        display: block;
      }

      .mobile-practice-shell.hidden {
        display: none !important;
      }

      .mobile-stage-check,
      .mobile-practice-shell[data-stage="check"] .mobile-stage-start {
        display: none;
      }

      .mobile-practice-shell[data-stage="check"] .mobile-stage-check {
        display: grid;
      }

      .flow-check-sheet:not(.hidden) {
        display: flex;
      }

      .rep-details-sheet:not(.hidden) {
        display: flex;
      }

      .current-rep-dock {
        bottom: 8px;
        grid-template-columns: 1fr;
      }

      .chord-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: none;
      }

      .beat {
        min-height: 72px;
        font-size: 1.55rem;
      }

      .metro-control-row {
        grid-template-columns: 1fr 1fr;
      }

      .practice-panel {
        min-height: calc(100vh - 20px);
      }

      .practice-chord-card {
        min-height: 132px;
      }

      .practice-diagrams {
        display: none;
      }

      .home-helper-grid,
      .starter-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (min-width: 761px) and (max-width: 1024px) {
      .topbar {
        align-items: center;
        flex-direction: row;
      }

      .top-actions {
        width: auto;
      }

      .mobile-practice-shell {
        left: 50%;
        right: auto;
        bottom: 14px;
        width: min(720px, calc(100vw - 36px));
        transform: translateX(-50%);
      }

      .drawer-panel,
      .rep-details-panel {
        max-width: 820px;
        margin: 0 auto;
      }

      .drawer-panel {
        height: min(80vh, 760px);
      }
    }

    @media (max-width: 560px) {
      body {
        padding-bottom: 84px;
      }

      .app-shell {
        padding: 8px;
      }

      .topbar {
        align-items: center;
        flex-direction: row;
        gap: 8px;
        margin-bottom: 8px;
      }

      .brand {
        gap: 8px;
        min-width: 0;
      }

      .brand-mark {
        width: 34px;
        height: 34px;
        font-size: 0.82rem;
      }

      .brand h1 {
        font-size: 1.05rem;
      }

      .brand p,
      .pack-picker span,
      #openState .prompt-kicker,
      #openState .hero-copy,
      #exampleChips,
      .privacy-note {
        display: none;
      }

      .top-actions {
        width: auto;
        flex: 0 0 auto;
        gap: 6px;
      }

      .pack-picker {
        flex: 0 0 108px;
      }

      .pack-picker .select {
        min-height: 40px;
        padding-left: 10px;
      }

      #settingsBtn {
        min-height: 40px;
        padding: 0 10px;
      }

      .screen {
        padding: 12px;
        border-radius: 10px;
      }

      .prompt-head {
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
      }

      .hero-title {
        font-size: clamp(1.35rem, 8.5vw, 1.8rem);
        line-height: 1.05;
      }

      .textarea {
        min-height: 108px;
        padding: 12px;
      }

      #openState .input-label {
        margin-top: 8px;
      }

      #openState .task-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
      }

      #openState .task-button {
        min-height: 42px;
        padding: 0 6px;
        font-size: 0.88rem;
      }

      #openState .primary-row {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
        gap: 8px;
      }

      #openState .primary-row .button {
        min-height: 52px;
        padding: 0 10px;
      }

      .result-top {
        align-items: center;
        margin-bottom: 2px;
      }

      .result-top .eyebrow {
        font-size: 0.68rem;
      }

      .rep-card {
        padding: 12px;
      }

      .rep-card h2 {
        margin-bottom: 6px;
        font-size: clamp(1.15rem, 6.2vw, 1.45rem);
        line-height: 1.12;
      }

      .mobile-rep-brief {
        display: block;
        margin: 0;
        color: var(--muted);
        font-size: 0.92rem;
        font-weight: 760;
        line-height: 1.35;
      }

      .rep-practice-panel {
        display: none;
      }

      .mobile-tools-peek {
        display: none;
      }

      .mobile-bottom-bar {
        border-top: 1px solid var(--line-strong);
        border-radius: var(--radius);
      }

      .mobile-practice-shell {
        left: 8px;
        right: 8px;
        bottom: 8px;
      }

      .mobile-stage-start {
        grid-template-columns: minmax(0, 0.76fr) minmax(0, 0.76fr) minmax(0, 1.48fr);
      }

      .mobile-bottom-bar .button {
        min-height: 50px;
        font-size: 0.88rem;
        padding: 0 8px;
      }

      .rep-detail-grid,
      .rep-detail-tool-buttons {
        grid-template-columns: 1fr;
      }

      .practice-mode {
        padding: 8px;
        padding-bottom: 142px;
      }

      .practice-panel {
        gap: 8px;
        min-height: auto;
      }

      .practice-header {
        align-items: center;
        gap: 8px;
        min-height: 52px;
        padding-bottom: 6px;
      }

      .practice-header .eyebrow {
        display: none;
      }

      .practice-header h2 {
        font-size: 1.02rem;
        line-height: 1.16;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
      }

      .practice-header-actions {
        flex: 0 0 auto;
        gap: 6px;
      }

      .practice-header-actions .button {
        min-height: 38px;
        padding: 0 10px;
        font-size: 0.84rem;
      }

      .practice-summary {
        display: none;
      }

      .practice-focus-strip {
        display: block;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #0b0d10;
        color: var(--muted);
        padding: 9px 10px;
        font-size: 0.86rem;
        font-weight: 760;
        line-height: 1.3;
      }

      .practice-chord-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
      }

      .practice-chord-card {
        min-height: 154px;
        padding: 10px;
      }

      .trainer-label {
        font-size: 0.68rem;
      }

      .practice-chord-large {
        font-size: clamp(4.4rem, 25vw, 6.2rem);
      }

      .practice-pulse {
        min-height: 64px;
        font-size: 2.6rem;
      }

      .practice-mode .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        margin: 0;
      }

      .practice-mode .stat-card {
        min-height: 54px;
        padding: 7px 4px;
        text-align: center;
      }

      .practice-mode .stat-label {
        font-size: 0.58rem;
        letter-spacing: 0.03em;
      }

      .practice-mode .stat-value {
        font-size: 1.02rem;
        margin-top: 4px;
      }

      .practice-action-bar {
        padding: 0 8px max(8px, env(safe-area-inset-bottom));
      }

      .practice-action-inner {
        border-radius: 14px 14px 0 0;
        padding: 8px;
        gap: 6px;
      }

      .practice-media-row,
      .practice-difficulty-row {
        gap: 6px;
      }

      .practice-icon-button {
        min-height: 50px;
        font-size: 1.25rem;
      }

      .practice-difficulty-row .button {
        min-height: 48px;
        font-size: 0.94rem;
      }

      .home-helper-grid {
        display: grid;
        gap: 8px;
        margin-top: 10px;
      }

      .home-panel {
        padding: 10px;
      }

      .home-panel-head {
        margin-bottom: 8px;
      }

      .home-panel-note {
        display: none;
      }

      .starter-card {
        min-height: 74px;
        padding: 10px;
      }

      .starter-grid,
      .quick-tool-row {
        grid-template-columns: 1fr;
        gap: 6px;
      }

      .quick-tool-button {
        min-height: 54px;
      }

      .environment-list {
        grid-template-columns: 1fr;
      }

      .environment-chip {
        min-height: auto;
      }
    }


    /* =====================================================
       V5.7 Mobile Polish Overrides
       ===================================================== */
    .toolbox-drawer-open body {
      overflow: hidden;
    }

    .drawer-panel {
      overscroll-behavior: contain;
    }

    #toolContent {
      padding-bottom: max(28px, env(safe-area-inset-bottom));
    }

    @media (max-width: 760px) {
      .drawer-panel {
        height: min(82vh, 780px);
        max-height: calc(100vh - 18px);
      }

      .drawer-header {
        position: sticky;
        top: -20px;
        z-index: 4;
        background: #101216;
        padding-top: 4px;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(58, 64, 73, 0.8);
      }

      .tool-group.recommended {
        padding: 10px;
      }

      .tool-choice {
        min-height: 56px;
      }
    }

    @media (max-width: 560px) {
      body {
        padding-bottom: 92px;
      }

      .topbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 8px;
        padding: 6px 0 12px;
      }

      .brand {
        width: 100%;
      }

      .top-actions {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        gap: 8px;
      }

      .pack-picker {
        width: 100%;
        flex: none;
      }

      .pack-picker .select,
      #repPacksBtn,
      #settingsBtn {
        min-height: 44px;
      }

      #repPacksBtn,
      #settingsBtn {
        padding: 0 11px;
        font-size: 0.88rem;
      }

      .screen {
        padding: 12px;
      }

      .home-helper-grid {
        margin-top: 12px;
      }

      .home-panel {
        padding: 10px;
      }

      .home-panel h3 {
        font-size: 0.95rem;
      }

      .home-shelf-item {
        padding: 9px;
      }

      .drawer-panel {
        height: min(84vh, 740px);
        max-height: calc(100vh - 12px);
        padding: 14px 14px max(18px, env(safe-area-inset-bottom));
      }

      .drawer-header {
        top: -14px;
        margin-bottom: 10px;
      }

      .drawer-header h2 {
        font-size: 1.15rem;
      }

      .drawer-header .modal-actions {
        gap: 6px;
      }

      .drawer-header .button.small {
        min-height: 38px;
        padding: 0 9px;
        font-size: 0.82rem;
      }

      .tool-choice-grid {
        grid-template-columns: 1fr;
      }

      .tool-choice {
        min-height: 54px;
        padding: 11px 12px;
      }

      .tool-content {
        margin-top: 12px;
        padding-top: 12px;
      }

      .drawer-flow-actions {
        margin-top: 12px;
        padding-top: 10px;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
      }

      #toolContent {
        padding-bottom: max(42px, env(safe-area-inset-bottom));
      }
    }


    /* =====================================================
       V6.5.1 App Shell Polish
       ===================================================== */
    :root {
      --nav-height: 74px;
    }

    body {
      padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
    }

    .top-actions #repPacksBtn {
      display: none;
    }

    .shell-main {
      position: relative;
    }

    .shell-screen {
      display: block;
    }

    .shell-screen[hidden] {
      display: none !important;
    }

    .shell-tabbar {
      position: fixed;
      left: 50%;
      bottom: 12px;
      transform: translateX(-50%);
      z-index: 70;
      width: min(720px, calc(100vw - 22px));
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      padding: 8px;
      border: 1px solid var(--border);
      border-radius: 22px;
      background: rgba(14, 19, 29, 0.94);
      box-shadow: 0 18px 50px rgba(0, 0, 0, 0.42);
      backdrop-filter: blur(18px);
    }

    .shell-tab {
      border: 0;
      border-radius: 16px;
      background: transparent;
      color: var(--muted);
      padding: 9px 6px 8px;
      font: inherit;
      font-size: 0.78rem;
      font-weight: 800;
      letter-spacing: 0.01em;
      display: grid;
      gap: 3px;
      place-items: center;
      cursor: pointer;
    }

    .shell-tab span:first-child {
      font-size: 1.03rem;
      line-height: 1;
    }

    .shell-tab[aria-current="page"] {
      color: var(--text);
      background: linear-gradient(135deg, rgba(240, 189, 98, 0.22), rgba(108, 141, 255, 0.13));
      box-shadow: inset 0 0 0 1px rgba(240, 189, 98, 0.25);
    }

    .shell-screen-header {
      display: flex;
      justify-content: space-between;
      gap: 16px;
      align-items: flex-start;
      margin-bottom: 18px;
    }

    .shell-screen-title {
      margin: 0;
      font-size: clamp(1.8rem, 5vw, 3rem);
      letter-spacing: -0.04em;
    }

    .shell-screen-copy {
      color: var(--muted);
      margin: 8px 0 0;
      max-width: 62ch;
    }

    .workspace-card {
      border: 1px solid rgba(255, 255, 255, 0.09);
      border-radius: 26px;
      background: linear-gradient(180deg, rgba(255,255,255,0.052), rgba(255,255,255,0.025));
      padding: 18px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    }

    .coach-strip {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      padding: 12px 14px;
      border: 1px solid rgba(240, 189, 98, 0.18);
      border-radius: 18px;
      background: rgba(240, 189, 98, 0.065);
      color: var(--text);
      margin-bottom: 16px;
    }

    .coach-strip strong {
      color: var(--accent);
    }

    .tool-screen-grid {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
      gap: 16px;
      align-items: start;
    }

    .tool-screen-active {
      min-height: 220px;
    }

    .tool-screen-picker {
      position: sticky;
      top: 16px;
    }

    .pack-screen-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
      gap: 14px;
    }

    .saved-shell-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: 14px;
    }

    .saved-shell-list {
      display: grid;
      gap: 12px;
    }

    .shell-empty {
      border: 1px dashed rgba(255,255,255,0.16);
      border-radius: 18px;
      padding: 16px;
      color: var(--muted);
      background: rgba(255,255,255,0.03);
    }

    .today-pack-line {
      color: var(--muted);
      margin: 0 0 12px;
      font-size: 0.98rem;
    }

    .result-screen .rep-practice-panel {
      grid-template-columns: 1fr;
      gap: 10px;
    }

    .result-screen .rep-practice-item {
      border-radius: 18px;
      background: rgba(255,255,255,0.035);
      border-color: rgba(255,255,255,0.075);
    }

    .result-screen .rep-practice-label,
    .rep-detail-label {
      text-transform: none;
      letter-spacing: 0.01em;
      font-size: 0.78rem;
      color: var(--muted);
    }

    body[data-app-view="tools"] .current-rep-dock,
    body[data-app-view="packs"] .current-rep-dock,
    body[data-app-view="saved"] .current-rep-dock,
    body[data-app-view="tools"] .mobile-practice-shell,
    body[data-app-view="packs"] .mobile-practice-shell,
    body[data-app-view="saved"] .mobile-practice-shell {
      display: none !important;
    }

    @media (max-width: 860px) {
      .tool-screen-grid,
      .saved-shell-grid {
        grid-template-columns: 1fr;
      }

      .tool-screen-picker {
        position: static;
      }

      .shell-screen-header {
        display: block;
      }

      .topbar {
        padding-bottom: 10px;
      }
    }

    @media (min-width: 980px) {
      body {
        padding-bottom: 96px;
      }
    }

  

    /* =====================================================
       V6.5.1 App Shell Polish
       Fixes bottom nav overlap and calms lower-priority panels.
       ===================================================== */
    :root {
      --nav-height: 86px;
      --nav-space: calc(var(--nav-height) + 44px + env(safe-area-inset-bottom, 0px));
    }

    html {
      scroll-padding-bottom: var(--nav-space);
    }

    body {
      padding-bottom: var(--nav-space);
    }

    body::after {
      content: "";
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      height: var(--nav-space);
      pointer-events: none;
      z-index: 62;
      background: linear-gradient(180deg, rgba(7, 8, 10, 0), rgba(7, 8, 10, 0.9) 44%, rgba(7, 8, 10, 0.98));
    }

    .app-shell {
      padding-bottom: var(--nav-space);
    }

    .shell-main,
    .screen,
    .shell-screen {
      scroll-margin-bottom: var(--nav-space);
    }

    .shell-tabbar {
      bottom: max(12px, env(safe-area-inset-bottom, 0px));
      z-index: 82;
      min-height: var(--nav-height);
    }

    .shell-tab {
      min-height: 58px;
    }

    .environment-panel {
      border-color: rgba(240, 189, 98, 0.2);
      background: linear-gradient(135deg, rgba(240, 189, 98, 0.035), rgba(97, 214, 168, 0.018));
    }

    .environment-panel .home-panel-head {
      margin-bottom: 8px;
    }

    .environment-panel h3::after {
      content: " · quiet check";
      color: var(--muted);
      font-weight: 650;
      font-size: 0.82rem;
    }

    .environment-chip {
      min-height: 0;
      padding: 9px 10px;
      border-radius: 16px;
      background: rgba(15, 17, 20, 0.66);
    }

    .environment-chip strong {
      margin-bottom: 2px;
      font-size: 0.9rem;
    }

    .environment-chip span {
      font-size: 0.83rem;
    }

    .workspace-card,
    .home-panel {
      box-shadow: 0 14px 38px rgba(0, 0, 0, 0.14);
    }

    @media (max-width: 860px) {
      :root {
        --nav-height: 82px;
        --nav-space: calc(var(--nav-height) + 58px + env(safe-area-inset-bottom, 0px));
      }

      body {
        padding-bottom: var(--nav-space) !important;
      }

      .app-shell {
        padding-bottom: var(--nav-space) !important;
      }

      .shell-tabbar {
        width: min(680px, calc(100vw - 28px));
        padding: 7px;
        gap: 5px;
        border-radius: 24px;
        background: rgba(13, 18, 27, 0.97);
      }

      .shell-tab {
        min-height: 60px;
        padding: 8px 4px 7px;
      }

      .shell-tab span:first-child {
        font-size: 0.98rem;
      }

      .home-helper-grid {
        gap: 12px;
      }

      .environment-list {
        gap: 6px;
      }

      .environment-chip {
        padding: 8px 10px;
      }

      .environment-chip br {
        display: none;
      }

      .environment-chip strong {
        display: inline;
        margin-right: 6px;
      }

      .environment-chip span {
        display: inline;
      }

      .environment-chip span + span::before {
        content: " · ";
      }
    }

    @media (max-width: 420px) {
      .shell-tabbar {
        width: calc(100vw - 22px);
      }

      .shell-tab {
        font-size: 0.74rem;
      }
    }


    /* ==========================================================================
       NR-TODAY V6.5.2 Today Direction Pass
       Today should answer: What do I do now?
       Do not turn Today into a dashboard, settings page, or full tool library.
       ========================================================================== */
    .next-action-panel {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 14px;
      align-items: center;
      padding: 16px;
      margin: 16px 0;
      border: 1px solid rgba(240, 189, 98, 0.18);
      border-radius: 24px;
      background: linear-gradient(135deg, rgba(240, 189, 98, 0.105), rgba(108, 141, 255, 0.055));
      box-shadow: 0 16px 46px rgba(0, 0, 0, 0.15);
    }

    .next-action-kicker {
      color: var(--accent);
      font-size: 0.78rem;
      font-weight: 850;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      margin-bottom: 5px;
    }

    .next-action-panel h3 {
      margin: 0;
      font-size: clamp(1.18rem, 3.5vw, 1.65rem);
      letter-spacing: -0.025em;
    }

    .next-action-panel p {
      margin: 6px 0 0;
      color: var(--muted);
      max-width: 58ch;
    }

    .next-action-buttons {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      gap: 8px;
    }

    .starter-grid.direction-sparks {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-environment-section .environment-list {
      margin-top: 10px;
    }

    /* NR-SHELL: Slimmer bottom navigation. Keep the familiar spine, reduce the control slab feeling. */
    :root {
      --nav-height: 72px;
      --nav-space: calc(var(--nav-height) + 36px + env(safe-area-inset-bottom, 0px));
    }

    .shell-tabbar {
      min-height: var(--nav-height);
      padding: 6px;
      border-radius: 21px;
      gap: 5px;
    }

    .shell-tab {
      min-height: 48px;
      padding: 6px 4px 5px;
      border-radius: 15px;
      font-size: 0.73rem;
    }

    .shell-tab span:first-child {
      font-size: 0.88rem;
    }

    @media (max-width: 860px) {
      :root {
        --nav-height: 74px;
        --nav-space: calc(var(--nav-height) + 46px + env(safe-area-inset-bottom, 0px));
      }

      .next-action-panel {
        grid-template-columns: 1fr;
        align-items: stretch;
      }

      .next-action-buttons {
        justify-content: stretch;
      }

      .next-action-buttons .button {
        flex: 1 1 140px;
      }

      .starter-grid.direction-sparks {
        grid-template-columns: 1fr;
      }

      .shell-tab {
        min-height: 50px;
      }
    }

/* ==========================================================================
   NR-PRACTICE: Guided Practice Session V6.7.1
   Universal practice flow for every Rep Pack.
   ========================================================================== */
.guided-session {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(3, 4, 7, 0.72);
  backdrop-filter: blur(12px);
}

.guided-session.hidden {
  display: none;
}

.guided-panel {
  width: min(820px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 28px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(23, 25, 34, 0.98), rgba(11, 12, 17, 0.98));
  box-shadow: 0 24px 80px rgba(0,0,0,0.5);
}

.guided-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.guided-progress {
  display: flex;
  gap: 8px;
  margin: 12px 0 16px;
}

.guided-dot {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
}

.guided-dot.active {
  color: #111;
  background: var(--accent);
  border-color: transparent;
}

.guided-dot.done {
  color: var(--text);
  background: rgba(255,255,255,0.12);
}

.guided-card {
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.08);
}

.guided-kicker,
.guided-tool-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.guided-card h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.guided-card p {
  margin: 0;
  color: var(--text);
}

.guided-callout {
  margin-top: 14px;
  border-radius: 18px;
  padding: 12px;
  background: rgba(240, 189, 98, 0.09);
  border: 1px solid rgba(240, 189, 98, 0.16);
  color: var(--text);
}

.guided-chord-sequence {
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(240, 189, 98, 0.2);
  border-radius: 20px;
  background: rgba(240, 189, 98, 0.07);
}

.guided-chord-sequence.hidden { display: none; }

.guided-chord-sequence-header {
  width: min(100%, 420px);
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.guided-chord-sequence-header span,
.guided-chord-next {
  color: var(--muted);
  font-size: 0.8rem;
}

.guided-chord-sequence-header strong {
  display: block;
  margin-top: 2px;
  font-size: 2rem;
}

.guided-chord-diagram {
  width: min(100%, 340px);
}

.guided-chord-diagram .chord-selected-card {
  margin: 0;
}

.guided-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.guided-reflection {
  margin-top: 12px;
}

.guided-evidence {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(97, 214, 168, 0.2);
  border-radius: 18px;
  background: rgba(97, 214, 168, 0.07);
}

.guided-evidence.hidden { display: none; }

.guided-evidence-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.guided-evidence-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.guided-evidence-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.22);
  font: inherit;
}

.guided-evidence-field small { font-weight: 500; }

.guided-evidence-feedback {
  min-height: 24px;
  margin-top: 10px;
  color: var(--text);
}

.guided-evidence-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.guided-tool-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}

.guided-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 14px;
  background: linear-gradient(180deg, rgba(11,12,17,0), rgba(11,12,17,0.98) 30%);
}

@media (max-width: 720px) {
  .guided-session {
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .guided-panel {
    border-radius: 24px 24px 18px 18px;
    padding: 16px;
    max-height: 92vh;
  }

  .guided-header {
    align-items: start;
  }

  .guided-stats {
    grid-template-columns: 1fr;
  }

  .guided-actions .button {
    flex: 1 1 42%;
  }
}


    /* ==========================================================================
       NR-SHELL V6.7.1 Mobile Tool Scroll Fix
       Bug: long tool panels, especially Chord Diagrams, could slide under the
       fixed bottom nav on mobile. Tools must remain readable and reachable.
       Drift guard: fixed shell chrome must reserve scroll space for tool content.
       ========================================================================== */
    :root {
      --tool-scroll-buffer: calc(var(--nav-space, 132px) + 32px);
    }

    #toolsScreen {
      padding-bottom: calc(clamp(18px, 4vw, 34px) + var(--tool-scroll-buffer));
      scroll-padding-bottom: var(--tool-scroll-buffer);
    }

    .tool-screen-active,
    .active-tool-panel,
    .tool-content,
    .chord-tool-layout,
    .chord-table-wrap {
      scroll-margin-bottom: var(--tool-scroll-buffer);
      scroll-padding-bottom: var(--tool-scroll-buffer);
    }

    .tool-screen-active::after {
      content: "";
      display: block;
      height: calc(var(--tool-scroll-buffer) * 0.72);
      pointer-events: none;
    }

    @media (max-width: 860px) {
      :root {
        --tool-scroll-buffer: calc(var(--nav-space, 140px) + 54px);
      }

      #toolsScreen {
        padding-bottom: var(--tool-scroll-buffer) !important;
      }

      .tool-screen-grid {
        padding-bottom: calc(var(--tool-scroll-buffer) * 0.55);
      }

      .active-tool-panel {
        margin-bottom: var(--tool-scroll-buffer);
      }

      .chord-table-wrap {
        padding-bottom: 18px;
        margin-bottom: calc(var(--tool-scroll-buffer) * 0.55);
      }

      .chord-table {
        margin-bottom: 8px;
      }
    }


/* ==========================================================================
   NR-TODAY V6.9.1 Daily Rep Experience
   Today should feel like a small session: purpose, action, progress.
   ========================================================================== */
.daily-rep-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  margin: 16px 0 18px;
  border: 1px solid rgba(240, 189, 98, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(240, 189, 98, 0.15), transparent 34%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}
.daily-rep-kicker {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.daily-rep-panel h3 {
  margin: 0;
  font-size: clamp(1.22rem, 3.8vw, 1.8rem);
  line-height: 1.08;
}
.daily-rep-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}
.weekly-progress {
  min-width: 112px;
  text-align: center;
  padding: 14px 12px;
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.weekly-progress-count {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}
.weekly-progress-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

/* ==========================================================================
   NR-PRACTICE V6.9.1 Completion Moment
   Tiny payoff when a rep finishes.
   ========================================================================== */
.completion-moment {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(14px);
}
.completion-moment.hidden { display: none; }
.completion-panel {
  width: min(520px, 100%);
  padding: 26px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(240, 189, 98, 0.18), transparent 34%),
    var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.46);
}
.completion-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  font-size: 1.45rem;
  font-weight: 900;
  background: rgba(240, 189, 98, 0.16);
  border: 1px solid rgba(240, 189, 98, 0.34);
}
.completion-panel h2 { margin: 6px 0 8px; }
.completion-copy { color: var(--muted); margin: 0 0 16px; }
.completion-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.completion-stat {
  padding: 13px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.completion-stat strong { display: block; font-size: 1.2rem; }
.completion-stat span { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.completion-reflection {
  grid-column: 1 / -1;
  padding: 13px;
  border-radius: 18px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.18);
}
.completion-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
@media (max-width: 720px) {
  .daily-rep-panel { grid-template-columns: 1fr; }
  .weekly-progress { text-align: left; min-width: 0; }
  .weekly-progress-count, .weekly-progress-meta { display: inline; }
  .weekly-progress-meta { margin-left: 6px; }
  .completion-panel { padding: 22px; }
  .completion-stats { grid-template-columns: 1fr; }
  .completion-actions .button { flex: 1 1 100%; }
}

/* ============================================================================
   NR-MODERN-WEB V6.9.1 Modern Web Polish
   Intent: make the existing app feel more crafted without changing product flow.
   Drift guard: polish should clarify Today / Tools / Packs / Saved, not add
   feature sprawl or hide core actions behind decoration.
   ============================================================================ */
:root {
  --accent: var(--amber);
  --border: rgba(255, 255, 255, 0.105);
  --surface-0: rgba(7, 8, 12, 0.92);
  --surface-1: rgba(18, 21, 28, 0.84);
  --surface-2: rgba(27, 31, 40, 0.72);
  --surface-glass: rgba(16, 20, 28, 0.72);
  --radius: 16px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --shadow-soft: 0 18px 70px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 12px 36px rgba(0, 0, 0, 0.20);
  --focus-ring: 0 0 0 4px rgba(240, 189, 98, 0.22);
  --nav-height: 70px;
  --nav-space: calc(var(--nav-height) + 42px + env(safe-area-inset-bottom, 0px));
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  scroll-padding-bottom: var(--nav-space);
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 14% 8%, rgba(97, 214, 168, 0.14), transparent 28rem),
    radial-gradient(circle at 88% 4%, rgba(240, 189, 98, 0.10), transparent 26rem),
    linear-gradient(180deg, #0c0d12 0%, #08090d 54%, #06070a 100%);
  padding-bottom: var(--nav-space) !important;
}

.app-shell {
  width: min(1120px, 100%);
  padding: clamp(14px, 3vw, 24px);
  padding-bottom: var(--nav-space) !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 52;
  margin: -4px -4px 12px;
  padding: 10px 4px 14px;
  background: linear-gradient(180deg, rgba(9, 10, 12, 0.96), rgba(9, 10, 12, 0.72) 78%, rgba(9, 10, 12, 0));
  backdrop-filter: blur(14px);
}

.brand-mark {
  border-radius: 15px;
  border-color: rgba(97, 214, 168, 0.42);
  background: linear-gradient(135deg, rgba(97, 214, 168, 0.14), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 12px 28px rgba(0, 0, 0, 0.22);
}

.brand h1,
.hero-title,
.shell-screen-title,
.rep-card h2 {
  letter-spacing: -0.045em;
}

.brand p,
.hero-copy,
.shell-screen-copy,
.muted-line,
.home-panel-note,
.today-pack-line,
.coach-note {
  color: rgba(246, 243, 235, 0.68);
}

.select,
.text-input,
.textarea,
.output-box,
.tab-box,
.prompt-output {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(6, 8, 12, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.textarea {
  border-radius: var(--radius-lg);
  min-height: 132px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
    rgba(7, 9, 13, 0.86);
}

.button,
.task-button,
.chip,
.chord-pick,
.quick-tool-button,
.starter-card {
  border-radius: var(--radius-md);
  border-color: rgba(255, 255, 255, 0.105);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.button {
  background: rgba(255, 255, 255, 0.062);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.button:hover,
.task-button:hover,
.quick-tool-button:hover,
.starter-card:hover,
.chord-pick:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 189, 98, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.task-button:focus-visible,
.shell-tab:focus-visible,
.chord-pick:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.button.primary {
  background: linear-gradient(135deg, #7be6b9, #f0bd62);
  color: #06110d;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 34px rgba(97, 214, 168, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.button.primary:hover {
  background: linear-gradient(135deg, #8bf0c6, #ffd286);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.035);
}

.screen,
.shell-screen,
.rep-card,
.step-card,
.tool-band,
.workspace-card,
.home-panel,
.next-action-panel,
.daily-rep-panel,
.completion-panel,
.guided-panel,
.modal-panel,
.drawer-panel,
.rep-details-panel,
.flow-check-panel {
  border-color: var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.024)),
    var(--surface-1);
  box-shadow: var(--shadow-card);
}

.screen,
.shell-screen {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

#openState {
  background:
    radial-gradient(circle at 8% 0%, rgba(97, 214, 168, 0.115), transparent 30rem),
    radial-gradient(circle at 92% 4%, rgba(240, 189, 98, 0.095), transparent 28rem),
    linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.02)),
    rgba(15, 18, 25, 0.82);
}

.prompt-kicker,
.eyebrow,
.next-action-kicker,
.daily-rep-kicker,
.starter-pack {
  letter-spacing: 0.06em;
  color: rgba(240, 189, 98, 0.92);
}

.hero-title {
  max-width: 13ch;
  text-wrap: balance;
}

.hero-copy,
.next-action-panel p,
.daily-rep-panel p,
.shell-screen-copy {
  text-wrap: pretty;
}

.daily-rep-panel,
.next-action-panel {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top left, rgba(240, 189, 98, 0.16), transparent 35%),
    radial-gradient(circle at bottom right, rgba(97, 214, 168, 0.09), transparent 30%),
    rgba(255, 255, 255, 0.047);
}

.weekly-progress {
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.home-helper-grid {
  align-items: stretch;
}

.home-panel {
  background: rgba(10, 13, 18, 0.58);
}

.home-panel h3,
.workspace-card h3,
.tool-content h3 {
  letter-spacing: -0.02em;
}

.starter-card,
.quick-tool-button,
.home-shelf-item {
  background: rgba(7, 9, 13, 0.62);
}

.task-button[aria-pressed="true"],
.chord-pick.is-active,
.chord-pick[aria-pressed="true"].is-active,
.tool-button[aria-pressed="true"] {
  border-color: rgba(240, 189, 98, 0.74);
  color: #ffe0a3;
  background:
    linear-gradient(135deg, rgba(240, 189, 98, 0.15), rgba(97, 214, 168, 0.07)),
    rgba(13, 15, 20, 0.86);
  box-shadow: 0 10px 28px rgba(240, 189, 98, 0.12), inset 0 0 0 1px rgba(240, 189, 98, 0.12);
}

/* NR-SHELL V6.9.1: fixed chrome must reserve space. No content may hide under the nav. */
body::after {
  height: calc(var(--nav-space) + 10px);
  background: linear-gradient(180deg, rgba(6, 7, 10, 0), rgba(6, 7, 10, 0.82) 42%, rgba(6, 7, 10, 0.98));
}

.shell-tabbar {
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  min-height: var(--nav-height);
  padding: 6px;
  border-radius: 25px;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(13, 17, 24, 0.86);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px) saturate(1.22);
}

.shell-tab {
  min-height: 50px;
  border-radius: 19px;
  color: rgba(246, 243, 235, 0.62);
}

.shell-tab[aria-current="page"] {
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(240, 189, 98, 0.28), transparent 52%),
    rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 0 0 1px rgba(240, 189, 98, 0.25);
}

.shell-main,
.screen,
.shell-screen,
#toolsScreen,
.guided-panel,
.drawer-panel,
.rep-details-panel,
.flow-check-panel {
  scroll-padding-bottom: var(--nav-space);
  scroll-margin-bottom: var(--nav-space);
}

#toolsScreen {
  padding-bottom: calc(clamp(18px, 4vw, 34px) + var(--tool-scroll-buffer, var(--nav-space))) !important;
}

.tool-screen-grid {
  align-items: start;
}

.tool-screen-active,
.tool-screen-picker {
  border-radius: var(--radius-xl);
}

.active-tool-banner,
.coach-strip,
.permission-tool-note {
  border-radius: var(--radius-lg);
  border-color: rgba(240, 189, 98, 0.18);
  background: rgba(240, 189, 98, 0.065);
}

.chord-tool-layout {
  grid-template-columns: minmax(128px, 170px) minmax(0, 1fr);
}

.chord-list {
  gap: 8px;
  padding: 4px 4px 4px 0;
}

.chord-pick {
  min-height: 44px;
  background: rgba(8, 10, 14, 0.72);
}

.chord-name {
  font-size: clamp(2.4rem, 10vw, 4.8rem);
  letter-spacing: -0.075em;
}

.chord-table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 22px;
  background: rgba(6, 8, 12, 0.72);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.18);
}

.chord-table th,
.chord-table td {
  border-color: rgba(255, 255, 255, 0.12);
}

.chord-table thead th {
  background: rgba(255, 255, 255, 0.035);
}

.finger-dot {
  box-shadow: 0 8px 18px rgba(97, 214, 168, 0.22), inset 0 1px 0 rgba(255,255,255,0.34);
}

.tuner-panel {
  gap: 14px;
}

.tuner-readout {
  min-height: 174px;
  border-radius: var(--radius-xl);
  border-color: rgba(97, 214, 168, 0.16);
  background:
    radial-gradient(circle at center 20%, rgba(97, 214, 168, 0.16), transparent 30%),
    radial-gradient(circle at center bottom, rgba(240, 189, 98, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.042);
}

.tuner-note {
  letter-spacing: -0.095em;
  text-shadow: 0 18px 50px rgba(97, 214, 168, 0.16);
}

.tuner-meter {
  height: 52px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(90deg, rgba(255, 138, 114, 0.18), rgba(240, 189, 98, 0.10) 42%, rgba(97, 214, 168, 0.18) 50%, rgba(240, 189, 98, 0.10) 58%, rgba(142, 199, 255, 0.18)),
    rgba(255, 255, 255, 0.04);
}

.tuner-meter::before {
  width: 3px;
  background: rgba(97, 214, 168, 0.86);
  box-shadow: 0 0 18px rgba(97, 214, 168, 0.34);
}

.tuner-needle {
  width: 6px;
  top: 7px;
  bottom: 7px;
  background: #fff7dc;
  box-shadow: 0 0 18px rgba(255, 247, 220, 0.34);
}

.guided-session,
.completion-moment,
.modal,
.drawer {
  backdrop-filter: blur(18px) saturate(1.08);
}

.guided-panel {
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top left, rgba(97, 214, 168, 0.12), transparent 32rem),
    linear-gradient(180deg, rgba(24, 28, 37, 0.985), rgba(8, 10, 15, 0.985));
}

.guided-card,
.completion-stat,
.rep-practice-item,
.rep-detail-card,
.rep-detail-step,
.rep-detail-tools {
  border-radius: var(--radius-lg);
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.046);
}

.guided-actions {
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
}

.completion-panel {
  background:
    radial-gradient(circle at top, rgba(240, 189, 98, 0.20), transparent 34%),
    radial-gradient(circle at bottom right, rgba(97, 214, 168, 0.12), transparent 34%),
    rgba(17, 20, 27, 0.98);
}

.settings-section,
.saved-item,
.history-item,
.rep-pack-card,
.tool-group,
.practice-lane {
  border-radius: var(--radius-lg);
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
}

@media (max-width: 860px) {
  :root {
    --nav-height: 72px;
    --nav-space: calc(var(--nav-height) + 48px + env(safe-area-inset-bottom, 0px));
  }

  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    gap: 10px;
    align-items: flex-start;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .top-actions {
    gap: 7px;
  }

  .screen,
  .shell-screen {
    border-radius: 28px;
    padding: 18px;
  }

  .hero-title {
    font-size: clamp(2.25rem, 12vw, 3.55rem);
  }

  .home-helper-grid,
  .starter-grid,
  .quick-tool-row,
  .rep-practice-panel,
  .environment-list {
    grid-template-columns: 1fr !important;
  }

  .primary-row .button,
  .next-action-buttons .button,
  .task-grid .task-button {
    min-height: 52px;
  }

  .shell-tabbar {
    width: min(680px, calc(100vw - 20px));
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
  }

  .shell-tab {
    min-height: 48px;
    font-size: 0.72rem;
  }

  .chord-tool-layout {
    grid-template-columns: 1fr;
  }

  .chord-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .tool-screen-grid,
  .saved-shell-grid {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .app-shell {
    padding-left: 10px;
    padding-right: 10px;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .pack-picker {
    width: 100%;
  }

  .pack-picker .select {
    max-width: none;
  }

  .task-grid,
  .chord-list {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .shell-tabbar {
    border-radius: 22px;
    padding: 5px;
  }

  .shell-tab span:first-child {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ========================================================================== 
   NR-CHORD-TOOL V6.9.1: compact selector + sticky SVG selected shape
   Drift guard: selected chord preview stays dominant; full chord library stays tucked.
   ========================================================================== */
.chord-tool-modern {
  display: grid;
  gap: 16px;
}

.tool-heading-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.tool-heading-row h3 {
  margin: 0 0 6px;
}

.chord-workbench {
  display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.chord-control-card,
.chord-selected-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  border-radius: var(--radius-xl);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.chord-control-card {
  display: grid;
  gap: 14px;
}

.chord-display-sticky {
  position: sticky;
  top: 16px;
  align-self: start;
}

.chord-selected-card {
  background:
    radial-gradient(circle at top left, rgba(240, 189, 98, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(97, 214, 168, 0.10), transparent 36%),
    rgba(255, 255, 255, 0.045);
}

.chord-selected-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.chord-hand-pill {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.045);
}

.chord-select-field .select {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

.rep-chord-strip {
  display: grid;
  gap: 8px;
}

.rep-chord-strip > span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rep-chord-strip > div,
.chord-browse-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chord-chip,
.chord-browse-grid .chord-pick {
  min-height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 900;
  padding: 0 12px;
}

.chord-chip.is-active,
.chord-chip[aria-pressed="true"],
.chord-browse-grid .chord-pick.is-active,
.chord-browse-grid .chord-pick[aria-pressed="true"].is-active {
  border-color: rgba(240, 189, 98, 0.72);
  color: var(--amber);
  background: rgba(240, 189, 98, 0.11);
}

.chord-browse {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.12);
}

.chord-browse summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 900;
}

.chord-browse-grid {
  margin-top: 12px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.chord-svg {
  width: min(100%, 390px);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.22));
}

.chord-svg-bg {
  fill: rgba(7, 9, 13, 0.62);
  stroke: rgba(255, 255, 255, 0.08);
}

.chord-svg-string,
.chord-svg-fret {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 3;
  stroke-linecap: round;
}

.chord-svg-fret:first-of-type {
  stroke-width: 6;
}

.chord-svg-string-name,
.chord-svg-state,
.chord-svg-fret-num {
  fill: var(--muted);
  font-weight: 900;
  font-size: 17px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.chord-svg-state {
  fill: var(--amber);
  font-size: 25px;
}

.chord-svg-dot circle {
  fill: var(--green);
  stroke: rgba(255, 255, 255, 0.58);
  stroke-width: 2;
}

.chord-svg-dot text {
  fill: #07100d;
  font-weight: 950;
  font-size: 17px;
  text-anchor: middle;
  pointer-events: none;
}

@media (max-width: 860px) {
  .chord-workbench {
    grid-template-columns: 1fr;
  }

  .chord-display-sticky {
    position: sticky;
    top: 8px;
    z-index: 3;
    order: -1;
  }

  .chord-control-card,
  .chord-selected-card {
    padding: 14px;
  }

  .chord-browse-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chord-browse-grid .chord-pick {
    padding: 0 6px;
  }
}

@media (max-width: 480px) {
  .chord-selected-header {
    align-items: flex-start;
  }

  .chord-hand-pill {
    font-size: 0.68rem;
    padding: 6px 8px;
  }

  .chord-name {
    font-size: clamp(2.15rem, 15vw, 3.8rem);
  }

  .chord-browse-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ========================================================================
   NR-SVG-POLISH V6.9.3
   Adds meaning-bearing SVG polish for tuner, guided practice, and weekly reps.
   NR-DRIFT-GUARD: Use SVG where the visual explains state, not as decoration confetti.
   ======================================================================== */
.weekly-progress {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "ring count"
    "ring meta";
  gap: 2px 10px;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  text-align: left;
}
.weekly-progress-visual { grid-area: ring; width: 42px; height: 42px; }
.weekly-progress-svg { width: 42px; height: 42px; display: block; }
.weekly-progress-track,
.weekly-progress-fill {
  fill: none;
  stroke-width: 5;
}
.weekly-progress-track { stroke: rgba(255, 255, 255, 0.10); }
.weekly-progress-fill {
  stroke: rgba(97, 214, 168, 0.92);
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(97, 214, 168, 0.25));
}
.weekly-progress-count { grid-area: count; font-size: 1.75rem; }
.weekly-progress-meta { grid-area: meta; margin-top: 0; }

.guided-progress {
  overflow: hidden;
  padding: 4px 0 2px;
}
.guided-stepper-svg {
  width: 100%;
  height: 48px;
  display: block;
}
.guided-step-line,
.guided-step-line-active {
  stroke-width: 4;
  stroke-linecap: round;
}
.guided-step-line { stroke: rgba(255, 255, 255, 0.11); }
.guided-step-line-active {
  stroke: rgba(97, 214, 168, 0.86);
  filter: drop-shadow(0 0 8px rgba(97, 214, 168, 0.22));
}
.guided-step-circle {
  stroke-width: 2;
  fill: rgba(9, 11, 16, 0.96);
  stroke: rgba(255, 255, 255, 0.18);
}
.guided-step-circle.done {
  fill: rgba(97, 214, 168, 0.84);
  stroke: rgba(97, 214, 168, 0.95);
}
.guided-step-circle.active {
  fill: rgba(240, 189, 98, 0.92);
  stroke: rgba(255, 238, 190, 0.95);
  filter: drop-shadow(0 0 10px rgba(240, 189, 98, 0.24));
}
.guided-step-number {
  font-size: 0.68rem;
  font-weight: 900;
  fill: rgba(246, 243, 235, 0.66);
}
.guided-step-number.done,
.guided-step-number.active { fill: #06110d; }
.guided-step-labels {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: -2px;
}
.guided-step-label {
  color: rgba(246, 243, 235, 0.54);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}
.guided-step-label.done { color: rgba(97, 214, 168, 0.9); }
.guided-step-label.active { color: rgba(240, 189, 98, 0.95); }

.tuner-visual {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-xl);
  padding: 12px;
  background:
    radial-gradient(circle at 50% 0%, rgba(97, 214, 168, 0.10), transparent 46%),
    rgba(255, 255, 255, 0.035);
}
.tuner-svg-meter {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.tuner-meter-arc {
  fill: none;
  stroke: url(#tunerMeterGradient);
  stroke-width: 14;
  stroke-linecap: round;
  opacity: 0.58;
}
.tuner-meter-glow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2;
  stroke-linecap: round;
}
.tuner-center-line {
  stroke: rgba(97, 214, 168, 0.76);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 5;
}
.tuner-svg-needle {
  stroke: #fff7dc;
  stroke-width: 5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 9px rgba(255, 247, 220, 0.45));
  transition: x1 150ms ease, x2 150ms ease;
}
.tuner-meter-label {
  fill: rgba(246, 243, 235, 0.58);
  font-size: 0.58rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tuner-meter-label.left { text-anchor: start; }
.tuner-meter-label.center { text-anchor: middle; fill: rgba(97, 214, 168, 0.82); }
.tuner-meter-label.right { text-anchor: end; }
.tuner-string-row,
.tuner-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-top: 8px;
}
.tuner-string-pill,
.tuner-chip {
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  padding: 6px 9px;
  color: rgba(246, 243, 235, 0.70);
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.78rem;
  font-weight: 800;
}
.tuner-string-pill.active {
  color: #06110d;
  background: linear-gradient(135deg, #7be6b9, #f0bd62);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ========================================================================
   NR-SCALE-POLISH V6.9.3
   Keeps the modern hero from swallowing small phone screens.
   NR-DRIFT-GUARD: Today should feel confident, not oversized.
   ======================================================================== */
@media (max-width: 720px) {
  #openState {
    padding: clamp(16px, 4vw, 22px);
  }
  .prompt-head {
    gap: 10px;
    align-items: center;
  }
  .hero-title {
    font-size: clamp(2.1rem, 9.5vw, 3rem) !important;
    line-height: 1.04;
    max-width: 11ch;
  }
  .hero-copy,
  .today-pack-line {
    font-size: 0.98rem;
    line-height: 1.4;
  }
  .daily-rep-panel {
    padding: 16px;
    margin: 14px 0 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: clamp(1.92rem, 8.7vw, 2.65rem) !important;
    max-width: 12ch;
  }
  .prompt-head .button.small {
    padding-inline: 14px;
    min-height: 42px;
  }
  .weekly-progress {
    width: 100%;
    justify-content: start;
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "ring count meta";
  }
  .weekly-progress-meta { align-self: center; margin-left: 2px; }
}

/* ============================================================================
   NR-AI-CAPABILITY V6.9.3
   Optional AI guardrails: visible settings, local-first default, no key in bundle.
   ========================================================================== */
.ai-capability-section {
  border-color: rgba(130, 221, 188, 0.28);
}

.ai-guardrail-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(130, 221, 188, 0.24);
  border-radius: var(--radius-sm, 18px);
  background: rgba(130, 221, 188, 0.06);
}

.ai-guardrail-card p {
  margin: 0 0 8px;
  color: var(--muted, #c9c3b8);
}

.ai-guardrail-card p:last-child {
  margin-bottom: 0;
}


/* ========================================================================
   NR-TOOLS V7.1 Visual Finish / App Store Feel
   Fixes: short active tools inherited long-tool bottom buffers, creating a
   large empty space under Practice timing / Metronome on mobile.
   NR-DRIFT-GUARD: fixed bottom nav protection belongs to #toolsScreen and
   long-tool content only. Short tools must size to their actual content.
   ======================================================================== */
.tool-screen-active {
  min-height: 0 !important;
}

.tool-screen-active::after {
  content: none !important;
  display: none !important;
  height: 0 !important;
}

#toolsScreen {
  padding-bottom: calc(var(--nav-space, 110px) + 24px) !important;
  scroll-padding-bottom: var(--nav-space, 110px);
}

.tool-screen-grid {
  padding-bottom: 0 !important;
}

.active-tool-panel.tool-content {
  margin-bottom: 0 !important;
  min-height: 0;
}

.active-tool-panel.tool-content.is-short-tool {
  padding-bottom: 16px;
  scroll-padding-bottom: 0;
}

.active-tool-panel.tool-content.is-long-tool {
  padding-bottom: calc(var(--nav-space, 110px) * 0.38);
  scroll-padding-bottom: var(--nav-space, 110px);
}

.active-tool-panel.tool-content.is-long-tool .chord-tool-modern {
  padding-bottom: calc(var(--nav-space, 110px) * 0.22);
}

.tool-content.is-short-tool .tuner-panel,
.tool-content.is-short-tool .metronome-panel,
.tool-content.is-short-tool .tool-meter,
.tool-content.is-short-tool .field-grid {
  margin-bottom: 0;
}

.tool-screen-picker .tool-group {
  margin: 12px 0;
}

.tool-screen-picker .more-tools-panel {
  padding: 10px 12px;
  margin: 10px 0 4px;
}

.tool-screen-picker .tool-choice-grid {
  gap: 7px;
}

@media (max-width: 860px) {
  #toolsScreen {
    padding-bottom: calc(var(--nav-space, 128px) + 18px) !important;
  }

  .active-tool-panel.tool-content {
    margin-bottom: 0 !important;
  }

  .active-tool-panel.tool-content.is-short-tool {
    padding-bottom: 14px;
  }

  .active-tool-panel.tool-content.is-long-tool {
    padding-bottom: calc(var(--nav-space, 128px) * 0.46);
  }

  .tool-screen-picker .tool-choice-grid {
    grid-template-columns: 1fr;
  }
}


/* ========================================================================
   NR-SHELL V7.1: safe-area and visual smoke-test support
   Target: Samsung S26 Ultra installed PWA from home screen.
   NR-DRIFT-GUARD:
   Fixed shell chrome must reserve real space at the screen/container level.
   Do not fix overlap by adding random padding inside individual cards.
   ======================================================================== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --bottom-nav-height: 70px;
  --bottom-nav-gap: 12px;
  --screen-bottom-space: calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + var(--safe-bottom) + 28px);
  --screen-top-space: calc(var(--safe-top) + 10px);
}

html,
body {
  min-height: 100dvh;
  overflow-x: hidden;
}

body {
  padding-top: var(--safe-top) !important;
  padding-bottom: var(--screen-bottom-space) !important;
}

.app-shell {
  min-height: 100dvh;
  padding-bottom: var(--screen-bottom-space) !important;
}

.shell-main,
.screen,
.shell-screen {
  scroll-padding-top: var(--screen-top-space);
  scroll-padding-bottom: var(--screen-bottom-space);
}

.screen,
.shell-screen {
  margin-bottom: 18px;
}

.shell-tabbar {
  bottom: max(var(--bottom-nav-gap), var(--safe-bottom)) !important;
  min-height: var(--bottom-nav-height);
  z-index: 90;
}

.current-rep-dock,
.mobile-practice-shell {
  bottom: calc(var(--screen-bottom-space) + 4px) !important;
  z-index: 88;
}

.guided-session,
.completion-moment,
.modal,
.drawer,
.flow-check-sheet,
.rep-details-sheet,
.practice-mode {
  z-index: 120;
}

.guided-session {
  align-items: stretch;
  place-items: stretch center;
  padding: calc(var(--safe-top) + 10px) 10px calc(var(--safe-bottom) + 10px) !important;
}

.guided-panel {
  width: min(820px, 100%);
  max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 20px) !important;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(var(--screen-bottom-space) + 32px);
}

.guided-actions,
.practice-action-bar,
.modal-actions,
.completion-actions {
  scroll-margin-bottom: var(--screen-bottom-space);
}

.guided-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 14px -2px 0;
  padding: 16px 2px max(16px, calc(var(--safe-bottom) + 12px));
  background: linear-gradient(180deg, rgba(11, 12, 17, 0), rgba(11, 12, 17, 0.96) 26%, rgba(11, 12, 17, 0.99));
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

.guided-actions .button {
  min-height: 48px;
}

.qa-tools-section .modal-actions {
  justify-content: flex-start;
}

@media (max-width: 860px) {
  :root {
    --bottom-nav-height: 66px;
    --bottom-nav-gap: 10px;
    --screen-bottom-space: calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + var(--safe-bottom) + 34px);
  }

  .topbar {
    position: relative !important;
    top: auto !important;
    z-index: 1 !important;
    margin: 0 0 12px !important;
    padding: 6px 0 10px !important;
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }

  .brand h1 {
    font-size: clamp(1.25rem, 7vw, 1.75rem);
  }

  .brand p {
    font-size: 0.82rem;
  }

  .shell-tabbar {
    width: min(680px, calc(100vw - 18px));
    padding: 5px;
    border-radius: 22px;
  }

  .shell-tab {
    min-height: 50px;
    padding: 7px 4px 6px;
  }

  .guided-panel {
    border-radius: 24px;
    padding: 14px;
  }

  .guided-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .guided-stats .stat-card {
    padding: 10px 8px;
  }

  .guided-stats .stat-value {
    font-size: clamp(1rem, 5vw, 1.35rem);
  }

  .guided-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .guided-actions .button {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .guided-stats {
    grid-template-columns: 1fr;
  }

  .guided-actions {
    grid-template-columns: 1fr;
  }
}


/* NR-SHELL V7.1B: guided practice owns the viewport while open. */
body.is-guided-open .shell-tabbar,
body.is-guided-open .current-rep-dock,
body.is-guided-open .mobile-practice-shell {
  display: none !important;
}

/* ========================================================================
   NR-V7-FINISH: Visual Finish / App Store Feel
   Intent: refine the keeper V6.9.5 shell without changing the product loop.
   NR-DRIFT-GUARD: V7 polish must not cover fixed-shell content, remove QA hooks,
   bury pack tools, or weaken local-first/permission guardrails.
   ======================================================================== */
:root {
  --finish-line: rgba(255, 255, 255, 0.115);
  --finish-line-soft: rgba(255, 255, 255, 0.075);
  --finish-panel: rgba(17, 20, 28, 0.78);
  --finish-panel-strong: rgba(24, 28, 38, 0.9);
  --finish-ink-soft: rgba(246, 243, 235, 0.74);
  --finish-ink-faint: rgba(246, 243, 235, 0.54);
  --finish-ring: 0 0 0 1px rgba(240, 189, 98, 0.12), 0 18px 55px rgba(0, 0, 0, 0.24);
}

body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 18% -6%, rgba(97, 214, 168, 0.13), transparent 32rem),
    radial-gradient(circle at 90% 4%, rgba(240, 189, 98, 0.105), transparent 30rem),
    linear-gradient(180deg, #0e1015 0%, #090a0d 58%, #06070a 100%);
}

.topbar {
  border: 1px solid transparent;
  border-radius: 28px;
  margin-bottom: 4px;
}

.brand-mark {
  border-radius: 16px;
  border-color: rgba(97, 214, 168, 0.24);
  background:
    radial-gradient(circle at 30% 20%, rgba(97, 214, 168, 0.20), transparent 55%),
    rgba(11, 14, 20, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand h1,
.hero-title,
.daily-rep-panel h3,
.next-action-panel h3,
.rep-card h2,
.shell-screen-title,
.guided-card h3,
.completion-panel h2 {
  letter-spacing: -0.045em;
}

.brand p,
.hero-copy,
.muted-line,
.home-panel-note,
.shell-screen-copy,
.next-action-panel p,
.daily-rep-panel p,
.guided-card p,
.completion-copy {
  color: var(--finish-ink-soft);
}

.screen,
.shell-screen {
  border: 1px solid var(--finish-line);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.055), transparent 28rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.056), rgba(255, 255, 255, 0.022)),
    rgba(14, 17, 24, 0.82);
  box-shadow: var(--finish-ring);
}

#openState {
  overflow: hidden;
  position: relative;
}

#openState::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.07), transparent 28%, transparent 74%, rgba(240, 189, 98, 0.035));
  opacity: 0.8;
}

#openState > * {
  position: relative;
  z-index: 1;
}

.prompt-head {
  align-items: center;
}

.prompt-kicker,
.eyebrow,
.daily-rep-kicker,
.next-action-kicker,
.guided-kicker,
.guided-tool-label,
.rep-practice-label,
.stat-label {
  letter-spacing: 0.075em;
  opacity: 0.96;
}

.hero-title {
  max-width: 13.5ch;
  margin-bottom: 8px;
}

.hero-copy {
  margin-bottom: 20px;
}

.textarea,
.select,
.text-input {
  background: rgba(5, 7, 11, 0.72);
  border-color: var(--finish-line-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.textarea:focus,
.select:focus,
.text-input:focus {
  border-color: rgba(240, 189, 98, 0.64);
}

.button {
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.064), rgba(255, 255, 255, 0.028)),
    rgba(18, 22, 30, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.button.primary {
  color: #04120d;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.02)),
    var(--mint);
  box-shadow: 0 16px 36px rgba(97, 214, 168, 0.19), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.026);
}

.task-button,
.chip,
.starter-card,
.quick-tool-button,
.home-shelf-item,
.tool-choice,
.chord-pick,
.saved-item,
.history-item {
  border-color: var(--finish-line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.044), rgba(255, 255, 255, 0.018)),
    rgba(7, 10, 15, 0.68);
}

.daily-rep-panel,
.next-action-panel {
  border-color: rgba(240, 189, 98, 0.20);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.055);
}

.daily-rep-panel {
  background:
    radial-gradient(circle at 12% 0%, rgba(240, 189, 98, 0.18), transparent 36%),
    radial-gradient(circle at 94% 100%, rgba(97, 214, 168, 0.10), transparent 34%),
    rgba(255, 255, 255, 0.045);
}

.next-action-panel {
  background:
    radial-gradient(circle at top right, rgba(97, 214, 168, 0.11), transparent 35%),
    linear-gradient(135deg, rgba(240, 189, 98, 0.11), rgba(108, 141, 255, 0.045)),
    rgba(255, 255, 255, 0.038);
}

.home-helper-grid {
  gap: 14px;
}

.home-panel,
.tool-group,
.settings-section,
.rep-pack-card,
.practice-lane,
.saved-item,
.history-item {
  border-color: var(--finish-line-soft);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.044), rgba(255, 255, 255, 0.018)),
    rgba(10, 13, 19, 0.64);
}

.home-panel-head,
.shell-screen-header,
.tool-heading-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.shell-tabbar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.086), rgba(255, 255, 255, 0.034)),
    rgba(11, 15, 22, 0.90);
  border-color: rgba(255, 255, 255, 0.15);
}

.shell-tab {
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.shell-tab:active {
  transform: translateY(1px);
}

.shell-tab[aria-current="page"] {
  background:
    radial-gradient(circle at top, rgba(240, 189, 98, 0.28), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
}

.tool-screen-active,
.tool-screen-picker,
.active-tool-panel,
.tool-content {
  border-color: var(--finish-line-soft);
}

.active-tool-banner,
.coach-strip,
.permission-tool-note {
  background:
    linear-gradient(135deg, rgba(240, 189, 98, 0.078), rgba(97, 214, 168, 0.038));
}

.chord-active-card,
.chord-tool-modern,
.tuner-readout,
.tuner-meter-svg-card,
.guided-card,
.completion-panel {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), 0 16px 46px rgba(0, 0, 0, 0.20);
}

.guided-panel {
  background:
    radial-gradient(circle at 10% 0%, rgba(97, 214, 168, 0.135), transparent 30rem),
    radial-gradient(circle at 90% 0%, rgba(240, 189, 98, 0.105), transparent 26rem),
    linear-gradient(180deg, rgba(26, 30, 40, 0.99), rgba(8, 10, 15, 0.99));
}

.guided-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  padding-bottom: 12px;
}

.guided-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.058), rgba(255, 255, 255, 0.026)),
    rgba(8, 11, 16, 0.58);
}

.guided-callout {
  border-color: rgba(240, 189, 98, 0.22);
  background: rgba(240, 189, 98, 0.075);
}

.guided-actions {
  border-top: 1px solid rgba(255, 255, 255, 0.065);
}

.completion-mark {
  box-shadow: 0 18px 34px rgba(240, 189, 98, 0.16);
}

.modal-panel,
.drawer-panel {
  background:
    radial-gradient(circle at top left, rgba(97, 214, 168, 0.08), transparent 26rem),
    rgba(12, 15, 21, 0.98);
}

.qa-tools-section {
  border-style: dashed;
  border-color: rgba(240, 189, 98, 0.20);
}

@media (max-width: 860px) {
  .app-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    gap: 10px;
  }

  .top-actions {
    gap: 7px;
  }

  .button.small {
    min-height: 38px;
  }

  .screen,
  .shell-screen {
    border-radius: 26px;
    padding: clamp(16px, 4.5vw, 22px);
  }

  .hero-title {
    font-size: clamp(2rem, 10.5vw, 3rem);
    max-width: 11ch;
  }

  .hero-copy {
    font-size: 1rem;
    line-height: 1.48;
  }

  .daily-rep-panel,
  .next-action-panel {
    padding: 16px;
    border-radius: 24px;
  }

  .next-action-buttons .button,
  .primary-row .button,
  .completion-actions .button {
    min-height: 52px;
  }

  .home-panel-head,
  .shell-screen-header,
  .tool-heading-row {
    padding-bottom: 8px;
  }

  .guided-card h3 {
    font-size: 1.16rem;
  }

  .settings-section {
    padding: 14px;
  }
}


/* ========================================================================
   NR-SHELL V7.1: toast / snackbar safe-area fix
   NR-DRIFT-GUARD:
   Transient UI must respect fixed shell chrome. Do not position toast at
   raw bottom: 0 or it can hide behind the installed PWA bottom nav.
   ======================================================================== */
.toast {
  bottom: 22px;
  z-index: 96;
}

@media (max-width: 860px) {
  .toast {
    bottom: calc(var(--screen-bottom-space, 118px) + 10px) !important;
    max-width: min(88vw, 520px);
    border-radius: calc(var(--radius, 22px) - 4px);
  }
}

body.guided-active .toast {
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px) !important;
}


/* ============================================================================
   NR-SHELL V7.2.1: Unified Coach Experience + Palette Correction
   Packs may flavor the shell. Packs may not replace the shell.
   ============================================================================ */
:root {
  --nr-radius-lg: 24px;
  --nr-radius-md: 18px;
  --nr-shadow-soft: 0 18px 50px rgba(0, 0, 0, .28);
  --nr-shadow-raised: 0 24px 70px rgba(0, 0, 0, .38);
}
body { background: radial-gradient(circle at 50% -10%, rgba(97,214,168,.10), transparent 34%), var(--bg); color: var(--text); }
.app-shell { background: transparent; }
.topbar {
  min-height: 72px;
  padding: max(14px, env(safe-area-inset-top)) 18px 12px;
  background: rgba(9, 10, 12, .88);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
}
.brand-mark { width: 38px; height: 38px; border-radius: 13px; box-shadow: none; }
.brand h1 { font-size: 1.04rem; letter-spacing: -.02em; }
.brand p { display: none; }
.top-actions { gap: 8px; }
.pack-picker { border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.055); padding: 5px 8px 5px 10px; border-radius: 14px; }
.pack-picker > span { display: none; }
.pack-picker .select { min-width: 112px; background: transparent; border: 0; font-weight: 750; }
.legacy-pack-button { display: none !important; }
#settingsBtn { width: 42px; height: 42px; overflow: hidden; color: transparent; position: relative; padding: 0; border-radius: 14px; }
#settingsBtn::after { content: ""; position:absolute; inset:10px; background: currentColor; color: var(--text); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .34 1.88l.06.06-2.83 2.83-.06-.06a1.7 1.7 0 0 0-1.88-.34 1.7 1.7 0 0 0-1.03 1.56V21h-4v-.09A1.7 1.7 0 0 0 9 19.35a1.7 1.7 0 0 0-1.88.34l-.06.06-2.83-2.83.06-.06A1.7 1.7 0 0 0 4.63 15 1.7 1.7 0 0 0 3.07 14H3v-4h.09A1.7 1.7 0 0 0 4.65 9a1.7 1.7 0 0 0-.34-1.88l-.06-.06 2.83-2.83.06.06A1.7 1.7 0 0 0 9 4.63 1.7 1.7 0 0 0 10 3.07V3h4v.09A1.7 1.7 0 0 0 15 4.65a1.7 1.7 0 0 0 1.88-.34l.06-.06 2.83 2.83-.06.06A1.7 1.7 0 0 0 19.37 9 1.7 1.7 0 0 0 20.93 10H21v4h-.09A1.7 1.7 0 0 0 19.4 15Z'/%3E%3C/svg%3E") center/contain no-repeat; }
.shell-main { max-width: 1040px; }
.screen { animation: nr-screen-in .2s ease both; }
@keyframes nr-screen-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.prompt-head { align-items: flex-start; }
.prompt-kicker, .eyebrow { letter-spacing: .08em; font-size: .72rem; }
.hero-title { max-width: 760px; font-size: clamp(2rem, 7vw, 4rem); line-height: .98; letter-spacing: -.055em; }
.hero-copy { max-width: 670px; font-size: 1.02rem; }
.today-pack-line { display: inline-flex; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.055); border-radius: 999px; padding: 8px 12px; }
.daily-rep-panel { border: 1px solid rgba(240,189,98,.15); border-radius: var(--nr-radius-lg); box-shadow: var(--nr-shadow-soft); background: linear-gradient(145deg, rgba(28,32,40,.96), rgba(20,22,26,.96)); }
.input-label { margin-top: 22px; }
.textarea { border-radius: 20px; border-color: rgba(255,255,255,.10); min-height: 116px; background: rgba(255,255,255,.045); color: var(--text); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.textarea:focus { box-shadow: 0 0 0 4px rgba(225,156,53,.15); }
.task-grid { background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.06); border-radius: 16px; padding: 5px; gap: 4px; }
.task-button { border: 0; border-radius: 12px; background: transparent; }
.task-button[aria-pressed="true"] { background: rgba(240,189,98,.16); color: var(--text); box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.primary-row .button.primary, .next-action-buttons .button.primary { min-height: 52px; font-size: 1rem; }
.next-action-panel { border: 1px solid rgba(97,214,168,.18); border-radius: var(--nr-radius-lg); background: linear-gradient(145deg, rgba(20,57,44,.94), rgba(16,28,27,.98)); color: var(--text); box-shadow: var(--nr-shadow-raised); }
.next-action-panel .next-action-kicker, .next-action-panel p { color: rgba(255,255,255,.72); }
.next-action-panel .button:not(.primary) { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.14); color:white; }
.home-helper-grid { gap: 14px; }
.home-panel, .workspace-card { border: 1px solid rgba(255,255,255,.07); border-radius: var(--nr-radius-md); background: rgba(20,22,26,.86); box-shadow: 0 10px 32px rgba(0,0,0,.18); }
.shell-screen-header { padding-bottom: 6px; }
.shell-screen-title { font-size: clamp(1.9rem, 6vw, 3.2rem); letter-spacing: -.045em; }
.shell-screen-copy { max-width: 650px; }
.coach-strip { border: 1px solid rgba(255,255,255,.07); border-radius: 16px; background: rgba(255,255,255,.045); }
.tool-screen-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.tool-screen-active { box-shadow: var(--nr-shadow-soft); background: rgba(20,22,26,.94); border: 1px solid rgba(255,255,255,.07); }
.tool-screen-picker { position: sticky; top: 92px; max-height: calc(100dvh - 190px); overflow: auto; }
#shellToolGroups .tool-group { margin-bottom: 10px; }
#shellToolGroups .tool-button { min-height: 44px; border-radius: 13px; }
.pack-screen-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.pack-card-modern { position:relative; overflow:hidden; display:flex; flex-direction:column; gap:14px; min-height:100%; border:1px solid rgba(255,255,255,.08); border-radius:24px; background:rgba(20,22,26,.92); box-shadow:0 16px 40px rgba(0,0,0,.22); padding:20px; }
.pack-card-modern::before { content:""; position:absolute; inset:0 0 auto; height:5px; background:var(--pack-accent,#d79b35); }
.pack-card-modern.active { border-color: color-mix(in srgb,var(--pack-accent) 44%,rgba(255,255,255,.08)); box-shadow:0 22px 60px rgba(0,0,0,.34); transform:translateY(-2px); }
.pack-accent-amber { --pack-accent:#d79b35; }
.pack-accent-violet { --pack-accent:#7b61c8; }
.pack-accent-blue { --pack-accent:#3979a8; }
.pack-card-top { display:flex; gap:12px; align-items:center; }
.pack-card-symbol { width:46px; height:46px; border-radius:15px; display:grid; place-items:center; background:color-mix(in srgb,var(--pack-accent) 18%,rgba(255,255,255,.04)); color:var(--pack-accent); font-weight:900; font-size:1.2rem; }
.pack-card-heading { min-width:0; flex:1; }
.pack-card-heading h3 { margin:2px 0 0; font-size:1.35rem; }
.pack-card-state { font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); font-weight:800; }
.pack-card-welcome { margin:0; font-size:1.08rem; font-weight:800; letter-spacing:-.02em; }
.pack-start-here { background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.055); border-radius:15px; padding:12px; display:grid; gap:4px; }
.pack-start-here span { color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; font-weight:800; }
.pack-tool-chips { display:flex; flex-wrap:wrap; gap:7px; }
.pack-tool-chips span { padding:6px 9px; background:color-mix(in srgb,var(--pack-accent) 14%,rgba(255,255,255,.035)); border:1px solid color-mix(in srgb,var(--pack-accent) 24%,transparent); border-radius:999px; font-size:.78rem; font-weight:700; }
.pack-card-modern .rep-pack-actions { margin-top:auto; }
.pack-card-modern .rep-pack-actions .button { width:100%; }
.rep-pack-details { border-top:1px solid rgba(255,255,255,.08); padding-top:10px; }
.saved-shell-grid { grid-template-columns: 1.1fr .9fr; gap:16px; }
#continueStrip { background:linear-gradient(135deg,rgba(20,57,44,.98),rgba(24,28,38,.98)); color:var(--text); border:1px solid rgba(97,214,168,.18); border-radius:22px; padding:18px; box-shadow:var(--nr-shadow-soft); }
#continueStrip span { color:rgba(255,255,255,.72); }
#continueStrip .button { margin-left:auto; background:var(--mint); color:#08110d; }
.saved-data-action { opacity:.72; }
.shell-tabbar { background:rgba(9,10,12,.92); backdrop-filter:blur(22px); border-top:1px solid rgba(255,255,255,.08); box-shadow:0 -14px 40px rgba(0,0,0,.28); }
.shell-tab { gap:3px; font-size:.72rem; border-radius:16px; padding:7px 10px; color:var(--muted); }
.shell-tab-icon { width:24px; height:24px; display:grid; place-items:center; }
.shell-tab-icon svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.shell-tab[aria-current="page"] { color:var(--text); background:rgba(255,255,255,.075); box-shadow:0 6px 22px rgba(0,0,0,.22); }
.shell-tab[aria-current="page"] .shell-tab-icon { color:var(--accent); }
.settings-section { border-radius:18px; }
.qa-tools-section { display:none; opacity:.88; }
body.is-qa-mode .qa-tools-section { display:block; }
@media (max-width: 820px) {
  .shell-main { padding-left:14px; padding-right:14px; }
  .tool-screen-grid, .saved-shell-grid { grid-template-columns:1fr; }
  .tool-screen-picker { position:static; max-height:none; order:-1; padding:10px; background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.06); box-shadow:none; }
  #shellToolGroups { display:grid; grid-template-columns:1fr; gap:8px; overflow-x:visible; padding-bottom:0; }
  #shellToolGroups > * { min-width:0; }
  .nash-grid { grid-template-columns:repeat(2,minmax(0,1fr)); overflow-x:visible; padding-bottom:0; }
  .pack-screen-grid { grid-template-columns:1fr; }
  .pack-card-modern { min-height:0; }
  .shell-screen-header .today-rep-button { display:none; }
  .home-helper-grid { grid-template-columns:1fr; }
}
@media (max-width: 520px) {
  .topbar { padding-left:13px; padding-right:13px; }
  .brand-mark { display:none; }
  .pack-picker .select { min-width:104px; }
  .hero-title { font-size:clamp(2rem,11vw,3rem); }
  .daily-rep-panel { padding:16px; }
  .primary-row { display:grid; grid-template-columns:1fr; }
  .next-action-buttons { display:grid; grid-template-columns:1fr; }
  .next-action-buttons .button:not(.primary) { min-height:44px; }
  .shell-tabbar { padding-left:8px; padding-right:8px; }
  .shell-tab { min-width:0; }
}

/* ======================================================================
   NR-CALM V7.5.3: Calm Interface Pass
   One clear door per hallway. Secondary choices stay available on demand.
   ====================================================================== */
.calm-disclosure {
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  background: rgba(255,255,255,.035);
}
.calm-disclosure > summary {
  list-style: none;
  min-height: 46px;
  padding: 12px 42px 12px 14px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  font-weight: 800;
  color: var(--text);
}
.calm-disclosure > summary::-webkit-details-marker { display: none; }
.calm-disclosure > summary::after {
  content: "+";
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 500;
}
.calm-disclosure[open] > summary::after { content: "−"; }
.calm-disclosure[open] > summary { border-bottom: 1px solid rgba(255,255,255,.06); }
.today-options { margin-top: 12px; }
.today-options .task-grid { margin: 12px 12px 8px; }
.today-options .chip-row { padding: 4px 12px 12px; }
#openState > #nextActionPanel { display: none; }
.home-helper-grid { grid-template-columns: minmax(0,1fr); }
.home-helper-grid .quick-tools-panel { order: -1; }
.home-helper-grid .home-panel { box-shadow: none; }
.home-helper-grid details.home-panel { padding: 0; }
.home-helper-grid details.home-panel > .home-panel-note,
.home-helper-grid details.home-panel > .starter-grid,
.home-helper-grid details.home-panel > .home-shelf { margin-left: 14px; margin-right: 14px; }
.home-helper-grid details.home-panel > :last-child { margin-bottom: 14px; }
.rep-more-actions { margin-top: 12px; }
.rep-more-actions .action-bar { padding: 12px; margin: 0; }
.saved-history-panel { padding: 0; }
.saved-history-panel > p,
.saved-history-panel > .saved-shell-list { margin-left: 14px; margin-right: 14px; }
.saved-history-panel > .saved-shell-list { margin-bottom: 14px; }

@media (max-width: 820px) {
  .hero-copy { display: none; }
  .daily-rep-panel { padding: 12px 14px; min-height: 0; }
  .daily-rep-copy p { display: none; }
  .daily-rep-copy h3 { font-size: 1rem; margin: 2px 0 0; }
  .daily-rep-kicker { font-size: .68rem; }
  .weekly-progress { scale: .9; transform-origin: right center; }
  .privacy-note { margin-top: 8px; font-size: .74rem; opacity: .72; }
  .home-helper-grid { margin-top: 14px; }
  .quick-tools-panel .home-panel-head p { display: none; }
  .quick-tools-panel { padding: 14px; }
  .shell-screen-copy { max-width: 44ch; }
  .packs-screen .coach-strip, #packsScreen > .coach-strip { display: none; }
  .saved-shell-grid { gap: 10px; }
  .saved-data-action { font-size: 0; width: 42px; height: 42px; padding: 0; }
  .saved-data-action::after { content: "•••"; font-size: 1rem; letter-spacing: 2px; }
}

@media (max-width: 520px) {
  .prompt-head { gap: 8px; }
  .prompt-head #shufflePromptBtn { min-width: 42px; width: 42px; font-size: 0; }
  .prompt-head #shufflePromptBtn::after { content: "↻"; font-size: 1.15rem; }
  .today-pack-line { padding: 6px 10px; font-size: .78rem; }
  .textarea { min-height: 92px; }
  .primary-row { gap: 8px; }
  .primary-row .button.ghost { min-height: 42px; }
  .result-next-action .next-action-buttons .button:not(.primary) { display: none; }
  .rep-card-actions .start-rep-button { display: none; }
  .practice-lane .flow-buttons { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .step-tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .step-tabs::-webkit-scrollbar { display: none; }
  .step-tab { flex: 0 0 auto; min-width: 108px; }
}

/* ======================================================================
   NR-FLOW V7.5.3: Task-first mobile hierarchy
   The activity leads. Explanations and configuration remain one tap away.
   ====================================================================== */
.rep-card-actions { display: none !important; }
.mobile-practice-shell { display: none !important; }
.result-command-bar {
  position: sticky;
  bottom: calc(var(--screen-bottom-space, 118px) - 4px);
  z-index: 18;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 10px 0;
  padding: 10px;
  border: 1px solid rgba(97,214,168,.22);
  border-radius: 18px;
  background: rgba(13,18,18,.94);
  box-shadow: 0 18px 46px rgba(0,0,0,.38);
  backdrop-filter: blur(18px);
}
.result-command-bar .button { min-height: 48px; }
.result-command-bar .button.primary { font-size: 1rem; }
.rep-learning-details,
.tool-band,
.rep-more-actions { margin-top: 10px; }
.rep-learning-details .step-tabs { margin: 12px 12px 0; }
.rep-learning-details .step-card { margin: 10px 12px 12px; }
.tool-band > p,
.tool-band > .tool-buttons { margin-left: 14px; margin-right: 14px; }
.tool-band > :last-child { margin-bottom: 14px; }
.tool-screen-picker { padding: 0; }
.tool-screen-picker #shellToolGroups { padding: 10px; }
#toolsCoachStrip { display: none; }
.active-tool-banner > div { display: grid; gap: 2px; }
.active-tool-banner > div > span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-queue-card { margin-bottom: 12px; }
.review-queue-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.review-queue-heading h3 { margin: 2px 0 0; }
.review-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(97,214,168,.2);
  border-radius: 999px;
  background: rgba(97,214,168,.1);
  color: var(--mint);
  font-size: .78rem;
  font-weight: 800;
}
.review-queue-list { display: grid; gap: 8px; }
.review-queue-item {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.review-queue-item > span:first-child { display: grid; gap: 3px; }
.review-queue-item small { color: var(--muted); }
.review-queue-item > span:last-child { color: var(--accent); font-weight: 800; }
.review-queue-item.is-due { border-color: rgba(240,189,98,.24); }
.review-queue-empty { margin: 0; color: var(--muted); }
.guided-session.is-count-based .guided-timer-stat { display: none; }
.guided-session.is-count-based .guided-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }

@media (max-width: 820px) {
  .tool-screen-grid { display: flex; flex-direction: column; gap: 10px; }
  .tool-screen-active { order: 1; width: 100%; }
  .tool-screen-picker {
    order: 2 !important;
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    background: rgba(255,255,255,.035);
    box-shadow: none;
  }
  .tool-screen-picker #shellToolGroups { padding: 10px; }
  .tool-screen-picker:not([open]) #shellToolGroups { display: none; }
  .tool-screen-active,
  .review-queue-card { padding: 14px; }
  .result-screen .rep-card { padding: 16px; border-radius: 20px; }
}

@media (max-width: 520px) {
  .result-command-bar { grid-template-columns: 1fr; }
  .result-command-bar .button:not(.primary) { display: none; }
  .rep-learning-details .step-tabs { margin-right: 0; padding-right: 12px; }
  .review-queue-item { min-height: 56px; }
}

/* ======================================================================
   NR-STUDIO V7.5.3: Modern Practice Studio
   Path first. Instrument second. Configuration only when it helps.
   ====================================================================== */
:root {
  --studio-bg: #080b0a;
  --studio-surface: #111614;
  --studio-surface-raised: #19201d;
  --studio-cream: #f4efe4;
  --studio-muted: #aaa99f;
  --studio-amber: #f2b84b;
  --studio-mint: #69dfb1;
  --studio-line: rgba(244,239,228,.10);
  --studio-radius: 26px;
}
body {
  background:
    radial-gradient(circle at 8% -5%, rgba(105,223,177,.12), transparent 28rem),
    linear-gradient(180deg, #080b0a 0%, #090a0b 72%, #060707 100%);
  color: var(--studio-cream);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background: repeating-linear-gradient(90deg, transparent 0 78px, rgba(255,255,255,.018) 79px 80px);
}
.shell-main { max-width: 980px; }
.topbar { max-width: 1060px; margin: 0 auto; border-radius: 0 0 24px 24px; }
#openState,
#resultState {
  overflow: visible;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#openState::before { display: none; }
.button { border-radius: 16px; }
.button.primary {
  border-color: transparent;
  background: var(--studio-mint);
  color: #07110d;
  box-shadow: 0 12px 30px rgba(40,174,124,.18);
}
.button.primary:hover { background: #7ce8bd; }

/* Today: path before prompt */
.studio-today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 16px 0 14px;
  padding: 4px 2px;
}
.studio-today-header h2 {
  margin: 4px 0 2px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1;
  letter-spacing: -.055em;
}
.studio-workspace-line { margin: 8px 0 0; color: var(--studio-muted); }
.studio-weekly-progress {
  flex: 0 0 auto;
  border: 1px solid var(--studio-line);
  border-radius: 18px;
  background: rgba(255,255,255,.035);
  padding: 10px 14px;
}
.studio-path-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 22px;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(242,184,75,.22);
  border-radius: 32px;
  background:
    radial-gradient(circle at 90% 8%, rgba(242,184,75,.12), transparent 17rem),
    linear-gradient(145deg, #1b221f 0%, #121715 72%);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}
.studio-path-card::after {
  content: "";
  position: absolute;
  width: 310px;
  height: 310px;
  right: -125px;
  bottom: -190px;
  border: 1px solid rgba(242,184,75,.16);
  border-radius: 50%;
  box-shadow: 0 0 0 24px rgba(242,184,75,.025), 0 0 0 48px rgba(242,184,75,.018);
}
.studio-path-copy { position: relative; z-index: 1; max-width: 720px; }
.studio-path-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.studio-progress-label {
  color: var(--studio-muted);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.studio-path-card h3 {
  max-width: 760px;
  margin: 10px 0 8px;
  font-size: clamp(1.85rem, 5vw, 3.25rem);
  line-height: 1.02;
  letter-spacing: -.05em;
}
.studio-path-card p { max-width: 64ch; margin: 0; color: #c4c1b8; font-size: 1rem; }
.studio-path-rail { position: relative; z-index: 1; }
.studio-path-rail ol {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.studio-path-rail ol::before {
  content: "";
  position: absolute;
  left: 7%;
  right: 7%;
  top: 20px;
  height: 2px;
  background: rgba(255,255,255,.09);
}
.studio-path-rail li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: #777b76;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}
.studio-path-marker {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 2px solid #3a403d;
  border-radius: 15px;
  background: #121715;
  color: #868b86;
}
.studio-path-rail li.is-complete { color: #9ab9aa; }
.studio-path-rail li.is-complete .studio-path-marker { border-color: rgba(105,223,177,.42); background: rgba(105,223,177,.12); color: var(--studio-mint); }
.studio-path-rail li.is-active { color: var(--studio-cream); }
.studio-path-rail li.is-active .studio-path-marker {
  border-color: var(--studio-amber);
  background: var(--studio-amber);
  color: #1b1305;
  box-shadow: 0 0 0 6px rgba(242,184,75,.10), 0 10px 22px rgba(0,0,0,.28);
  transform: rotate(-3deg);
}
.studio-path-actions { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; }
.studio-path-actions span { color: var(--studio-muted); font-size: .82rem; font-weight: 700; }
.studio-path-primary { min-width: min(100%, 220px); min-height: 54px; }

.studio-spark-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--studio-line);
  border-radius: 24px;
  background: rgba(17,22,20,.76);
}
.studio-spark-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.studio-spark-heading h3 { margin: 4px 0 0; font-size: clamp(1.2rem,3vw,1.65rem); letter-spacing: -.025em; }
.studio-spark-copy { max-width: 64ch; margin: 8px 0 0; color: var(--studio-muted); }
.studio-spark-card .input-label { margin-top: 16px; }
.studio-spark-card .textarea { min-height: 88px; }
.studio-submit {
  min-height: 50px;
  border-color: rgba(242,184,75,.38);
  background: rgba(242,184,75,.12);
  color: #ffd680;
  font-weight: 850;
}
.studio-local-note { text-align: center; }
#openState > #nextActionPanel { display: none !important; }

/* Lesson: one brief, visible instrument, one command */
.result-screen { max-width: 920px; margin: 0 auto; }
.result-top { margin-bottom: 10px; }
.result-screen .rep-card {
  padding: clamp(20px,4vw,34px);
  border: 1px solid rgba(242,184,75,.18);
  border-radius: 30px;
  background: linear-gradient(145deg,#171d1a,#101412);
  box-shadow: 0 28px 80px rgba(0,0,0,.34);
}
.result-screen .rep-card h2 {
  max-width: 780px;
  margin: 14px 0 8px;
  font-size: clamp(2rem,6vw,3.8rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.studio-lesson-layout {
  display: grid;
  grid-template-columns: minmax(0,1.05fr) minmax(260px,.95fr);
  gap: 20px;
  align-items: start;
  margin-top: 20px;
}
.studio-lesson-brief { min-width: 0; }
.studio-lesson-brief .coach-note {
  margin: 0 0 14px;
  padding: 0 0 0 14px;
  border-left: 3px solid var(--studio-amber);
  color: #c8c4b9;
}
.result-screen .rep-practice-panel {
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid var(--studio-line);
  border-radius: 20px;
  background: rgba(0,0,0,.12);
}
.result-screen .rep-practice-item {
  display: grid;
  grid-template-columns: 96px minmax(0,1fr);
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid rgba(255,255,255,.065);
}
.result-screen .rep-practice-item:last-child { border-bottom: 0; }
.result-screen .rep-practice-label { color: var(--studio-amber); }
.studio-lesson-chords {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 10px;
}
.studio-lesson-chord { min-width: 0; }
.studio-lesson-chord > span {
  display: block;
  margin: 0 0 6px 4px;
  color: var(--studio-muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.studio-lesson-chord.is-current > span { color: var(--studio-mint); }
.studio-lesson-chords .chord-selected-card { height: 100%; padding: 12px; border-radius: 20px; background: #0d110f; }
.studio-lesson-chords .chord-selected-header { margin-bottom: 2px; }
.studio-lesson-chords .chord-name { font-size: 2rem; }
.studio-lesson-chords .chord-hand-pill { display: none; }
.studio-lesson-chords .chord-svg { width: 100%; height: auto; }
.result-command-bar {
  border-color: rgba(105,223,177,.26);
  border-radius: 20px;
  background: rgba(10,16,13,.94);
}

/* Practice: a stage, not another card stack */
.guided-session { background: #070908; }
.guided-panel {
  width: min(100%, 900px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px,env(safe-area-inset-top)) clamp(18px,4vw,34px) calc(116px + env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(105,223,177,.10), transparent 26rem),
    #080b0a;
  box-shadow: none;
}
.guided-header { padding-bottom: 14px; border-bottom: 1px solid var(--studio-line); }
.guided-header h2 { max-width: 720px; font-size: clamp(1.45rem,4vw,2.3rem); letter-spacing: -.04em; }
.guided-progress { max-width: 520px; margin: 18px auto; }
.guided-card {
  max-width: 720px;
  margin: 0 auto 16px;
  padding: 8px 0 16px;
  border: 0;
  background: transparent;
  text-align: center;
  box-shadow: none;
}
.guided-card h3 { margin: 8px 0; font-size: clamp(2.2rem,8vw,4.8rem); line-height: .95; letter-spacing: -.065em; }
.guided-card p { max-width: 60ch; margin: 0 auto; color: #c3c0b6; font-size: 1.02rem; }
.guided-callout { max-width: 620px; margin: 16px auto 0; border-color: rgba(242,184,75,.18); background: rgba(242,184,75,.08); color: #f1d49a; }
.guided-chord-sequence {
  max-width: 620px;
  margin: 0 auto 16px;
  padding: 18px;
  border: 1px solid rgba(105,223,177,.22);
  border-radius: 28px;
  background: rgba(16,23,20,.92);
  box-shadow: 0 26px 70px rgba(0,0,0,.32);
}
.guided-chord-sequence-header strong { font-size: clamp(3.2rem,12vw,6rem); line-height: .9; }
.guided-chord-next { border-radius: 14px; background: rgba(255,255,255,.055); }
.guided-chord-diagram { max-width: 330px; margin: 8px auto; }
.guided-chord-diagram .chord-selected-card { border: 0; background: transparent; box-shadow: none; }
.guided-chord-diagram .chord-selected-header { display: none; }
.guided-stats { max-width: 620px; margin: 12px auto; }
.guided-stats .stat-card { border-radius: 18px; background: rgba(255,255,255,.035); }
.guided-evidence {
  max-width: 660px;
  margin: 12px auto;
  border: 1px solid rgba(242,184,75,.18);
  border-radius: 24px;
  background: #121715;
}
.guided-session.is-outcome .guided-card {
  max-width: 660px;
  margin-top: clamp(28px,7vh,74px);
  padding: 28px;
  border: 1px solid rgba(105,223,177,.22);
  border-radius: 30px;
  background: radial-gradient(circle at 50% 0,rgba(105,223,177,.12),transparent 18rem),#111614;
}
.guided-session.is-outcome .guided-card h3 { color: var(--studio-cream); }
.guided-session.is-outcome .guided-evidence { border-color: var(--studio-line); }
.guided-reflection,
.guided-tool-strip { max-width: 660px; margin-left: auto; margin-right: auto; }
.guided-actions {
  position: fixed;
  left: 50%;
  bottom: max(12px,env(safe-area-inset-bottom));
  z-index: 90;
  width: min(calc(100% - 24px),720px);
  translate: -50% 0;
  padding: 10px;
  border: 1px solid var(--studio-line);
  border-radius: 22px;
  background: rgba(10,13,12,.94);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  backdrop-filter: blur(18px);
}
.guided-actions .button { min-height: 52px; }

/* Honest outcome */
.completion-moment { background: rgba(4,6,5,.92); backdrop-filter: blur(16px); }
.completion-panel {
  max-width: 580px;
  border: 1px solid rgba(105,223,177,.22);
  border-radius: 32px;
  background: radial-gradient(circle at 50% 0,rgba(105,223,177,.12),transparent 18rem),#111614;
}
.completion-mark { border-radius: 18px 18px 18px 6px; background: rgba(105,223,177,.14); color: var(--studio-mint); }
.completion-panel h2 { font-size: clamp(2.2rem,8vw,4rem); line-height: .96; letter-spacing: -.06em; }

/* Supporting screens stay quiet */
.workspace-card,
.home-panel { background: rgba(17,22,20,.88); border-color: var(--studio-line); }
.tool-screen-active { background: rgba(17,22,20,.94); }
.pack-card-modern { background: rgba(17,22,20,.94); }
.shell-tabbar { border-radius: 22px 22px 0 0; }

@media (max-width: 820px) {
  .studio-today-header { margin-top: 8px; }
  .studio-today-header h2 { font-size: 2.25rem; }
  .studio-weekly-progress { padding: 8px 10px; }
  .studio-path-card { gap: 18px; padding: 22px; border-radius: 28px; }
  .studio-path-card h3 { font-size: clamp(2rem,8vw,3rem); }
  .studio-path-rail li { font-size: .64rem; }
  .studio-path-marker { width: 38px; height: 38px; border-radius: 13px; }
  .studio-path-rail ol::before { top: 18px; }
  .studio-lesson-layout { grid-template-columns: 1fr; }
  .studio-lesson-chords { max-width: 520px; }
  .result-screen .rep-practice-panel { display: grid; }
  .mobile-rep-brief { display: block; }
  .guided-panel { width: 100%; }
}

@media (max-width: 520px) {
  .topbar { min-height: 62px; border-radius: 0; }
  .brand h1 { font-size: .98rem; }
  .studio-today-header { align-items: flex-end; }
  .studio-today-header h2 { font-size: 1.8rem; }
  .studio-workspace-line { display: none; }
  .studio-weekly-progress .weekly-progress-visual { width: 34px; height: 34px; }
  .studio-weekly-progress .weekly-progress-svg { width: 34px; height: 34px; }
  .studio-weekly-progress .weekly-progress-count { font-size: 1.25rem; }
  .studio-weekly-progress .weekly-progress-meta { display: none; }
  .studio-path-card { padding: 20px 16px; border-radius: 26px; }
  .studio-path-card h3 { margin-top: 9px; font-size: 2.15rem; }
  .studio-path-card p { font-size: .92rem; }
  .studio-path-status { gap: 7px; }
  .studio-path-rail ol { gap: 2px; }
  .studio-path-rail li { gap: 6px; font-size: .57rem; line-height: 1.1; }
  .studio-path-marker { width: 34px; height: 34px; border-radius: 12px; font-size: .72rem; }
  .studio-path-rail ol::before { left: 8%; right: 8%; top: 16px; }
  .studio-path-actions { align-items: stretch; flex-direction: column; gap: 8px; }
  .studio-path-primary { width: 100%; }
  .studio-path-actions span { text-align: center; }
  .studio-spark-card { padding: 16px; border-radius: 22px; }
  .studio-spark-copy { display: none; }
  .studio-spark-heading h3 { font-size: 1.15rem; }
  .studio-spark-heading .button { width: 42px; min-width: 42px; font-size: 0; }
  .studio-spark-heading .button::after { content: "↻"; font-size: 1rem; }
  .studio-spark-card .textarea { min-height: 76px; }
  .studio-spark-actions { grid-template-columns: 1fr auto; }
  .result-screen .rep-card { padding: 18px 16px; }
  .result-screen .rep-card h2 { font-size: 2.35rem; }
  .studio-lesson-layout { margin-top: 14px; gap: 14px; }
  .studio-lesson-brief .coach-note { font-size: .9rem; }
  .result-screen .rep-practice-item { grid-template-columns: 76px minmax(0,1fr); padding: 11px 12px; }
  .result-screen .rep-practice-value { font-size: .9rem; }
  .studio-lesson-chords { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .studio-lesson-chords .chord-selected-card { padding: 8px; border-radius: 16px; }
  .studio-lesson-chords .chord-name { font-size: 1.55rem; }
  .guided-panel { padding-left: 14px; padding-right: 14px; }
  .guided-header .muted-line { display: none; }
  .guided-card h3 { font-size: 3.1rem; }
  .guided-chord-sequence { padding: 14px; border-radius: 24px; }
  .guided-chord-diagram { max-width: 260px; }
  .guided-actions { grid-template-columns: 1fr; }
  .guided-actions .button:not(.primary):not(.success):not(.warn) { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .studio-path-rail li.is-active .studio-path-marker { transform: none; }
}

/* ======================================================================
   NR-VIEWPORT V7.5.3: one-screen mobile practice shell
   Primary work stays in the viewport. Libraries scroll inside themselves.
   ====================================================================== */
@media (max-width: 820px) {
  html,
  body {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  body { padding: 0 !important; }
  .app-shell {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0,1fr);
    overflow: hidden;
    padding: 8px 12px calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + var(--safe-bottom) + 8px) !important;
  }
  .topbar {
    min-height: 0;
    margin: 0 0 6px !important;
    padding: max(3px,var(--safe-top)) 0 7px !important;
  }
  .shell-main {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
  }
  .shell-main > .screen:not([hidden]) {
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
  }
  #toolsScreen,
  #packsScreen,
  #savedScreen {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 20px;
  }
  #openState {
    display: grid;
    grid-template-rows: auto minmax(0,1fr) auto;
    gap: 9px;
    overflow: hidden;
  }
  #openState > .privacy-note,
  #openState > .home-helper-grid { display: none; }
  .studio-today-header { margin: 0; padding: 0 2px; }
  .studio-today-header h2 { margin-top: 2px; font-size: 1.75rem; }
  .studio-path-card {
    min-height: 0;
    gap: clamp(8px,1.7vh,14px);
    padding: clamp(13px,2.4vh,20px) 16px;
  }
  .studio-path-card h3 { margin: 5px 0; font-size: clamp(1.65rem,5.4vh,2.3rem); }
  .studio-path-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: .86rem;
    line-height: 1.35;
  }
  .studio-path-marker { width: 32px; height: 32px; border-radius: 11px; }
  .studio-path-rail ol::before { top: 15px; }
  .studio-path-actions { margin-top: auto; }
  .studio-path-primary { min-height: 46px; }
  .studio-spark-card {
    display: grid;
    grid-template-columns: minmax(0,1fr) 118px;
    gap: 7px;
    margin: 0;
    padding: 9px;
    border-radius: 18px;
  }
  .studio-spark-heading,
  .studio-spark-copy,
  .studio-spark-card .today-options { display: none; }
  .studio-spark-card .input-label {
    grid-column: 1 / -1;
    margin: 0 2px;
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .studio-spark-card .textarea {
    grid-column: 1;
    min-height: 46px;
    max-height: 46px;
    padding: 11px 12px;
    border-radius: 13px;
    resize: none;
  }
  .studio-spark-actions {
    grid-column: 2;
    display: block;
    margin: 0;
  }
  .studio-spark-actions .studio-submit { width: 100%; min-height: 46px; padding: 0 10px; }
  .studio-spark-actions #savedRepsShortcutBtn { display: none; }

  #resultState {
    display: grid;
    grid-template-rows: auto minmax(0,1fr) auto auto;
    gap: 8px;
    overflow: hidden;
  }
  #resultState .result-top { min-height: 36px; margin: 0; align-items: center; }
  #resultState .rep-card {
    min-height: 0;
    overflow: hidden;
    padding: 14px;
  }
  #resultState .rep-meta { display: none; }
  #resultState .rep-card h2 { margin: 0 0 5px; font-size: clamp(1.7rem,5.2vh,2.35rem); }
  #resultState .mobile-rep-brief { margin-bottom: 7px; font-size: .76rem; }
  #resultState .studio-lesson-layout {
    grid-template-columns: minmax(0,1fr) minmax(108px,34%);
    gap: 10px;
    min-height: 0;
    margin: 8px 0 0;
  }
  #resultState .coach-note { display: none; }
  #resultState .rep-practice-panel { min-height: 0; margin: 0; }
  #resultState .rep-practice-item { grid-template-columns: 68px minmax(0,1fr); gap: 7px; padding: 8px 9px; }
  #resultState .rep-practice-item:nth-child(2) { display: none; }
  #resultState .rep-practice-label { font-size: .62rem; }
  #resultState .rep-practice-value { font-size: .78rem; line-height: 1.28; }
  #resultState .studio-lesson-chords { display: block; min-height: 0; }
  #resultState .studio-lesson-chord:not(:first-child) { display: none; }
  #resultState .studio-lesson-chord > span { margin-bottom: 2px; }
  #resultState .studio-lesson-chords .chord-selected-card { padding: 6px; }
  #resultState .studio-lesson-chords .chord-selected-header { margin: 0; }
  #resultState .studio-lesson-chords .chord-name { font-size: 1.35rem; }
  #resultState .studio-lesson-chords .chord-svg { max-height: 175px; }
  #resultState .result-command-bar {
    position: static;
    bottom: auto;
    margin: 0;
    padding: 7px;
  }
  #resultState .result-command-bar .button { min-height: 46px; }
  #resultState .tool-band,
  #resultState .rep-more-actions { display: none; }
  #resultState .rep-learning-details { margin: 0; }
  #resultState .rep-learning-details > summary { min-height: 42px; padding-top: 8px; padding-bottom: 8px; }
  #resultState .rep-learning-details[open] {
    position: absolute;
    inset: 0;
    z-index: 105;
    overflow: auto;
    border-radius: 24px;
    background: #101513;
    box-shadow: 0 24px 80px rgba(0,0,0,.65);
  }

  .guided-panel {
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh !important;
    overflow: hidden;
    padding: max(10px,var(--safe-top)) 14px calc(118px + var(--safe-bottom));
  }
  .guided-header { padding-bottom: 8px; }
  .guided-header h2 { margin-top: 4px; font-size: clamp(1.05rem,4.8vw,1.35rem); line-height: 1.15; }
  .guided-header .muted-line { display: none; }
  .guided-progress { margin: 9px auto; }
  .guided-card { margin-bottom: 7px; padding: 3px 0 7px; }
  .guided-card h3 { margin: 3px 0 5px; font-size: clamp(2rem,8vh,3rem); }
  .guided-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    font-size: .86rem;
    line-height: 1.35;
  }
  .guided-callout { margin-top: 8px; padding: 9px 11px; font-size: .78rem; }
  .guided-chord-sequence { margin-bottom: 6px; padding: 10px; border-radius: 20px; }
  .guided-chord-sequence-header strong { font-size: 3rem; }
  .guided-chord-diagram { max-width: 180px; margin: 0 auto; }
  .guided-chord-diagram .chord-svg { max-height: 185px; }
  .guided-chord-sequence .button { min-height: 42px; }
  .guided-session.is-count-based:not(.is-outcome) .guided-stats { display: none; }
  .guided-evidence {
    max-height: min(46vh,390px);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .guided-session.is-outcome .guided-card { margin-top: 18px; padding: 20px; }
}

@media (max-width: 520px) {
  .topbar {
    display: flex;
    grid-template-columns: none;
    align-items: center;
    gap: 8px;
  }
  .brand { width: auto; flex: 1 1 auto; }
  .brand h1 { font-size: 1rem; }
  .top-actions {
    width: auto;
    display: flex;
    grid-template-columns: none;
    flex: 0 0 auto;
    gap: 6px;
  }
  .pack-picker {
    width: 150px;
    max-width: 150px;
    min-height: 42px;
    padding: 3px 5px 3px 8px;
  }
  .pack-picker .select { width: 100%; min-width: 0; }
  #settingsBtn { width: 42px; height: 42px; }
  .shell-tabbar { bottom: max(6px,var(--safe-bottom)) !important; min-height: 60px; }
}

@media (max-width: 520px) and (max-height: 720px) {
  :root { --bottom-nav-height: 60px; --bottom-nav-gap: 6px; }
  .app-shell { padding-top: 4px !important; }
  .studio-today-header .eyebrow,
  .studio-weekly-progress,
  .studio-path-card p,
  .studio-path-actions span { display: none; }
  .studio-today-header h2 { font-size: 1.45rem; }
  .studio-path-card { padding-top: 11px; padding-bottom: 11px; }
  .studio-path-card h3 { font-size: 1.55rem; }
  .studio-path-card { gap: 7px; }
  .studio-path-marker { width: 28px; height: 28px; }
  .studio-path-rail ol::before { top: 13px; }
  .studio-path-primary { min-height: 42px; }
  .studio-spark-card .input-label { display: none; }
  .studio-spark-card .textarea,
  .studio-spark-actions .studio-submit { min-height: 42px; max-height: 42px; }
  #resultState .result-top { display: none; }
  #resultState .rep-card h2 { font-size: 1.6rem; }
  #resultState .studio-lesson-chords .chord-svg { max-height: 130px; }
  #resultState .rep-practice-item { padding: 6px 8px; }
  .guided-callout { display: none; }
  .guided-card h3 { font-size: 2rem; }
  .guided-chord-diagram { max-width: 150px; }
  .guided-chord-diagram .chord-svg { max-height: 150px; }
}

/* ======================================================================
   NR-PACK-STUDIO V7.5.3: pack-owned atmosphere, core-owned UI
   ====================================================================== */
body[data-pack="guitar"] {
  --pack-accent: #f2b84b;
  --pack-accent-rgb: 242,184,75;
  --pack-action: #69dfb1;
  --pack-action-ink: #07110d;
  --pack-secondary-rgb: 105,223,177;
  --pack-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 260' fill='none' stroke='%23f2b84b' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M154 24c-8 18-8 39 1 56l-29 29c-17-9-38-9-56-1-31 14-45 50-31 81s50 45 81 31c23-10 37-32 37-55l29-29c17 9 38 9 56 1'/%3E%3Cpath d='m126 109 53 53m-41-65 53 53m-22-80 50 50M75 153c-8 8-8 21 0 29s21 8 29 0 8-21 0-29-21-8-29 0Z'/%3E%3Cpath d='m186 136 45-45 10-33-25 7-47 47'/%3E%3C/svg%3E");
}
body[data-pack="ai"] {
  --pack-accent: #ad91ff;
  --pack-accent-rgb: 173,145,255;
  --pack-action: #9f86f5;
  --pack-action-ink: #100a20;
  --pack-secondary-rgb: 91,209,224;
  --pack-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 260' fill='none' stroke='%23ad91ff' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m130 23 88 51v102l-88 51-88-51V74l88-51Z'/%3E%3Cpath d='m92 96-31 34 31 34m76-68 31 34-31 34m-21-88-34 108'/%3E%3Ccircle cx='130' cy='23' r='8' fill='%23ad91ff'/%3E%3Ccircle cx='218' cy='74' r='8' fill='%23ad91ff'/%3E%3Ccircle cx='218' cy='176' r='8' fill='%23ad91ff'/%3E%3C/svg%3E");
}
body[data-pack="work"] {
  --pack-accent: #78aaff;
  --pack-accent-rgb: 120,170,255;
  --pack-action: #72a8ff;
  --pack-action-ink: #07101f;
  --pack-secondary-rgb: 92,211,190;
  --pack-art: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 260' fill='none' stroke='%2378aaff' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='44' y='31' width='172' height='198' rx='22'/%3E%3Cpath d='M90 31V18h80v13M76 88h18l8 9 18-23m28 14h38M76 136h18l8 9 18-23m28 14h38M76 184h18l8 9 18-23m28 14h38'/%3E%3C/svg%3E");
}

body[data-pack] .prompt-kicker,
body[data-pack] .eyebrow,
body[data-pack] .daily-rep-kicker,
body[data-pack] .studio-progress-label,
body[data-pack] .result-screen .rep-practice-label { color: var(--pack-accent); }
body[data-pack] .button.primary {
  background: var(--pack-action);
  color: var(--pack-action-ink);
  box-shadow: 0 12px 30px rgba(var(--pack-secondary-rgb),.16);
}
body[data-pack] .button.primary:hover { background: var(--pack-action); filter: brightness(1.07); }
body[data-pack] #openState {
  background:
    radial-gradient(circle at 8% 0%, rgba(var(--pack-secondary-rgb),.11), transparent 30rem),
    radial-gradient(circle at 92% 4%, rgba(var(--pack-accent-rgb),.10), transparent 28rem),
    linear-gradient(180deg,rgba(255,255,255,.045),rgba(255,255,255,.015)),
    rgba(12,16,19,.9);
}
body[data-pack] .studio-path-card {
  border-color: rgba(var(--pack-accent-rgb),.28);
  background:
    radial-gradient(circle at 90% 8%,rgba(var(--pack-accent-rgb),.15),transparent 17rem),
    radial-gradient(circle at 8% 100%,rgba(var(--pack-secondary-rgb),.07),transparent 18rem),
    linear-gradient(145deg,#1a211f 0%,#101513 72%);
}
body[data-pack="ai"] .studio-path-card { background-color: #171321; }
body[data-pack="work"] .studio-path-card { background-color: #111a25; }
body[data-pack] .studio-path-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  width: min(44%,310px);
  aspect-ratio: 1;
  right: -3%;
  bottom: -11%;
  background: var(--pack-art) center/contain no-repeat;
  opacity: .13;
  transform: rotate(-4deg);
  pointer-events: none;
}
body[data-pack="ai"] .studio-path-card::before { opacity: .16; transform: rotate(4deg); }
body[data-pack="work"] .studio-path-card::before { opacity: .14; transform: rotate(2deg); }
body[data-pack] .studio-path-card::after {
  border-color: rgba(var(--pack-accent-rgb),.16);
  box-shadow: 0 0 0 24px rgba(var(--pack-accent-rgb),.025),0 0 0 48px rgba(var(--pack-accent-rgb),.018);
}
body[data-pack] .studio-path-rail li.is-active .studio-path-marker {
  border-color: var(--pack-accent);
  background: var(--pack-accent);
  color: var(--pack-action-ink);
  box-shadow: 0 0 0 6px rgba(var(--pack-accent-rgb),.11),0 10px 22px rgba(0,0,0,.28);
}
body[data-pack] .studio-submit {
  border-color: rgba(var(--pack-accent-rgb),.42);
  background: rgba(var(--pack-accent-rgb),.13);
  color: var(--pack-accent);
}
body[data-pack] .shell-tab[aria-current="page"] { color: var(--pack-accent); }

/* Settings is a product surface, not a diagnostics hallway. */
#settingsModal {
  padding: clamp(10px,2.4vw,24px);
  background: rgba(4,7,8,.78);
  backdrop-filter: blur(18px);
}
.settings-panel {
  width: min(860px,100%);
  height: min(90dvh,820px);
  max-height: min(90dvh,820px);
  display: grid;
  grid-template-rows: auto minmax(0,1fr);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--pack-accent-rgb),.24);
  border-radius: 30px;
  background:
    radial-gradient(circle at 8% 0%,rgba(var(--pack-secondary-rgb),.13),transparent 25rem),
    radial-gradient(circle at 92% 0%,rgba(var(--pack-accent-rgb),.15),transparent 24rem),
    #0d1212;
}
.settings-header {
  align-items: center;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8,12,12,.72);
  backdrop-filter: blur(16px);
}
.settings-heading { min-width: 0; display: flex; align-items: center; gap: 13px; }
.settings-heading h2 { margin-top: 2px; font-size: 1.75rem; letter-spacing: -.045em; }
.settings-pack-copy { margin: 3px 0 0; color: var(--studio-muted); font-size: .82rem; line-height: 1.35; }
.settings-pack-mark {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(var(--pack-accent-rgb),.3);
  border-radius: 18px;
  background-color: rgba(var(--pack-accent-rgb),.10);
  background-image: var(--pack-art);
  background-position: center;
  background-size: 72%;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.settings-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 18px 24px;
}
.settings-core-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.settings-panel .settings-section { margin: 0; }
.settings-card {
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px;
  background: rgba(255,255,255,.045);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
}
.settings-card-heading { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.settings-card-heading h3 { margin: 1px 0 2px; color: var(--studio-cream); font-size: 1.04rem; }
.settings-card-heading p { margin: 0; color: var(--studio-muted); font-size: .78rem; line-height: 1.35; }
.settings-card-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex: 0 0 30px;
  border-radius: 10px;
  background: rgba(var(--pack-accent-rgb),.13);
  color: var(--pack-accent);
  font-size: .68rem;
  font-weight: 900;
}
.settings-card .field-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.settings-card .field { gap: 5px; color: #b8bdb8; font-size: .72rem; }
.settings-card .select { min-height: 42px; padding: 8px 10px; border-radius: 12px; }
.settings-field-wide { grid-column: 1 / -1; }
.settings-disclosure {
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 18px;
  background: rgba(255,255,255,.026);
  overflow: clip;
}
.settings-disclosure > summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}
.settings-disclosure > summary::-webkit-details-marker { display: none; }
.settings-disclosure > summary::after { content: "+"; color: var(--pack-accent); font-size: 1.35rem; font-weight: 500; }
.settings-disclosure[open] > summary::after { content: "−"; }
.settings-disclosure > summary span { display: grid; gap: 2px; }
.settings-disclosure > summary strong { color: var(--studio-cream); font-size: .92rem; }
.settings-disclosure > summary small { color: var(--studio-muted); font-size: .72rem; }
.settings-disclosure-body { padding: 0 14px 14px; border-top: 1px solid rgba(255,255,255,.06); }
.settings-disclosure-body > .muted-line:first-child { margin-top: 13px; }
.settings-actions { margin-top: 13px; }
.settings-library { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding-top: 14px; }
.settings-library .settings-section { padding: 12px; border: 1px solid rgba(255,255,255,.07); border-radius: 15px; }
.settings-library .saved-list,
.settings-library .history-list { max-height: 260px; overflow: auto; }
.settings-build-line { display: flex; justify-content: space-between; gap: 16px; margin: 14px 0 0; color: var(--studio-muted); font-size: .8rem; }
.settings-build-line strong { color: var(--studio-cream); }
.settings-panel .qa-tools-section { border-style: dashed; }

@media (max-width: 820px) {
  #settingsModal { padding: 0; }
  .settings-panel {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .settings-header { padding: max(10px,var(--safe-top)) 12px 10px; }
  .settings-heading { gap: 9px; }
  .settings-heading h2 { font-size: 1.35rem; }
  .settings-pack-copy { display: none; }
  .settings-pack-mark { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
  .settings-header #settingsBackToRepBtn { display: none; }
  .settings-body { padding: 11px 12px calc(16px + var(--safe-bottom)); }
  .settings-core-grid { grid-template-columns: 1fr; gap: 9px; }
  .settings-card { padding: 12px; border-radius: 18px; }
  .settings-card-heading { margin-bottom: 10px; }
  .settings-library { grid-template-columns: 1fr; }
}

@media (max-width: 390px) and (max-height: 720px) {
  .settings-card-heading p { display: none; }
  .settings-card .select { min-height: 39px; }
  .settings-disclosure > summary { min-height: 52px; }
}

/* ======================================================================
   NR-REACHABILITY V7.5.3: one screen must not mean hidden UI
   ====================================================================== */
@media (max-width: 820px) {
  .studio-spark-card { position: relative; padding-right: 76px; }
  .studio-spark-card .today-options {
    display: block;
    position: absolute;
    z-index: 4;
    top: 8px;
    right: 8px;
    margin: 0;
    border: 0;
    background: transparent;
  }
  .studio-spark-card .today-options > summary {
    min-height: 30px;
    display: grid;
    place-items: center;
    padding: 5px 9px;
    border: 1px solid rgba(var(--pack-accent-rgb),.26);
    border-radius: 10px;
    background: rgba(var(--pack-accent-rgb),.09);
    color: var(--pack-accent);
    font-size: .68rem;
    font-weight: 850;
    line-height: 1;
    list-style: none;
    cursor: pointer;
  }
  .studio-spark-card .today-options > summary::-webkit-details-marker { display: none; }
  .studio-spark-card .today-options[open] {
    position: fixed;
    z-index: 150;
    inset: max(10px,var(--safe-top)) 10px calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + var(--safe-bottom) + 12px);
    display: grid;
    grid-template-rows: auto auto minmax(0,1fr);
    align-content: start;
    gap: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    border: 1px solid rgba(var(--pack-accent-rgb),.28);
    border-radius: 22px;
    background:
      radial-gradient(circle at 90% 0,rgba(var(--pack-accent-rgb),.14),transparent 18rem),
      #101615;
    box-shadow: 0 24px 90px rgba(0,0,0,.72);
  }
  .studio-spark-card .today-options[open] > summary {
    min-height: 44px;
    justify-content: start;
    padding: 10px 12px;
    font-size: .86rem;
  }
  .studio-spark-card .today-options[open] > summary::after {
    content: "Close";
    margin-left: auto;
    color: var(--studio-muted);
    font-size: .72rem;
  }
  .studio-spark-card .today-options[open] .task-grid {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    gap: 8px;
  }
  .studio-spark-card .today-options[open] .chip-row {
    display: flex !important;
    align-content: start;
    overflow-y: auto;
  }
}

@media (max-width: 390px) and (max-height: 720px) {
  .studio-spark-card { padding-right: 68px; }
  .studio-spark-card .today-options { top: 6px; right: 6px; }
  .studio-spark-card .today-options > summary { padding-left: 7px; padding-right: 7px; font-size: .62rem; }
}

@media (orientation: portrait) and (max-width: 520px) and (max-height: 520px) {
  .studio-spark-card:has(#sparkInput:focus),
  .studio-spark-card:has(#shapeRepBtn:focus) {
    position: fixed;
    z-index: 140;
    left: 10px;
    right: 10px;
    top: max(10px,var(--safe-top));
    bottom: auto;
    grid-template-columns: minmax(0,1fr) 112px;
    padding: 10px 76px 10px 10px;
    border-color: rgba(var(--pack-accent-rgb),.36);
    background: #111715;
    box-shadow: 0 0 0 100vmax rgba(2,5,5,.76),0 24px 70px rgba(0,0,0,.56);
  }
  .studio-spark-card:has(#sparkInput:focus) .textarea,
  .studio-spark-card:has(#shapeRepBtn:focus) .textarea {
    min-height: 48px;
    max-height: min(22dvh,96px);
  }
}

/* Short landscape phones use the width they have instead of clipping vertically. */
@media (orientation: landscape) and (max-width: 950px) and (max-height: 520px) {
  :root { --bottom-nav-height: 52px; --bottom-nav-gap: 4px; }
  .app-shell {
    padding: 4px 8px calc(var(--bottom-nav-height) + var(--bottom-nav-gap) + var(--safe-bottom) + 8px) !important;
  }
  .topbar {
    flex-direction: row !important;
    justify-content: space-between !important;
    min-height: 42px !important;
    margin: 0 0 4px !important;
    padding: max(2px,var(--safe-top)) 0 4px !important;
    align-items: center !important;
    gap: 8px !important;
  }
  .brand { flex: 0 0 auto; }
  .top-actions { width: auto; flex: 0 0 auto; flex-wrap: nowrap; gap: 6px; }
  .brand-mark { display: none; }
  .brand h1 { font-size: .9rem; }
  .pack-picker { width: 126px; max-width: 126px; height: 36px; min-height: 36px; padding-top: 0; padding-bottom: 0; }
  .pack-picker .select { height: 34px; min-height: 0; }
  #settingsBtn { width: 36px; height: 36px; min-height: 36px; }
  .shell-tabbar {
    bottom: max(4px,var(--safe-bottom)) !important;
    min-height: var(--bottom-nav-height) !important;
    padding: 3px 5px;
  }
  .shell-tab { min-height: 42px; }
  .shell-tab-icon { width: 18px; height: 18px; }
  .shell-main { min-height: 0; }
  #openState {
    grid-template-columns: minmax(0,1.45fr) minmax(230px,.75fr);
    grid-template-rows: minmax(0,1fr);
    gap: 8px;
  }
  #openState .studio-today-header { display: none; }
  #openState .studio-path-card {
    grid-column: 1;
    height: 100%;
    min-height: 0;
    margin: 0 !important;
    align-content: space-between;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 18px;
  }
  #openState .studio-path-status { gap: 6px; }
  #openState .daily-rep-kicker,
  #openState .studio-progress-label { font-size: .6rem; }
  #openState .studio-path-card h3 { margin: 2px 0; font-size: clamp(1.05rem,4.2vh,1.35rem); }
  #openState .studio-path-card p,
  #openState .studio-path-actions span { display: none; }
  #openState .studio-path-rail li { gap: 2px; font-size: .54rem; }
  #openState .studio-path-marker { width: 24px; height: 24px; border-radius: 8px; font-size: .62rem; }
  #openState .studio-path-rail ol::before { top: 11px; }
  #openState .studio-path-primary { min-height: 36px; width: 100%; }
  #openState .studio-spark-card {
    grid-column: 2;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(52px,1fr) auto;
    align-content: stretch;
    padding: 9px 64px 9px 9px;
    border-radius: 16px;
  }
  #openState .studio-spark-card .input-label { display: block; grid-column: 1; }
  #openState .studio-spark-card .textarea {
    grid-column: 1;
    min-height: 52px;
    max-height: none;
    height: 100%;
  }
  #openState .studio-spark-actions { grid-column: 1; }
  #openState .studio-spark-actions .studio-submit { min-height: 36px; max-height: 36px; }
  #openState .studio-spark-card .today-options { top: 6px; right: 6px; }
}
