.tp { position: fixed; inset: 0; z-index: 99999; background: #000; color: #fff; overflow: hidden;
  font: 100%/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.tp * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.tp-cam, .tp-take { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tp-cam { transform: scaleX(-1); } /* preview only, the file is not mirrored */
.tp-cam.tp-back { transform: none; }
.tp-take { z-index: 3; object-fit: contain; }
.tp-btn { font: inherit; color: #fff; border: 0; cursor: pointer; background: rgba(20,20,20,0.62);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.14); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: transform 160ms cubic-bezier(0.25,1,0.5,1), background-color 200ms; }
.tp-btn:active { transform: scale(0.97); transition-duration: 80ms; }
.tp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.tp-bar { position: absolute; z-index: 2; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 8px) 12px 14px;
  background: linear-gradient(rgba(0,0,0,0.78), rgba(0,0,0,0.55) 80%, rgba(0,0,0,0)); }
.tp-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.tp-btn.tp-small { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 0.9375rem; font-weight: 600; }
.tp-right { display: flex; align-items: center; gap: 10px; }
.tp-auto[aria-pressed="true"] { background: #fff; color: #000; }
.tp-auto.tp-hear { box-shadow: 0 0 0 3px rgba(52,199,89,0.85); }
.tp-count { font-size: 0.8125rem; color: rgba(235,235,245,0.62); font-variant-numeric: tabular-nums; }
.tp-script { display: flex; align-items: stretch; gap: 6px; margin-top: 6px; touch-action: pan-y; }
.tp-arrow { flex: none; width: 40px; border-radius: 12px; background: transparent; box-shadow: none; font-size: 1.5rem; opacity: 0.8; }
.tp-arrow:disabled { opacity: 0.2; }
.tp-text { flex: 1; min-width: 0; max-height: 42vh; overflow-y: auto; padding: 4px 2px; }
.tp-film { font-size: 0.8125rem; color: rgba(235,235,245,0.62); margin-bottom: 4px; }
.tp-say { font-size: clamp(1.5rem, 6.5vw, 2.125rem); font-weight: 700; line-height: 1.22; letter-spacing: -0.01em; }
.tp-msg { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 150px; text-align: center; font-size: 0.9375rem; color: rgba(235,235,245,0.8); }
.tp-ctl { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 20px); gap: 28px; }
.tp-rec { width: 76px; height: 76px; border-radius: 50%; padding: 0; background: transparent; box-shadow: inset 0 0 0 4px #fff; position: relative; }
.tp-rec::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #ff3b30; transition: inset 200ms, border-radius 200ms; }
.tp-rec.tp-on::after { inset: 22px; border-radius: 8px; }
.tp-time { position: absolute; bottom: calc(env(safe-area-inset-bottom) + 108px); left: 0; right: 0; text-align: center; z-index: 2;
  font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.tp-flip { position: absolute; right: 20px; }
.tp-review { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; justify-content: center;
  padding: 16px 20px calc(env(safe-area-inset-bottom) + 20px); }
.tp-review .tp-btn { height: 52px; padding: 0 28px; border-radius: 26px; font-size: 1.0625rem; font-weight: 600; }
.tp-review .tp-go { background: #fff; color: #000; }
.tp-score { position: absolute; z-index: 4; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 96px); max-width: 420px; margin: 0 auto;
  padding: 14px 16px; border-radius: 18px; background: rgba(20,20,20,0.72); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.14); display: grid; gap: 4px; text-align: center; }
.tp-score b { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tp-score span { font-size: 0.8125rem; color: rgba(235,235,245,0.62); font-variant-numeric: tabular-nums; }
.tp-score p { font-size: 0.9375rem; margin-top: 4px; }
.tp [hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .tp-btn, .tp-rec::after { transition: none; } .tp-btn:active { transform: none; } }
/* AI feedback inside the score box: the box scrolls when the feedback is long. */
.tp-score { max-height: calc(100dvh - env(safe-area-inset-bottom) - 200px); overflow-y: auto; overscroll-behavior: contain; }
.tp-ai-btn { justify-self: center; margin-top: 8px; background: #fff; color: #000; }
.tp-ai-btn:disabled { opacity: 0.6; cursor: default; }
.tp-ai { text-align: left; display: grid; gap: 4px; }
.tp-ai:empty { display: none; }
.tp-ai h3 { font-size: 0.8125rem; font-weight: 700; color: rgba(235,235,245,0.62); margin-top: 10px; }
.tp-ai p, .tp-ai li { font-size: 0.9375rem; line-height: 1.4; margin: 0; }
.tp-ai ul, .tp-ai ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.tp-ai ul { list-style: none; padding-left: 0; }
.tp-ai ul i { font-style: normal; font-weight: 800; display: inline-block; width: 1.2em; }
.tp-ai ul span { color: rgba(235,235,245,0.72); font-size: 0.875rem; }
.tp-ai-done i { color: #34c759; } .tp-ai-short i { color: #ffcc00; } .tp-ai-missing i { color: #ff453a; }
.tp-ai .tp-ai-note { font-size: 0.8125rem; color: rgba(235,235,245,0.5); margin-top: 8px; }
