/* Speech Memorizer: photo hero, text panel + practice panel, explainer extras. */

.calc-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.ghost-btn {
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.ghost-btn:hover { background: rgba(59, 130, 246, 0.22); border-color: rgba(96, 165, 250, 0.6); }
.ghost-btn:disabled, .sm-send:disabled { opacity: 0.45; cursor: not-allowed; }
.sm-select {
  padding: 0.45rem 0.55rem;
  background: #0c1220;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 8px;
  color: #cbd5e1;
  font: inherit;
  font-size: 0.875rem;
  max-width: 100%;
}

/* ── Hero ── */
.sm-hero {
  position: relative;
  overflow: hidden;
  background: #05070a;
  border-bottom: 1px solid rgba(96, 165, 250, 0.1);
}
.sm-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 75% 35%;
}
.sm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 9, 18, 0.96) 0%, rgba(5, 9, 18, 0.82) 42%, rgba(5, 9, 18, 0.2) 75%, rgba(5, 9, 18, 0.05) 100%);
}
.sm-hero__copy {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) var(--page-pad-inline, 1.25rem);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.95rem;
}
.sm-hero__copy > * { max-width: 38rem; }
.sm-hero__title {
  margin: 0;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: clamp(2.1rem, 4.8vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #f8fafc;
}
.sm-hero__title span {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.5em;
  letter-spacing: -0.01em;
  color: var(--accent-bright, #60a5fa);
}
.sm-hero__lead { margin: 0; font-size: 1.05rem; line-height: 1.6; color: #cbd5e1; }
.sm-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.sm-chips li {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.sm-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem; }
.sm-hero__note { margin: 0; font-size: 0.875rem; color: #94a3b8; }

/* ── Tool ── */
.sm-tool {
  background: #05070a;
  padding: clamp(1.25rem, 3vw, 2rem) var(--page-pad-inline, 1.25rem) clamp(2rem, 5vw, 3.5rem);
  scroll-margin-top: 80px;
}
.sm-tool__grid {
  display: grid;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}
@media (min-width: 960px) {
  .sm-tool__grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: start; }
}
.sm-panel {
  min-width: 0;
  padding: 1.25rem;
  background: #111a2e;
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.sm-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.sm-panel__head .calc-label { margin: 0; }
.sm-count { font-size: 0.8125rem; font-weight: 600; color: #60a5fa; }
.sm-input {
  width: 100%;
  min-height: 260px;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: 0.975rem;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, color 0.2s, text-shadow 0.2s;
}
.sm-input:focus { outline: none; border-color: rgba(96, 165, 250, 0.45); }
.sm-input::placeholder { color: #475569; }
/* Cover: the original blurs while you practise and comes back as soon as you click into it. */
.is-covered .sm-input:not(:focus) { color: transparent; text-shadow: 0 0 9px rgba(203, 213, 225, 0.75); }
.sm-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.sm-cover { display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0.85rem; font-size: 0.875rem; color: #94a3b8; cursor: pointer; }
.sm-cover input { margin-top: 0.2rem; accent-color: #3b82f6; }
.sm-privacy { margin: 0.75rem 0 0; font-size: 0.8125rem; color: #64748b; }
.sm-send {
  display: block;
  width: 100%;
  margin-top: 1rem;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.75rem 1.25rem;
}

/* Mode tabs */
.sm-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin: 0 0 0.85rem;
  scrollbar-width: thin;
}
.sm-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  background: transparent;
  color: #94a3b8;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.sm-tab:hover { color: #e2e8f0; border-color: rgba(96, 165, 250, 0.45); }
.sm-tab.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }
.sm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  align-items: center;
  padding: 0.8rem 0.9rem;
  margin-bottom: 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(96, 165, 250, 0.1);
  font-size: 0.875rem;
  color: #cbd5e1;
}
.sm-options[hidden] { display: none; }
.sm-options label { display: inline-flex; align-items: center; gap: 0.45rem; }
.sm-options input[type="checkbox"] { accent-color: #3b82f6; }
.sm-options__tip { flex-basis: 100%; margin: 0; color: #94a3b8; font-size: 0.8125rem; }
.sm-range { display: inline-flex; align-items: center; gap: 0.6rem; flex: 1 1 220px; }
.sm-range input { flex: 1; accent-color: #3b82f6; }
.sm-range output { min-width: 7.5rem; font-weight: 600; color: #93c5fd; }
.sm-typebox {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem 0.9rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 10px;
  color: #f1f5f9;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
}
.sm-typebox:focus { outline: none; border-color: rgba(96, 165, 250, 0.5); }
.sm-typeresult { flex-basis: 100%; }
.sm-score { margin: 0; font-family: var(--font-display, "Sora", sans-serif); font-size: 1.6rem; font-weight: 700; color: #f8fafc; }
.sm-score__detail { margin: 0.2rem 0 0; color: #94a3b8; }

/* Practice stage */
.sm-stage {
  min-height: 300px;
  max-height: 560px;
  overflow-y: auto;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: #070b14;
  border: 1px solid rgba(96, 165, 250, 0.16);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.9;
  color: #e2e8f0;
}
.sm-line { margin: 0 0 0.35rem; overflow-wrap: anywhere; }
.sm-line.is-gap { min-height: 0.9rem; }
.sm-w { display: inline; }
button.sm-w {
  font: inherit;
  line-height: inherit;
  padding: 0 0.15rem;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.09);
  color: #bfdbfe;
  cursor: pointer;
}
button.sm-w:hover { background: rgba(59, 130, 246, 0.3); }
button.sm-w.is-letter { font-weight: 700; letter-spacing: 0.02em; }
button.sm-w.is-blank { color: #60a5fa; letter-spacing: 0.04em; }
button.sm-w.is-open { background: rgba(34, 197, 94, 0.16); color: #bbf7d0; font-weight: 500; letter-spacing: 0; }
.sm-empty { margin: 0; color: #64748b; font-size: 1rem; line-height: 1.6; }
.sm-empty p { margin: 0 0 0.85rem; }

.sm-lines .sm-line--done { color: #94a3b8; padding-left: 0.75rem; border-left: 3px solid transparent; }
.sm-lines .sm-line--done.is-latest { color: #f8fafc; border-left-color: #3b82f6; }
.sm-next {
  margin-top: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed rgba(96, 165, 250, 0.35);
  background: rgba(59, 130, 246, 0.06);
}
.sm-next__label { margin: 0; font-size: 0.875rem; color: #93c5fd; line-height: 1.5; }
.sm-next__hint { margin: 0.4rem 0 0; font-weight: 700; letter-spacing: 0.04em; color: #cbd5e1; }
.sm-next__btn { margin-top: 0.75rem; border: none; cursor: pointer; font-size: 0.875rem; padding: 0.6rem 1.1rem; }
.sm-done { margin: 0.75rem 0 0; color: #86efac; font-weight: 600; }

.sm-script { display: grid; gap: 0.6rem; }
.sm-speech { padding: 0.55rem 0.8rem; border-radius: 10px; border-left: 3px solid rgba(148, 163, 184, 0.25); }
.sm-speech.is-cue { border-left-color: #f59e0b; background: rgba(245, 158, 11, 0.07); }
.sm-speech.is-mine { border-left-color: #3b82f6; background: rgba(59, 130, 246, 0.08); }
.sm-speech.is-direction .sm-speech__text { font-style: italic; color: #64748b; }
.sm-speech__who { margin: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; color: #94a3b8; }
.sm-speech.is-mine .sm-speech__who { color: #93c5fd; }
.sm-speech.is-cue .sm-speech__who { color: #fbbf24; }
.sm-speech__text { margin: 0.1rem 0 0; white-space: pre-line; }
.sm-speech__hidden {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.7rem;
  text-align: start;
  font: inherit;
  line-height: 1.6;
  border: 1px dashed rgba(96, 165, 250, 0.45);
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  color: #93c5fd;
  cursor: pointer;
  white-space: pre-line;
}
.sm-speech__hidden.is-open { border-style: solid; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.08); color: #dcfce7; }

.sm-diff { margin: 0; line-height: 2; }
.sm-d { padding: 0.05rem 0.2rem; border-radius: 4px; }
.sm-d--ok { color: #e2e8f0; }
.sm-d--miss { color: #fecaca; background: rgba(239, 68, 68, 0.2); text-decoration: line-through; text-decoration-color: rgba(248, 113, 113, 0.7); }
.sm-d--extra { color: #fde68a; background: rgba(245, 158, 11, 0.18); }
.sm-legend { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.75rem; font-size: 0.8125rem; }

@media (max-width: 719px) {
  .sm-hero__img { position: relative; display: block; height: 190px; object-position: 80% 30%; }
  .sm-hero::after { inset: 0 0 auto 0; height: 190px; background: linear-gradient(180deg, rgba(5, 9, 18, 0) 40%, rgba(5, 9, 18, 1) 100%); }
  .sm-hero__copy { padding-top: 0.25rem; padding-bottom: 1.4rem; gap: 0.75rem; }
  .sm-hero__title { font-size: 2.1rem; }
  .sm-hero__lead { font-size: 0.95rem; line-height: 1.5; }
  .sm-chips li { font-size: 0.78rem; padding: 0.3rem 0.65rem; }
  .sm-panel { padding: 1rem; border-radius: 16px; }
  .sm-input { min-height: 170px; }
  .sm-stage { min-height: 240px; max-height: 460px; padding: 0.9rem; }
}

/* ── Explainer extras: the same sentence in each practice mode (real text, not an image) ── */
.sm-demo { margin: 0; display: grid; gap: 0.6rem; }
.sm-demo__row {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border-radius: 14px;
  background: #0f1a33;
  border: 1px solid rgba(96, 165, 250, 0.16);
}
.sm-demo__label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #94a3b8; }
.sm-demo__text { margin: 0; font-size: clamp(1.05rem, 2vw, 1.25rem); font-weight: 600; color: #f1f5f9; overflow-wrap: anywhere; }
.sm-demo__text b { color: #60a5fa; }
.sm-demo__text .gap { color: #60a5fa; letter-spacing: 0.04em; }
.sm-demo__text .cue { color: #fbbf24; }
@media (max-width: 480px) { .sm-demo__row { grid-template-columns: 1fr; gap: 0.25rem; } }

.sm-modes {
  display: grid;
  gap: 1rem;
  margin-top: clamp(2.5rem, 6vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
}
.sm-mode { padding: 1.35rem; border-radius: 16px; background: #0f1a33; border: 1px solid rgba(96, 165, 250, 0.14); }
.sm-mode h3 { margin: 0 0 0.6rem; font-family: var(--font-display, "Sora", sans-serif); font-size: 1.15rem; color: #f1f5f9; }
.sm-mode p { margin: 0; color: #94a3b8; line-height: 1.65; font-size: 0.95rem; }
.sm-mode strong { color: #e2e8f0; }
.tool-row a, .sm-mode a, .tool-siblings a { color: var(--accent-bright, #60a5fa); }
.tool-steps + p { margin-top: 0.9rem; }
.sm-plan { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.92rem; }
.sm-plan th, .sm-plan td { padding: 0.55rem 0.7rem; text-align: start; border-bottom: 1px solid rgba(96, 165, 250, 0.1); vertical-align: top; }
.sm-plan th { color: #93c5fd; font-weight: 600; font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; }
.sm-plan td { color: #cbd5e1; }
.sm-plan td:first-child { color: #f1f5f9; font-weight: 600; white-space: nowrap; }
.tool-explain .feature-row__copy, .tool-explain .feature-row__media { min-width: 0; }
@media (max-width: 560px) {
  .sm-plan { font-size: 0.85rem; }
  .sm-plan th, .sm-plan td { padding: 0.5rem 0.45rem; }
  .sm-plan td:first-child { white-space: normal; }
}

/* Share bar under the typing-check score, and a friend's shared score above the tool */
.sm-options .tp-share { flex-basis: 100%; margin-top: 0.25rem; }
.sm-tool > .tp-friend { max-width: 1200px; margin: 0 auto 1rem; }
