/* Practice UI release: trial clarity, login lockup, and stable mobile recording docks. */
/* Geometry ownership: the shared practice contract at the end of this file
   owns reflow and scroll boundaries. Earlier sections supply visual styling. */

.auth-story-copy h1.auth-brand-tagline {
  max-width: 470px;
  margin: 0 0 24px;
  color: var(--brand-canvas);
  font-family: "Iowan Old Style", Baskerville, Georgia, serif;
  font-size: clamp(2.25rem, 3.1vw, 2.65rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.auth-story-copy h1.auth-brand-tagline .auth-brand-tagline-line {
  display: block;
  color: var(--brand-canvas);
  white-space: nowrap;
}

.auth-story-copy h1.auth-brand-tagline em {
  color: var(--brand-teal);
  font-style: inherit;
}

.product-tour-transition-module.has-trial-limit .product-tour-transition-module-copy small {
  width: fit-content;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--brand-emerald) 24%, transparent);
  border-radius: 999px;
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand-panel-mint) 82%, var(--brand-canvas));
  font-size: clamp(0.64rem, 1vw, 0.74rem);
  line-height: 1.2;
}

.product-tour-trial-ready-support {
  grid-column: 1 / -1;
  display: grid;
}

.product-tour-trial-attempt-flow,
.product-tour-trial-ready-criteria {
  grid-area: 1 / 1;
}

.product-tour-trial-attempt-flow {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 0.82fr)) minmax(140px, 1.4fr);
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 420ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.product-tour-trial-attempt-flow span,
.product-tour-trial-attempt-flow strong {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--brand-emerald) 18%, transparent);
  border-radius: 10px;
  color: var(--brand-ink);
  background: color-mix(in srgb, var(--brand-canvas) 92%, transparent);
  font-size: clamp(0.65rem, 1vw, 0.78rem);
  font-weight: 850;
}

.product-tour-trial-attempt-flow strong {
  border-color: color-mix(in srgb, var(--brand-gold) 58%, transparent);
  background: color-mix(in srgb, var(--brand-gold-soft) 25%, var(--brand-canvas));
}

.product-tour-trial-attempt-flow i {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-canvas);
  background: var(--brand-emerald);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 950;
}

.product-tour-trial-attempt-flow strong i {
  color: var(--brand-ink);
  background: var(--brand-gold);
}

.product-tour-trial-ready-screen[data-phase="coach"] .product-tour-trial-attempt-flow {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 780px) {
  .auth-story-copy h1.auth-brand-tagline {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 9.5vw, 2.45rem);
  }

  .product-tour-trial-attempt-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .product-tour-trial-attempt-flow {
    transition: none;
  }
}

/* Single Word Practice mobile app dock refinement. */
@media (max-width: 780px) {
  .word-studio-shell {
    width: min(100%, 620px);
    height: auto;
    min-height: 100dvh;
    grid-template-rows: minmax(0, 1fr);
    overflow: visible;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 0;
  }

  .word-studio-shell .practice-focus-stage {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .word-studio-shell .app-header {
    min-height: 58px;
    flex: 0 0 auto;
    margin-bottom: 4px;
  }

  .word-studio-shell .app-header h1 {
    max-width: 100%;
    font-size: clamp(1.05rem, 4.5vw, 1.15rem);
    letter-spacing: -0.025em;
  }

  .word-studio-shell .minimal-word-studio {
    min-height: 0;
    display: flex;
    align-items: flex-start;
    flex: 1 1 auto;
    margin-inline: -14px;
    padding-inline: 14px;
    overflow: visible;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  .word-studio-shell .minimal-word-stage {
    min-height: 100%;
    flex: 1 0 100%;
    padding: 8px 16px 0;
  }

  .word-studio-shell .minimal-word-card.words-only {
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--brand-emerald) 14%, transparent);
    border-radius: 22px;
    background:
      linear-gradient(145deg, color-mix(in srgb, var(--brand-canvas) 96%, transparent), color-mix(in srgb, var(--brand-panel-mint) 64%, var(--brand-canvas)));
    box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-emerald) 9%, transparent);
  }

  .word-studio-shell .word-title-row.word-audio-layout {
    gap: 12px;
  }

  .word-studio-shell .word-studio-source {
    margin-bottom: 7px;
  }

  .word-studio-shell .word-audio-layout h2 {
    font-size: clamp(3.45rem, 16vw, 5.15rem);
    line-height: 0.92;
  }

  .word-studio-shell .word-title-actions.word-audio-controls {
    gap: 8px;
  }

  .word-studio-shell .word-audio-controls .word-cue-button,
  .word-studio-shell .word-audio-playback {
    min-height: 52px;
    border-radius: 15px;
  }

  .word-studio-shell .word-mobile-practice-summary {
    margin-top: 10px;
  }

  .word-studio-shell .word-practice-summary {
    border-radius: 16px;
    background: color-mix(in srgb, var(--brand-panel-mint) 86%, var(--brand-canvas));
  }

  .word-studio-shell .word-practice-summary summary {
    min-height: 50px;
    padding-inline: 14px;
  }

  .word-studio-shell .word-practice-summary summary strong {
    font-size: 0.82rem;
  }

  .word-studio-shell .word-practice-summary summary small {
    font-size: 0.73rem;
  }

  .word-studio-shell .batch-panel {
    margin-top: 10px;
  }

  .word-studio-shell .word-nav-row {
    gap: 10px;
    margin-top: 10px;
  }

  .word-studio-shell .word-nav-row button {
    min-height: 50px;
    position: relative;
    border-radius: 15px;
    font-weight: 850;
  }

  .word-studio-shell .word-nav-row button:first-child {
    padding-left: 34px;
  }

  .word-studio-shell .word-nav-row button:first-child::before,
  .word-studio-shell .word-nav-row button:last-child::after {
    width: 18px;
    height: 18px;
    position: absolute;
    top: 50%;
    content: "";
    background: currentColor;
    transform: translateY(-50%);
    -webkit-mask: url("assets/icons/phosphor/arrow-left.svg") center / contain no-repeat;
    mask: url("assets/icons/phosphor/arrow-left.svg") center / contain no-repeat;
  }

  .word-studio-shell .word-nav-row button:first-child::before {
    left: 20px;
  }

  .word-studio-shell .word-nav-row button:last-child {
    padding-right: 34px;
  }

  .word-studio-shell .word-nav-row button:last-child::after {
    right: 20px;
    transform: translateY(-50%) rotate(180deg);
  }

  .word-studio-shell .practice-gate-note {
    min-height: 18px;
    margin: 6px 4px 8px;
    font-size: 0.74rem;
    line-height: 1.3;
  }

  .word-studio-shell .minimal-word-stage > .guided-record-card,
  .word-studio-shell .minimal-word-stage > .guided-record-card.countdown,
  .word-studio-shell .minimal-word-stage > .guided-record-card.recording,
  .word-studio-shell .minimal-word-stage > .guided-record-card.listening,
  .word-studio-shell .minimal-word-stage > .guided-record-card.checking {
    width: auto;
    height: clamp(132px, 16dvh, 148px);
    min-height: 132px;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 84px;
    grid-template-rows: minmax(48px, 1fr) 42px;
    align-content: center;
    align-items: center;
    justify-items: stretch;
    gap: 6px 16px;
    position: sticky;
    bottom: 0;
    z-index: 90;
    margin: auto -16px 0;
    padding: 13px 18px calc(11px + env(safe-area-inset-bottom, 0px));
    border: 1px solid color-mix(in srgb, var(--brand-emerald) 20%, transparent);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--brand-panel-mint) 96%, transparent);
    box-shadow: 0 -14px 34px color-mix(in srgb, var(--brand-emerald) 12%, transparent);
    overflow: hidden;
  }

  .word-studio-shell .word-mobile-record-heading {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-items: start;
    gap: 8px;
  }

  .word-studio-shell .word-mobile-record-heading strong {
    max-width: 100%;
    font-size: clamp(1.05rem, 4.1vw, 1.25rem);
    line-height: 1.14;
    text-align: left;
  }

  .word-studio-shell .word-attempt-dots {
    gap: 8px;
  }

  .word-studio-shell .word-attempt-dots span {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }

  .word-studio-shell .minimal-word-stage > .guided-record-card .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.countdown .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.recording .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.listening .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.checking .word-studio-mic {
    width: 80px;
    height: 80px;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    margin: 0;
  }

  .word-studio-shell .guided-record-card .listening-meter,
  .word-studio-shell .guided-record-card.countdown .listening-meter,
  .word-studio-shell .guided-record-card.recording .listening-meter,
  .word-studio-shell .guided-record-card.listening .listening-meter,
  .word-studio-shell .guided-record-card.checking .listening-meter {
    width: 100%;
    min-height: 38px;
    grid-column: 1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid color-mix(in srgb, var(--brand-emerald) 28%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-canvas) 92%, transparent);
    aspect-ratio: auto;
  }

  .word-studio-shell .guided-record-card .listening-meter span,
  .word-studio-shell .guided-record-card .listening-meter small {
    color: var(--brand-ink-soft);
    font-size: 0.69rem;
  }

  .word-studio-shell .guided-record-card .listening-meter strong {
    color: var(--brand-ink);
    font-size: 0.95rem;
  }
}

@media (max-width: 360px) {
  .word-studio-shell {
    padding-inline: 8px;
  }

  .word-studio-shell .minimal-word-studio {
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .word-studio-shell .minimal-word-stage {
    padding-inline: 12px;
  }

  .word-studio-shell .app-header h1 {
    max-width: 130px;
    font-size: 0.94rem;
    line-height: 0.98;
    white-space: normal;
  }

  .word-studio-shell .minimal-word-card.words-only {
    padding: 13px;
    border-radius: 19px;
  }

  .word-studio-shell .word-audio-layout h2 {
    font-size: clamp(3rem, 17vw, 4rem);
  }

  .word-studio-shell .word-nav-row button:first-child::before {
    left: 14px;
  }

  .word-studio-shell .word-nav-row button:last-child::after {
    right: 14px;
  }

  .word-studio-shell .minimal-word-stage > .guided-record-card,
  .word-studio-shell .minimal-word-stage > .guided-record-card.countdown,
  .word-studio-shell .minimal-word-stage > .guided-record-card.recording,
  .word-studio-shell .minimal-word-stage > .guided-record-card.listening,
  .word-studio-shell .minimal-word-stage > .guided-record-card.checking {
    height: 112px;
    min-height: 112px;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 5px 11px;
    margin-inline: -12px;
    padding: 9px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 21px 21px 0 0;
  }

  .word-studio-shell .minimal-word-stage > .guided-record-card .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.countdown .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.recording .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.listening .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.checking .word-studio-mic {
    width: 68px;
    height: 68px;
  }
}

@media (max-width: 780px) and (max-height: 650px) {
  .word-studio-shell .minimal-word-card.words-only {
    padding-block: 10px;
  }

  .word-studio-shell .word-title-row.word-audio-layout {
    gap: 8px;
  }

  .word-studio-shell .word-audio-controls .word-cue-button,
  .word-studio-shell .word-audio-playback {
    min-height: 48px;
  }

  .word-studio-shell .word-mobile-practice-summary,
  .word-studio-shell .word-nav-row {
    margin-top: 8px;
  }

  .word-studio-shell .word-practice-summary summary,
  .word-studio-shell .word-nav-row button {
    min-height: 46px;
  }

  .word-studio-shell .practice-gate-note {
    margin-block: 4px 6px;
    font-size: 0.68rem;
  }

  .word-studio-shell .minimal-word-stage > .guided-record-card,
  .word-studio-shell .minimal-word-stage > .guided-record-card.countdown,
  .word-studio-shell .minimal-word-stage > .guided-record-card.recording,
  .word-studio-shell .minimal-word-stage > .guided-record-card.listening,
  .word-studio-shell .minimal-word-stage > .guided-record-card.checking {
    height: 112px;
    min-height: 112px;
    position: relative;
    bottom: auto;
    z-index: 1;
    padding-top: 10px;
  }

  .word-studio-shell .minimal-word-stage > .guided-record-card .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.countdown .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.recording .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.listening .word-studio-mic,
  .word-studio-shell .minimal-word-stage > .guided-record-card.checking .word-studio-mic {
    width: 68px;
    height: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .word-studio-shell .minimal-word-studio {
    scroll-behavior: auto;
  }
}


/* Everyday Sentence Practice compact mobile dock refinement. */
@media (max-width: 780px) {
  .sentence-talk-shell {
    width: min(100%, 620px);
    height: auto;
    min-height: 100dvh;
    grid-template-rows: minmax(0, 1fr);
    overflow: visible;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 0;
  }

  .sentence-talk-shell .practice-focus-stage {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .sentence-talk-shell .app-header {
    min-height: 58px;
    flex: 0 0 auto;
    margin-bottom: 4px;
  }

  .sentence-talk-shell .sentence-talk-studio {
    min-height: 0;
    display: flex;
    align-items: flex-start;
    flex: 1 1 auto;
    margin-inline: -14px;
    padding-inline: 14px;
    overflow: visible;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }

  .sentence-talk-shell .sentence-talk-stage {
    min-height: 100%;
    flex: 1 0 100%;
    padding: 8px 16px 0;
  }

  .sentence-talk-shell .sentence-card {
    gap: 12px;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--brand-emerald) 14%, transparent);
    border-radius: 22px;
    background:
      linear-gradient(145deg, color-mix(in srgb, var(--brand-canvas) 96%, transparent), color-mix(in srgb, var(--brand-panel-mint) 64%, var(--brand-canvas)));
    box-shadow: 0 14px 34px color-mix(in srgb, var(--brand-emerald) 9%, transparent);
  }

  .sentence-talk-shell .sentence-title-row h2 {
    font-size: clamp(2.25rem, 10.4vw, 3.45rem);
    line-height: 0.98;
  }

  .sentence-talk-shell .sentence-word-row {
    gap: 8px;
  }

  .sentence-talk-shell .sentence-word-row button {
    min-height: 72px;
    border-radius: 15px;
  }

  .sentence-talk-shell .word-title-actions {
    gap: 8px;
  }

  .sentence-talk-shell .hear-button,
  .sentence-talk-shell .breakdown-button {
    min-height: 52px;
    border-radius: 15px;
  }

  .sentence-talk-shell .sentence-mobile-practice-summary {
    margin-top: 10px;
  }

  .sentence-talk-shell .sentence-practice-summary {
    border-radius: 16px;
    background: color-mix(in srgb, var(--brand-panel-mint) 86%, var(--brand-canvas));
  }

  .sentence-talk-shell .sentence-practice-summary summary {
    min-height: 50px;
    padding-inline: 14px;
  }

  .sentence-talk-shell .sentence-practice-summary summary strong {
    font-size: 0.82rem;
  }

  .sentence-talk-shell .sentence-practice-summary summary small {
    font-size: 0.73rem;
  }

  .sentence-talk-shell .batch-panel {
    margin-top: 10px;
  }

  .sentence-talk-shell .word-nav-row {
    gap: 10px;
    margin-top: 10px;
  }

  .sentence-talk-shell .word-nav-row button {
    min-height: 50px;
    position: relative;
    border-radius: 15px;
    font-weight: 850;
  }

  .sentence-talk-shell .word-nav-row button:first-child {
    padding-left: 34px;
  }

  .sentence-talk-shell .word-nav-row button:first-child::before,
  .sentence-talk-shell .word-nav-row button:last-child::after {
    width: 18px;
    height: 18px;
    position: absolute;
    top: 50%;
    content: "";
    background: currentColor;
    transform: translateY(-50%);
    -webkit-mask: url("assets/icons/phosphor/arrow-left.svg") center / contain no-repeat;
    mask: url("assets/icons/phosphor/arrow-left.svg") center / contain no-repeat;
  }

  .sentence-talk-shell .word-nav-row button:first-child::before {
    left: 20px;
  }

  .sentence-talk-shell .word-nav-row button:last-child {
    padding-right: 34px;
  }

  .sentence-talk-shell .word-nav-row button:last-child::after {
    right: 20px;
    transform: translateY(-50%) rotate(180deg);
  }

  .sentence-talk-shell .practice-gate-note {
    min-height: 18px;
    margin: 6px 4px 8px;
    font-size: 0.74rem;
    line-height: 1.3;
  }

  .sentence-talk-shell .sentence-talk-stage > .guided-record-card,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.countdown,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.recording,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.listening,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.checking {
    width: auto;
    height: clamp(132px, 16dvh, 148px);
    min-height: 132px;
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr) 84px;
    grid-template-rows: minmax(48px, 1fr) 42px;
    align-content: center;
    align-items: center;
    justify-items: stretch;
    gap: 6px 16px;
    position: sticky;
    bottom: 0;
    z-index: 90;
    margin: auto -16px 0;
    padding: 13px 18px calc(11px + env(safe-area-inset-bottom, 0px));
    border: 1px solid color-mix(in srgb, var(--brand-emerald) 20%, transparent);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background: color-mix(in srgb, var(--brand-panel-mint) 96%, transparent);
    box-shadow: 0 -14px 34px color-mix(in srgb, var(--brand-emerald) 12%, transparent);
    overflow: hidden;
  }

  .sentence-talk-shell .sentence-mobile-record-heading {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    justify-items: start;
    gap: 8px;
  }

  .sentence-talk-shell .sentence-mobile-record-heading strong {
    max-width: 100%;
    font-size: clamp(1.05rem, 4.1vw, 1.25rem);
    line-height: 1.14;
    text-align: left;
  }

  .sentence-talk-shell .sentence-attempt-dots {
    gap: 8px;
  }

  .sentence-talk-shell .sentence-attempt-dots span {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }

  .sentence-talk-shell .sentence-talk-stage > .guided-record-card .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.countdown .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.recording .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.listening .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.checking .word-studio-mic {
    width: 80px;
    height: 80px;
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: center;
    justify-self: end;
    margin: 0;
  }

  .sentence-talk-shell .guided-record-card .listening-meter,
  .sentence-talk-shell .guided-record-card.countdown .listening-meter,
  .sentence-talk-shell .guided-record-card.recording .listening-meter,
  .sentence-talk-shell .guided-record-card.listening .listening-meter,
  .sentence-talk-shell .guided-record-card.checking .listening-meter,
  .sentence-talk-shell .guided-record-card .sentence-done-button {
    width: 100%;
    min-height: 44px;
    grid-column: 1;
    grid-row: 2;
    border-radius: 999px;
  }

  .sentence-talk-shell .guided-record-card .listening-meter {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    padding: 6px 11px;
    border: 1px solid color-mix(in srgb, var(--brand-emerald) 28%, transparent);
    background: color-mix(in srgb, var(--brand-canvas) 92%, transparent);
    aspect-ratio: auto;
  }
}

@media (max-width: 360px) {
  .sentence-talk-shell {
    padding-inline: 8px;
  }

  .sentence-talk-shell .sentence-talk-studio {
    margin-inline: -8px;
    padding-inline: 8px;
  }

  .sentence-talk-shell .sentence-talk-stage {
    padding-inline: 12px;
  }

  .sentence-talk-shell .sentence-card {
    gap: 8px;
    padding: 12px;
    border-radius: 19px;
  }

  .sentence-talk-shell .sentence-title-row h2 {
    font-size: clamp(2rem, 11.4vw, 2.5rem);
  }

  .sentence-talk-shell .sentence-word-row button {
    min-height: 60px;
    padding-block: 7px;
    font-size: 0.9rem;
  }

  .sentence-talk-shell .hear-button,
  .sentence-talk-shell .breakdown-button {
    min-height: 48px;
    font-size: 0.84rem;
  }

  .sentence-talk-shell .word-nav-row button:first-child::before {
    left: 14px;
  }

  .sentence-talk-shell .word-nav-row button:last-child::after {
    right: 14px;
  }

  .sentence-talk-shell .sentence-talk-stage > .guided-record-card,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.countdown,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.recording,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.listening,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.checking {
    height: 112px;
    min-height: 112px;
    grid-template-columns: minmax(0, 1fr) 72px;
    gap: 5px 11px;
    margin-inline: -12px;
    padding: 9px 14px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 21px 21px 0 0;
  }

  .sentence-talk-shell .sentence-talk-stage > .guided-record-card .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.countdown .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.recording .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.listening .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.checking .word-studio-mic {
    width: 68px;
    height: 68px;
  }
}

@media (max-width: 780px) and (max-height: 650px) {
  .sentence-talk-shell .sentence-card {
    gap: 8px;
    padding-block: 10px;
  }

  .sentence-talk-shell .sentence-title-row h2 {
    font-size: clamp(2rem, 10.8vw, 2.5rem);
  }

  .sentence-talk-shell .sentence-word-row button {
    min-height: 58px;
  }

  .sentence-talk-shell .sentence-mobile-practice-summary,
  .sentence-talk-shell .word-nav-row {
    margin-top: 8px;
  }

  .sentence-talk-shell .sentence-practice-summary summary,
  .sentence-talk-shell .word-nav-row button {
    min-height: 46px;
  }

  .sentence-talk-shell .practice-gate-note {
    margin-block: 4px 6px;
    font-size: 0.68rem;
  }

  .sentence-talk-shell .sentence-talk-stage > .guided-record-card,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.countdown,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.recording,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.listening,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.checking {
    height: 112px;
    min-height: 112px;
    position: relative;
    bottom: auto;
    z-index: 1;
    padding-top: 10px;
  }

  .sentence-talk-shell .sentence-talk-stage > .guided-record-card .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.countdown .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.recording .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.listening .word-studio-mic,
  .sentence-talk-shell .sentence-talk-stage > .guided-record-card.checking .word-studio-mic {
    width: 68px;
    height: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sentence-talk-shell .sentence-talk-studio {
    scroll-behavior: auto;
  }
}

/* SHARED PRACTICE LAYOUT CONTRACT
   Content owns height; the document owns scrolling. No JS resize/UA heuristics.
   Keep prompt, controls and feedback in separate intrinsic layout tracks.
   Tests: layout-qa/practice.spec.mjs. Rationale: PRACTICE_LAYOUT_CONTRACT.md. */
:is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card,
:is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card *,
:is(.word-studio-shell, .sentence-talk-shell) .batch-panel,
:is(.word-studio-shell, .sentence-talk-shell) .batch-panel > *,
:is(.word-studio-shell, .sentence-talk-shell) .guided-record-card > * {
  min-width: 0;
}

:is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card h2 {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.08;
}

.sentence-talk-shell .sentence-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sentence-talk-shell .sentence-title-row { display: contents; }
.sentence-talk-shell .sentence-title-row > div:first-child { order: 1; }
.sentence-talk-shell .sentence-word-row {
  order: 2;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7rem), 1fr));
}
.sentence-talk-shell .word-title-actions {
  order: 3;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.sentence-talk-shell .sentence-title-row h2 { font-size: clamp(2rem, 6vw, 4rem); }

:is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card button,
:is(.word-studio-shell, .sentence-talk-shell) .batch-actions button,
:is(.word-studio-shell, .sentence-talk-shell) .word-nav-row button {
  min-width: 0;
  min-height: 44px;
  height: auto;
  white-space: normal;
  overflow-wrap: anywhere;
}
.sentence-talk-shell .sentence-word-row button > span:last-child { overflow-wrap: anywhere; }
:is(.word-studio-shell, .sentence-talk-shell) .batch-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 10px;
}
:is(.word-studio-shell, .sentence-talk-shell) .batch-actions button {
  width: 100%;
  max-width: none;
}
:is(.word-studio-shell, .sentence-talk-shell) .attempt-row {
  grid-template-columns: minmax(0, 1fr);
}
/* A component-width enhancement, not a device guess. Unsupported browsers keep
   the safe single column. Three cards appear only when all three fit. */
@supports (container-type: inline-size) {
  :is(.word-studio-shell, .sentence-talk-shell) .batch-panel { container-type: inline-size; }
  @container (min-width: 40rem) {
    :is(.word-studio-shell, .sentence-talk-shell) .attempt-row {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
}
:is(.word-studio-shell, .sentence-talk-shell) .attempt-score-line {
  grid-template-columns: minmax(68px, 1fr) auto minmax(32px, 1fr);
  gap: 8px;
}
:is(.word-studio-shell, .sentence-talk-shell) .attempt-replay-button {
  position: static;
  transform: none;
  grid-column: 1;
  justify-self: start;
}
:is(.word-studio-shell, .sentence-talk-shell) .attempt-score-line > strong { grid-column: 2; }
:is(.word-studio-shell, .sentence-talk-shell) .attempt-perfect-smile {
  position: static;
  transform: none;
  grid-column: 3;
  justify-self: end;
}
:is(.word-studio-shell, .sentence-talk-shell) .attempt-pill small {
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  text-align: center;
}
:is(.word-studio-shell, .sentence-talk-shell) .attempt-pill.perfect-score small { color: var(--brand-canvas); }
:is(.word-studio-shell, .sentence-talk-shell) .feedback-playback-status > div { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 1180px) {
  :is(.word-studio-shell, .sentence-talk-shell) {
    width: min(100%, 780px);
    min-height: 100dvh;
    height: auto;
    overflow: visible;
    padding: calc(8px + env(safe-area-inset-top, 0px)) clamp(8px, 2vw, 22px) calc(20px + env(safe-area-inset-bottom, 0px));
  }
  :is(.word-studio-shell, .sentence-talk-shell) .practice-focus-stage,
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-studio {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    margin-inline: 0;
    padding-inline: 0;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 12px;
    padding: 12px 0;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card { order: 1; }
  :is(.word-studio-shell, .sentence-talk-shell) .batch-panel { order: 3; }
  :is(.word-studio-shell, .sentence-talk-shell) .word-nav-row { order: 4; }
  :is(.word-studio-shell, .sentence-talk-shell) .practice-gate-note { order: 5; }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-stage > .guided-record-card,
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-stage > .guided-record-card:is(.countdown, .recording, .listening, .checking) {
    order: 6;
    position: relative;
    inset: auto;
    height: auto;
    min-height: 148px;
    margin: 0;
    padding: 16px;
    overflow: visible;
    grid-template-rows: auto auto;
    grid-template-columns: minmax(0, 1fr) 84px;
    border-radius: 22px;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .guided-record-card strong { overflow-wrap: anywhere; }
  :is(.word-studio-shell, .sentence-talk-shell) .app-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0;
    min-height: 60px;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .app-header > div:first-child {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    max-width: none;
    min-width: 0;
    text-align: center;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .app-header h1 {
    max-width: none;
    font-size: 1.05rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .header-actions { display: contents; }
  :is(.word-studio-shell, .sentence-talk-shell) .header-actions > * {
    position: relative;
    inset: auto;
    grid-column: 3;
    grid-row: 1;
    min-height: 44px;
    pointer-events: auto;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .header-actions .home-btn { grid-column: 1; }
}

/* PHONE PRACTICE DOCK: scoped exception to the document-flow tablet contract.
   Only the measured dock is fixed. Its real height is reserved below all content.
   Long text stays scrollable; there is no fixed-height/hidden page shell. */
@media (max-width: 600px), (max-width: 950px) and (max-height: 500px) and (pointer: coarse) {
  :is(.word-studio-shell, .sentence-talk-shell) {
    padding: calc(4px + env(safe-area-inset-top, 0px)) 8px 12px;
  }
  :is(.word-studio-shell, .sentence-talk-shell).phone-dock-enabled {
    padding-bottom: calc(var(--practice-phone-dock-height, 144px) + 12px);
    scroll-padding-bottom: calc(var(--practice-phone-dock-height, 144px) + 12px);
  }
  :is(.word-studio-shell, .sentence-talk-shell) .app-header {
    min-height: 48px;
    margin: 0;
    gap: 6px;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .app-header h1 { font-size: 1rem; line-height: 1.15; }
  :is(.word-studio-shell, .sentence-talk-shell) .header-actions > button { padding: 8px 10px; }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-stage { padding: 6px 0; gap: 8px; }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card { padding: 12px; border-radius: 18px; gap: 8px; }
  .word-studio-shell .minimal-word-card.words-only { padding: 12px; }
  .word-studio-shell .word-title-row.word-audio-layout { gap: 8px; }
  .word-studio-shell .word-audio-layout h2 { font-size: clamp(2.5rem, 12vw, 3.25rem); line-height: 1.08; }
  .sentence-talk-shell .sentence-title-row h2 { font-size: clamp(1.75rem, 7vw, 2.25rem); }
  :is(.word-studio-shell, .sentence-talk-shell) :is(.word-studio-source, .sentence-source) { margin: 0 0 4px; font-size: .75rem; }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-card button { padding: 8px; min-height: 44px; font-size: .94rem; line-height: 1.2; }
  .word-studio-shell .word-audio-controls .word-cue-button { min-height: 44px; }
  .sentence-talk-shell .sentence-word-row { gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 5rem), 1fr)); }
  .sentence-talk-shell .sentence-word-row button { display: flex; justify-content: center; gap: 5px; }
  .sentence-talk-shell .sentence-audio-icon { width: 18px; height: 18px; flex: 0 0 18px; }
  :is(.word-studio-shell, .sentence-talk-shell) :is(.word-mobile-practice-summary, .sentence-mobile-practice-summary, .batch-panel, .word-nav-row) { margin-top: 0; }
  :is(.word-studio-shell, .sentence-talk-shell) summary { min-height: 44px; padding: 8px 10px; }
  :is(.word-studio-shell, .sentence-talk-shell) :is(.minimal-word-stage, .batch-panel) {
    container-type: normal;
    /* Backdrop filters establish a containing block for fixed descendants. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-pill { padding: 6px; min-height: 64px; gap: 4px; }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-pill > span { width: 24px; height: 24px; font-size: .85rem; }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-score-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; min-height: 24px; }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-score-line > strong { width: 100%; order: 0; font-size: 1rem; text-align: center; }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-pill .attempt-replay-button { position: static !important; transform: none !important; order: 1; min-width: 44px; min-height: 44px; padding: 6px; margin: 0; }
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-perfect-smile { order: 2; width: 22px; height: 22px; }
  /* The shared desktop SVG is 24px: keep it inside the smaller phone badge. */
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-perfect-smile svg {
    width: 18px;
    height: 18px;
    max-width: 100%;
    max-height: 100%;
  }
  /* This explanatory caption is repeated once per attempt on larger screens.
     On phones keep one readable shared label rather than three narrow repeats. */
  :is(.word-studio-shell, .sentence-talk-shell) .attempt-pill small { display: none; }
  .word-studio-shell .attempt-row:has(.attempt-pill small)::after {
    content: 'Scores show how close the word sounded';
    grid-column: 1 / -1;
    color: var(--brand-ink-soft);
    font-size: .75rem;
    text-align: center;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .word-nav-row { gap: 8px; }
  :is(.word-studio-shell, .sentence-talk-shell) .word-nav-row button { min-height: 44px; padding-block: 8px; }
  :is(.word-studio-shell, .sentence-talk-shell) .practice-gate-note { margin: 0 4px; font-size: .8rem; }
  :is(.word-studio-shell, .sentence-talk-shell) .feedback-playback-status { padding: 8px; margin-top: 8px; }
  :is(.word-studio-shell, .sentence-talk-shell) .phone-dock-placeholder { display: none; }
  :is(.word-studio-shell, .sentence-talk-shell).phone-feedback-dock .guided-record-card { display: none; }
  :is(.word-studio-shell, .sentence-talk-shell) [data-phone-dock] {
    position: fixed !important;
    inset: auto 0 0 !important;
    width: auto !important;
    height: auto !important;
    max-height: 55dvh;
    min-height: 0 !important;
    z-index: 90;
    margin: 0 !important;
    padding: 12px max(12px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)) !important;
    border: 1px solid var(--brand-aqua);
    border-radius: 20px 20px 0 0 !important;
    background: var(--brand-panel-mint);
    box-shadow: 0 -6px 20px color-mix(in srgb, var(--brand-ink) 10%, transparent);
    overflow: auto !important;
    overscroll-behavior: contain;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .guided-record-card[data-phone-dock] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    grid-template-rows: minmax(40px, auto) minmax(28px, auto);
    gap: 4px 12px;
  }
  :is(.word-studio-shell, .sentence-talk-shell) [data-phone-dock] :is(.word-mobile-record-heading, .sentence-mobile-record-heading) { grid-area: 1 / 1; align-self: center; gap: 5px; }
  :is(.word-studio-shell, .sentence-talk-shell) [data-phone-dock] :is(.word-mobile-record-heading, .sentence-mobile-record-heading) strong { font-size: 1rem; line-height: 1.2; }
  :is(.word-studio-shell, .sentence-talk-shell) .minimal-word-stage > .guided-record-card[data-phone-dock] .word-studio-mic {
    grid-area: 1 / 2 / 3 / 3;
    width: 64px; height: 64px;
    margin: 4px; transform: none;
    animation: none;
  }
  :is(.word-studio-shell, .sentence-talk-shell) .guided-record-card[data-phone-dock] .listening-meter { grid-area: 2 / 1; min-height: 28px; padding: 3px 8px; }
  .sentence-talk-shell .guided-record-card[data-phone-dock]:has(.sentence-done-button) { grid-template-columns: minmax(0, 1fr) 90px; }
  .sentence-talk-shell .guided-record-card[data-phone-dock]:has(.sentence-done-button) .word-studio-mic { display: none; }
  .sentence-talk-shell .guided-record-card[data-phone-dock] .sentence-done-button { grid-area: 1 / 2 / 3 / 3; min-height: 64px; width: 90px; white-space: normal; padding: 8px; }
  :is(.word-studio-shell, .sentence-talk-shell) .batch-actions[data-phone-dock] { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :is(.word-studio-shell, .sentence-talk-shell) .batch-actions[data-phone-dock] button { font-size: .94rem; padding: 10px; }
  :is(.word-studio-shell, .sentence-talk-shell) .guided-record-card.error[data-phone-dock] :is(.word-record-desktop-copy, .sentence-record-desktop-copy) { display: block; grid-column: 1 / -1; grid-row: 3; position: relative; z-index: 1; }
  :is(.word-studio-shell, .sentence-talk-shell) .guided-record-card.error[data-phone-dock] :is(.word-record-desktop-copy, .sentence-record-desktop-copy) strong { display: none; }
  :is(.word-studio-shell, .sentence-talk-shell) .guided-record-card.error[data-phone-dock] p { margin: 0; font-size: .9rem; line-height: 1.3; color: var(--brand-ink); opacity: 1; }
}

/* Actual recording exposes both the meter and I'm Done. Keep separate tracks
   on tablets too; the previous fixture incorrectly used a non-runtime phase. */
@media (min-width: 601px) and (max-width: 1180px) {
  .sentence-talk-shell .guided-record-card .sentence-done-button { grid-column: 1 / -1; grid-row: 3; }
}
