/* ==========================================================================
   EasyTeleprompter.com: colour tokens and tool styles.
   Loaded after the Tool parent theme's stylesheets.
   ========================================================================== */

:root {
    /* Primary: studio black for the header and footer, cool blue for links */
    --primary-900: #15171f;
    --primary-800: #22252f;
    --primary-700: #2a5bab;
    --primary-600: #3369bf;
    --primary-100: #e8eef8;

    /* Accent: tally-light red, for key numbers and the result panels */
    --accent-600: #b3302a;
    --accent-500: #d0443a;
    --accent-100: #fcecea;

    /* Cue amber: decoration on dark backgrounds only */
    --spark-300: #f5b841;
    --spark-500: #e09b1a;

    /* Soft highlight: notes, the Amazon strip and the shop boxes */
    --highlight-300: #ddd6c8;
    --highlight-100: #f7f4ee;

    /* Surface and border */
    --surface-0: #ffffff;
    --surface-50: #f6f6f8;
    --surface-100: #ececf0;
    --border-200: #d7d8de;
    --border-300: #babcc6;

    /* Ink: body text */
    --ink-900: #14161c;
    --ink-700: #343845;
    --ink-500: #575c6b;

    /* Text on dark backgrounds */
    --on-dark: #f3f1ec;
    --on-dark-muted: #c4c7d0;

    --primary-900-rgb: 21 23 31;

    --focus-ring-on-dark: 3px solid #f5b841;
}

.brand__strong {
    color: #f5b841;
}

html.et-locked,
html.et-locked body {
    overflow: hidden;
}

/* Home page head: faint scan lines over studio black. */
.page-head--home {
    padding-block: 2.5rem 2rem;
    border-bottom: 0;
    background:
        repeating-linear-gradient(180deg, rgb(245 184 65 / 0.06) 0 2px, transparent 2px 28px),
        linear-gradient(160deg, rgb(208 68 58 / 0.22), transparent 55%),
        var(--primary-900);
    color: var(--on-dark);
}

.page-head--home .page-head__title {
    color: #ffffff;
}

.page-head--home .page-head__lead {
    color: var(--on-dark-muted);
}

/* Shared form pieces ------------------------------------------------------- */

.tool > * {
    min-width: 0;
}

.field__help {
    color: var(--ink-500);
    font-size: 0.85rem;
    line-height: 1.45;
}

.tool textarea {
    width: 100%;
    min-height: 5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-300);
    border-radius: var(--radius);
    background: var(--surface-0);
    color: var(--ink-900);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
}

.tool textarea:hover {
    border-color: var(--ink-500);
}

.tool textarea[readonly] {
    background: var(--surface-50);
}

.tool input[type="range"] {
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    accent-color: var(--accent-600);
    cursor: pointer;
}

.field--range {
    gap: 0;
}

.field__value {
    color: var(--accent-600);
    font-family: var(--font-mono);
    font-weight: 700;
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.5rem;
}

.checks--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}

.tool .check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-self: start;
    min-height: 2.75rem;
    color: var(--ink-900);
    font-weight: 600;
    cursor: pointer;
}

.tool input[type="checkbox"] {
    flex: none;
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
    accent-color: var(--primary-700);
}

.file-btn {
    position: relative;
}

.file-btn:focus-within {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

/* Main action in a tool: filled button. Ghost buttons keep the parent look. */
.tool .btn:not(.btn--ghost) {
    border-color: var(--primary-700);
    background: var(--primary-700);
    color: #ffffff;
}

.tool .btn:not(.btn--ghost):hover:not(:disabled) {
    border-color: var(--primary-900);
    background: var(--primary-900);
}

.tool .btn.btn--rec {
    border-color: var(--accent-600);
    background: var(--accent-600);
}

.tool .btn.btn--rec:hover:not(:disabled) {
    border-color: #8f2520;
    background: #8f2520;
}

.tool .table-wrap {
    margin-top: 0;
    border: 1px solid var(--border-200);
    border-radius: var(--radius);
}

.tool .table-wrap:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.tool .result-table caption {
    padding: 0.6rem 0.6rem 0.2rem;
    color: var(--ink-900);
    font-weight: 700;
    text-align: left;
}

.tool .result-table th[scope="row"] {
    color: var(--ink-900);
    font-weight: 600;
}

.tool .result-table tr.is-pick th,
.tool .result-table tr.is-pick td {
    background: var(--accent-100);
    color: var(--accent-600);
    font-weight: 700;
}

fieldset.tp-settings,
fieldset.fm-options {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.tp-settings__legend {
    margin-bottom: 0.25rem;
    padding: 0;
    color: var(--ink-900);
    font-size: 1.05rem;
    font-weight: 700;
}

/* Keyboard shortcuts */
.keys {
    border: 1px solid var(--border-200);
    border-radius: var(--radius);
    background: var(--surface-50);
}

.keys summary {
    min-height: 2.75rem;
    padding: 0.7rem 1rem;
    color: var(--ink-900);
    font-weight: 700;
    cursor: pointer;
}

.keys summary:focus-visible {
    outline: var(--focus-ring);
    outline-offset: 2px;
}

.keys__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 0.4rem 1.5rem;
    margin: 0;
    padding: 0 1rem 0.5rem;
}

.keys__list div {
    display: flex;
    gap: 0.6rem;
    align-items: baseline;
}

.keys__list dd {
    margin: 0;
    color: var(--ink-700);
    font-size: 0.92rem;
}

.keys .tool__help {
    padding: 0 1rem 0.9rem;
}

kbd {
    display: inline-block;
    min-width: 1.8rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--border-300);
    border-bottom-width: 2px;
    border-radius: 0.3rem;
    background: var(--surface-0);
    color: var(--ink-900);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    text-align: center;
    white-space: nowrap;
}

/* Teleprompter -------------------------------------------------------------- */

.tp-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 60rem) {
    .tp-layout {
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        align-items: start;
    }
}

.tp-edit {
    display: grid;
    gap: 0.75rem;
}

.tp-count {
    color: var(--ink-700);
    font-size: 0.92rem;
    font-weight: 600;
}

.tp-stage,
.cam-stage {
    --tp-bg: #000000;
    --tp-fg: #ffffff;
    --tp-cue: #f5b841;
    --tp-size: 56px;
    --tp-lh: 1.5;
    --tp-margin: 8%;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--tp-bg);
    color: var(--tp-fg);
    -webkit-user-select: none;
    user-select: none;
}

.tp-stage {
    height: clamp(18rem, 62vh, 42rem);
    cursor: pointer;
}

.tp-stage:focus-visible,
.cam-stage:focus-visible,
.timer-face:focus-visible,
.mr-preview:focus-visible {
    outline: 3px solid var(--primary-600);
    outline-offset: 3px;
}

.tp-stage[data-colors="yb"] { --tp-fg: #ffe14d; }
.tp-stage[data-colors="gb"] { --tp-fg: #7df29a; }
.tp-stage[data-colors="wn"] { --tp-bg: #0d1b3d; }
.tp-stage[data-colors="bw"] { --tp-bg: #ffffff; --tp-fg: #000000; --tp-cue: #a4270f; }

.tp-view {
    position: absolute;
    inset: 0;
}

.tp-text {
    padding-inline: var(--tp-margin);
    font-size: var(--tp-size);
    line-height: var(--tp-lh);
    overflow-wrap: anywhere;
    will-change: transform;
}

.tp-stage[data-font="serif"] .tp-text { font-family: Georgia, "Times New Roman", serif; }
.tp-stage[data-font="mono"] .tp-text { font-family: var(--font-mono); }
.tp-stage[data-align="center"] .tp-text { text-align: center; }
.tp-stage.is-bold .tp-text { font-weight: 700; }

.tp-text p {
    margin: 0 0 0.75em;
}

.tp-cue {
    color: var(--tp-cue);
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tp-marker {
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-block: 0.9rem solid transparent;
    border-left: 1.3rem solid var(--accent-500);
    transform: translateY(-50%);
    pointer-events: none;
}

.tp-stage.is-flipx .tp-marker {
    right: 0;
    left: auto;
    border-right: 1.3rem solid var(--accent-500);
    border-left: 0;
}

.tp-stage.no-arrow .tp-marker {
    display: none;
}

.tp-progress {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: rgb(255 255 255 / 0.12);
    pointer-events: none;
}

.tp-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--spark-300);
}

.tp-bar {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    left: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: var(--radius);
    background: rgb(21 23 31 / 0.88);
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.2;
    cursor: default;
    transition: opacity 0.2s;
}

.tp-stage.is-playing .tp-bar {
    opacity: 0.18;
}

.tp-stage.is-playing .tp-bar:hover,
.tp-stage.is-playing .tp-bar:focus-within {
    opacity: 1;
}

.tp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: var(--radius);
    background: transparent;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.tp-btn:hover {
    border-color: #ffffff;
    background: rgb(255 255 255 / 0.08);
}

.tp-btn:focus-visible {
    outline: var(--focus-ring-on-dark);
    outline-offset: 2px;
}

.tp-btn[aria-pressed="true"] {
    border-color: var(--spark-300);
    color: var(--spark-300);
}

.tp-btn--main {
    min-width: 5.5rem;
    border-color: var(--accent-500);
    background: var(--accent-600);
}

.tp-btn--main:hover {
    background: var(--accent-500);
}

.tp-bar__speed,
.tp-bar__time {
    min-width: 2.5rem;
    color: var(--on-dark-muted);
    font-family: var(--font-mono);
    font-size: 0.92rem;
    text-align: center;
}

.tp-bar__speed::after {
    content: " wpm";
}

.tp-countdown {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgb(0 0 0 / 0.55);
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: clamp(5rem, 22vw, 14rem);
    font-weight: 700;
    pointer-events: none;
}

/* Full screen: the browser's own, or a fixed layer where it is missing. */
.tp-stage:fullscreen,
.cam-stage:fullscreen,
.timer-face:fullscreen,
.mr-preview:fullscreen {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
}

.tp-stage.is-full-fake,
.cam-stage.is-full-fake,
.timer-face.is-full-fake,
.mr-preview.is-full-fake {
    position: fixed;
    inset: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
}

.tp-stage.is-full {
    touch-action: none;
}

/* Video teleprompter ---------------------------------------------------- */

.cam-layout {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 60rem) {
    .cam-layout {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        align-items: start;
    }
}

.cam-controls {
    display: grid;
    gap: 0.75rem;
}

.cam-stage {
    --tp-size: 30px;
    --cam-h: 35%;
    width: 100%;
    aspect-ratio: 16 / 9;
    cursor: pointer;
}

.cam-stage[data-shape="tall"] {
    justify-self: center;
    width: min(100%, calc(72vh * 9 / 16));
    aspect-ratio: 9 / 16;
}

.cam-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000000;
}

.cam-stage:fullscreen .cam-video,
.cam-stage.is-full-fake .cam-video {
    object-fit: contain;
}

.cam-video.is-selfie {
    transform: scaleX(-1);
}

.cam-off {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1.5rem;
    background: #1b1d25;
    color: var(--on-dark-muted);
    text-align: center;
}

.cam-off p {
    max-width: 26rem;
    margin-top: 20%;
}

.cam-script {
    position: absolute;
    inset: 0 0 auto;
    height: var(--cam-h);
    overflow: hidden;
    background: linear-gradient(180deg, rgb(0 0 0 / 0.78), rgb(0 0 0 / 0.6));
    color: #ffffff;
}

.cam-script__text {
    --tp-margin: 6%;
    line-height: 1.4;
}

.cam-rec {
    position: absolute;
    top: calc(var(--cam-h) + 0.6rem);
    right: 0.6rem;
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgb(0 0 0 / 0.7);
    color: #ffffff;
    font-family: var(--font-mono);
    font-weight: 700;
}

.cam-rec__dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #ff3b30;
}

.cam-take {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--border-200);
    border-radius: var(--radius);
    background: var(--surface-50);
}

.cam-take__video {
    width: 100%;
    max-height: 70vh;
    border-radius: var(--radius);
    background: #000000;
}

/* Speaking rate test ---------------------------------------------------- */

.wpm-steps {
    display: grid;
    gap: 0.25rem;
    margin: 0;
    padding-left: 1.25rem;
    color: var(--ink-700);
}

.wpm-card {
    padding: 1.25rem 1.5rem;
    border: 2px solid var(--border-200);
    border-radius: var(--radius-lg);
    background: var(--surface-50);
    color: var(--ink-900);
    font-size: clamp(1.1rem, 2.4vw, 1.4rem);
    line-height: 1.7;
    white-space: pre-wrap;
}

.wpm-card.is-live {
    border-color: var(--accent-500);
    background: var(--surface-0);
}

.wpm-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}

.wpm-clock {
    color: var(--ink-900);
    font-family: var(--font-mono);
    font-size: 2rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

/* Font size calculator --------------------------------------------------- */

.plan {
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--border-200);
    border-radius: var(--radius);
    background: var(--surface-50);
}

.plan__svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 26rem;
}

.plan__caption {
    margin-top: 0.5rem;
    color: var(--ink-500);
    font-size: 0.85rem;
    line-height: 1.45;
}

.sz-bezel { fill: #15171f; }
.sz-screen { fill: #000000; }
.sz-line { fill: #f3f1ec; }
.sz-warn { fill: #f5b841; font-family: var(--font-sans); font-weight: 700; }

/* Presentation timer ----------------------------------------------------- */

.timer-face {
    display: grid;
    gap: 1rem;
    justify-items: center;
    align-content: center;
    min-height: 22rem;
    padding: 1.5rem 1rem;
    border-radius: var(--radius-lg);
    background: #1f2330;
    color: #ffffff;
    text-align: center;
    transition: background-color 0.4s;
}

.timer-face[data-phase="run"] { background: #17603a; }
.timer-face[data-phase="amber"] { background: #f5b841; color: #15171f; }
.timer-face[data-phase="red"],
.timer-face[data-phase="over"] { background: #a8231d; }

.timer-face__clock {
    font-family: var(--font-mono);
    font-size: clamp(4rem, 17vw, 11rem);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}

.timer-face:fullscreen .timer-face__clock,
.timer-face.is-full-fake .timer-face__clock {
    font-size: min(28vw, 50vh);
}

.timer-face__msg {
    min-height: 1.6em;
    font-size: clamp(1.1rem, 3vw, 1.8rem);
    font-weight: 700;
}

.timer-face__bar {
    width: min(100%, 40rem);
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgb(255 255 255 / 0.2);
}

.timer-face__bar span {
    display: block;
    width: 0;
    height: 100%;
    background: currentcolor;
}

.timer-face__ctrl {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.timer-face[data-phase="amber"] .tp-btn {
    border-color: rgb(21 23 31 / 0.5);
    color: #15171f;
}

.timer-face[data-phase="amber"] .tp-btn--main {
    border-color: #15171f;
    background: #15171f;
    color: #ffffff;
}

.timer-face[data-phase="amber"] .tp-btn:focus-visible {
    outline: 3px solid #15171f;
}

/* Mirror text ------------------------------------------------------------ */

.mr-preview {
    --mr-size: 44px;
    display: grid;
    place-items: center;
    min-height: 14rem;
    padding: 1.5rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: #000000;
    color: #ffffff;
}

.mr-preview[data-colors="yb"] { color: #ffe14d; }
.mr-preview[data-colors="bw"] { background: #ffffff; color: #000000; border: 1px solid var(--border-300); }

.mr-preview__text {
    max-width: 100%;
    font-size: var(--mr-size);
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.mr-preview[data-align="left"] {
    place-items: center start;
}

.mr-preview[data-align="left"] .mr-preview__text {
    text-align: left;
}

.mr-preview:fullscreen .mr-preview__text,
.mr-preview.is-full-fake .mr-preview__text {
    font-size: calc(var(--mr-size) * 1.8);
}

/* Tool card icons --------------------------------------------------------- */

.tool-card__icon {
    background: linear-gradient(180deg, #2b2f3c, #15171f);
    color: #f5b841;
}

.tool-card__icon--prompter::before { content: "▤"; font-size: 1.25rem; }
.tool-card__icon--camera::before { content: "●"; color: #ff5a4f; font-size: 1.1rem; }
.tool-card__icon--time::before { content: "◔"; font-size: 1.3rem; }
.tool-card__icon--wpm::before { content: "≋"; font-size: 1.3rem; }
.tool-card__icon--format::before { content: "¶"; font-size: 1.25rem; }
.tool-card__icon--size::before { content: "Aa"; font-size: 1rem; font-weight: 700; }
.tool-card__icon--timer::before { content: "⏱"; font-size: 1.2rem; }
.tool-card__icon--mirror::before { content: "⇋"; font-size: 1.3rem; }

@media (prefers-reduced-motion: reduce) {
    .timer-face,
    .tp-bar {
        transition: none;
    }
}

.fm-options .field-row {
    grid-template-columns: minmax(0, 16rem);
}

/* Phones and small tablets: the display comes straight after the script,
   the settings after it. */
@media (max-width: 59.99rem) {
    .tool--prompter .tp-layout {
        display: contents;
    }

    .tool--prompter > * {
        order: 5;
    }

    .tool--prompter > .tp-layout > .tp-edit {
        order: 1;
    }

    .tool--prompter > .tp-stage {
        order: 2;
    }

    .tool--prompter > #tp-stage-help {
        order: 3;
    }

    .tool--prompter > .tp-layout > .tp-settings {
        order: 4;
    }
}
