.tp-page {
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    background: var(--bg);
    color: var(--text);
}
.tp-page .radio-dock,
.tp-page .footer {
    display: none;
}
html:fullscreen,
html:-webkit-full-screen {
    height: 100%;
    background: #0B0E14;
}
html:fullscreen .tp-page .site-header,
html:-webkit-full-screen .tp-page .site-header,
.tp-page.tp-fill .site-header {
    display: none;
}
html:fullscreen .tp-page,
html:-webkit-full-screen .tp-page,
.tp-page.tp-fill {
    height: 100%;
    background: #0B0E14;
}
.tp-page.tp-fill {
    position: fixed;
    inset: 0;
    z-index: 70;
    width: 100%;
    height: 100dvh;
}
.tp-page .site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-radius: 0;
    background: rgba(11, 14, 20, 0.94);
}
.tp-page .nav-shell {
    min-height: var(--header-h);
    position: relative;
}
.tp-page .nav-toggle { display: flex; }
.tp-page .nav-left {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    z-index: 2;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
    padding: 10px;
    background: var(--glass-2);
    border: 1px solid var(--line);
    border-radius: 16px;
}
.tp-page .nav-left.is-open { display: flex; }
.tp-page .nav-dd-menu {
    position: static;
    display: grid;
    background: transparent;
    border: 0;
    padding: 0 0 0 8px;
}

.tp {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text);
}

.tp-start {
    flex: 1;
    overflow: auto;
    width: min(40rem, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}
.tp-start h1 {
    font-size: clamp(2.2rem, 10vw, 3.4rem);
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}
.tp-start p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.5;
    margin-bottom: 22px;
}

.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    cursor: pointer;
}
.tp-btn:hover {
    border-color: var(--line-strong);
    color: #fff;
}
.tp-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.tp-btn-yellow,
.tp-btn-primary {
    background: linear-gradient(180deg, #8eecf6, var(--cyan));
    border-color: transparent;
    color: var(--ink);
}
.tp-btn-yellow:hover,
.tp-btn-primary:hover {
    filter: brightness(1.06);
    color: var(--ink);
}
.tp-file {
    width: 100%;
    margin-bottom: 10px;
}
.tp-file input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}
.tp-start .tp-btn {
    width: 100%;
}
.tp-paste {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}
.tp-paste label {
    font-weight: 700;
}
.tp-paste textarea {
    width: 100%;
    min-height: 140px;
    max-height: 36dvh;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1.05rem;
    line-height: 1.45;
    resize: vertical;
}
#tp-paste-go {
    scroll-margin-top: calc(var(--header-h) + 16px);
    scroll-margin-bottom: 24px;
}

.tp-stage {
    position: relative;
    z-index: 1;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
}
.tp-stage[hidden],
.tp-bar[hidden] {
    display: none !important;
}
.tp-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0 18px;
}
.tp-guide {
    position: sticky;
    top: 22%;
    z-index: 2;
    height: 0;
    border-top: 3px solid var(--cyan);
    pointer-events: none;
}
.tp-script {
    --tp-size: 2.15rem;
    padding-top: 24vh;
    padding-bottom: 50vh;
    font-size: var(--tp-size);
    line-height: 1.35;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.tp-line {
    margin: 0 0 0.45em;
}
.tp-gap {
    height: 0.8em;
}
.tp-word {
    color: var(--text);
}
.tp-word.is-said {
    color: var(--muted);
}
.tp-word.is-now {
    background: var(--cyan);
    color: var(--ink);
    border-radius: 0.12em;
}

.tp-bar {
    position: relative;
    z-index: 35;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(11, 14, 20, 0.94);
    border-top: 1px solid var(--line);
}
.tp-modes,
.tp-speed {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    align-items: center;
}
.tp-modes { grid-template-columns: 1fr 1fr 1fr; }
.tp-modes .tp-btn { width: 100%; }
.tp-speed { grid-template-columns: 52px minmax(0, 1fr) 52px; }
.tp-speed .tp-btn { min-height: 48px; padding: 0; font-size: 1.4rem; }
.tp-speed-label {
    display: grid;
    gap: 2px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}
.tp-speed-label strong { color: var(--text); }
.tp-speed input[type="range"] {
    width: 100%;
    height: 28px;
    accent-color: #38D9EB;
    cursor: pointer;
}
#tp-listen.is-on,
#tp-auto.is-on,
#tp-full.is-on {
    background: transparent;
    color: var(--text);
    border-color: var(--cyan);
}
.tp-status {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--cyan-2);
    font-size: 0.95rem;
    font-weight: 700;
}
.tp-start .tp-status {
    margin-top: 16px;
}

.tp-modal {
    position: fixed;
    z-index: 80;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 16px;
    padding-top: calc(var(--header-h) + 16px);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
    background: rgba(7, 16, 24, 0.72);
}
.tp-modal[hidden] {
    display: none;
}
.tp-modal-card {
    width: min(36rem, 100%);
    max-height: calc(100dvh - var(--header-h) - 32px);
    overflow: auto;
    padding: 22px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--glass-2);
    color: var(--text);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.tp-kicker {
    margin-bottom: 6px;
    color: var(--cyan);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.tp-modal-card h2 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
    margin-bottom: 10px;
}
.tp-modal-card p {
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.45;
    margin-bottom: 12px;
}
.tp-url {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(11, 14, 20, 0.55);
    color: var(--text);
    font-size: 0.95rem;
    word-break: break-all;
}
.tp-modal-actions {
    display: grid;
    gap: 8px;
}
.tp-noscript {
    width: min(40rem, calc(100% - 32px));
    margin: 20px auto;
    color: var(--cyan-2);
    font-weight: 700;
}

@media (min-width: 800px) {
    .tp-script { --tp-size: 2.8rem; }
    .tp-modal-actions { grid-template-columns: 1fr 1fr 1fr; }
}
