/* TRMMS calculator - floating tutorial video frame (Path A video tour) */

.trmms-tour-frame {
    position: fixed;
    top: 84px;
    right: 24px;
    width: 420px;
    max-width: calc(100vw - 24px);
    z-index: 10500;              /* above bootstrap modals (1055) and driver.js */
    background: #14181f;
    color: #e8eaed;
    border: 1px solid #2c3440;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
    touch-action: none;
}

.trmms-tour-frame-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    background: #1d232d;
    cursor: grab;
    user-select: none;
}

.trmms-tour-frame-bar:active {
    cursor: grabbing;
}

.trmms-tour-frame-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trmms-tour-frame-bar-buttons {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.trmms-tour-frame-close,
.trmms-tour-frame-size {
    background: transparent;
    border: 0;
    color: #e8eaed;
    font-size: 18px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
}

.trmms-tour-frame-size {
    font-size: 13px;
    padding: 4px 7px;
}

.trmms-tour-frame-close:hover,
.trmms-tour-frame-close:focus-visible,
.trmms-tour-frame-size:hover,
.trmms-tour-frame-size:focus-visible {
    background: #333c49;
}

/* Bottom-right corner grip: drag to make the player (and video) larger or smaller. */
.trmms-tour-frame-grip {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    touch-action: none;
    background:
        linear-gradient(135deg, transparent 0 55%, #6b7685 55% 62%, transparent 62% 72%, #6b7685 72% 79%, transparent 79%);
}

.trmms-tour-frame-grip:hover {
    background:
        linear-gradient(135deg, transparent 0 55%, #c9ced4 55% 62%, transparent 62% 72%, #c9ced4 72% 79%, transparent 79%);
}

.trmms-tour-frame video {
    display: block;
    width: 100%;
    background: #000;
}

/* Intro / Full tutorial switch */
.trmms-tour-frame-tabs {
    display: flex;
    gap: 4px;
    padding: 6px 8px 0;
    background: #1d232d;
}

.trmms-tour-frame-tab {
    flex: 1 1 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px 6px 0 0;
    background: transparent;
    color: #9aa3ad;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.trmms-tour-frame-tab:hover,
.trmms-tour-frame-tab:focus-visible {
    color: #e8eaed;
}

.trmms-tour-frame-tab.is-active {
    background: #14181f;
    color: #e8eaed;
}

.trmms-tour-frame-tab-time {
    font-weight: 400;
    font-variant-numeric: tabular-nums;
    opacity: 0.75;
}

/* Chapter list - only for the full tutorial */
.trmms-tour-frame-chapters {
    display: none;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 190px;
    overflow-y: auto;
    border-top: 1px solid #2c3440;
}

.trmms-tour-frame.is-main .trmms-tour-frame-chapters {
    display: block;
}

.trmms-tour-frame-chapter {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 5px 12px;
    border: 0;
    background: transparent;
    color: #c9ced4;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}

.trmms-tour-frame-chapter:hover,
.trmms-tour-frame-chapter:focus-visible {
    background: #1d232d;
    color: #fff;
}

.trmms-tour-frame-chapter.is-active {
    background: #23406b;
    color: #fff;
}

.trmms-tour-frame-chapter-time {
    flex: 0 0 auto;
    min-width: 38px;
    color: #8fb4ff;
    font-variant-numeric: tabular-nums;
}

.trmms-tour-frame-chapter.is-active .trmms-tour-frame-chapter-time {
    color: #fff;
}

.trmms-tour-frame-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 22px 6px 10px;   /* right: room for the resize grip */
    border-top: 1px solid #2c3440;
}

.trmms-tour-frame-hint {
    font-size: 12px;
    color: #9aa3ad;
    min-height: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trmms-tour-frame-guided {
    flex: 0 0 auto;
    padding: 3px 10px;
    border: 1px solid #3a4452;
    border-radius: 999px;
    background: transparent;
    color: #e8eaed;
    font-size: 12px;
    cursor: pointer;
}

.trmms-tour-frame-guided:hover,
.trmms-tour-frame-guided:focus-visible {
    background: #333c49;
}

.trmms-tour-frame.is-large .trmms-tour-frame-chapters {
    max-height: 96px;
}

@media (max-height: 640px) {
    .trmms-tour-frame-chapters {
        max-height: 120px;
    }
}

/* Per-element video icon (data-tour-video="..."): a small, borderless
   video-camera that follows the light/dark theme. Adding an icon must never
   move a field, at any screen width. The button is absolutely positioned with
   no offsets, so it is drawn exactly where it would sit inline (right after
   the label text) but takes no space: labels never grow, widen or wrap. */
.trmms-tour-video-btn {
    position: absolute;
    display: inline-block;
    width: 1.3em;
    height: 1.25em;
    margin: 0 0 0 0.3em;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color, #6c757d);
    cursor: pointer;
}

/* Icons are filled in from tour-index.json; until then (or if it fails to load) they stay hidden. */
.trmms-tour-video-btn:empty {
    display: none;
}

.trmms-tour-video-btn svg {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    box-sizing: content-box;
    width: min(0.95em, 14px);
    height: min(0.95em, 14px);
    padding: 3px;            /* comfortable click target around the camera */
    border-radius: 3px;
    fill: currentColor;
}

.trmms-tour-video-btn:hover,
.trmms-tour-video-btn:focus-visible {
    color: var(--bs-link-color, #0d6efd);
    outline: none;
}

.trmms-tour-video-btn:hover svg,
.trmms-tour-video-btn:focus-visible svg {
    background: var(--bs-tertiary-bg, #f8f9fa);
}

.trmms-tour-video-btn:focus-visible svg {
    outline: 2px solid var(--bs-link-color, #0d6efd);
}

/* ------------------------------------------------------------------
   First-visit intro overlay (t_620de3a8): the welcome film plays once,
   centered and somewhat smaller than the page, over the calculator
   blurred behind it. Skippable; Esc / dimmed-margin click also close.
   ------------------------------------------------------------------ */

.trmms-intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 10800;             /* above the tour frame (10500) */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 11, 16, 0.2);   /* light tint: the dashboard stays visible */
}

/* Everything on the page blurs while the intro is open — the calculator
   stays visible around the film but recedes behind it. */
body.trmms-intro-open > :not(#trmmsIntroOverlay) {
    filter: blur(2px);
}

.trmms-intro-box {
    width: min(78vw, 1040px);
    background: #10141b;
    border: 1px solid #2c3440;
    border-radius: 12px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.trmms-intro-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: #1d232d;
}

.trmms-intro-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #e8eaed;
    letter-spacing: 0.2px;
}

.trmms-intro-skip {
    border: 1px solid #3a4452;
    border-radius: 999px;
    background: transparent;
    color: #c9ced4;
    font-size: 12px;
    padding: 4px 12px;
    cursor: pointer;
}

.trmms-intro-skip:hover,
.trmms-intro-skip:focus-visible {
    background: #333c49;
    color: #fff;
}

.trmms-intro-box video {
    display: block;
    width: 100%;
    background: #000;
}

.trmms-intro-note {
    padding: 8px 14px 10px;
    font-size: 12px;
    color: #9aa3ad;
    text-align: center;
}

@media (max-width: 560px) {
    .trmms-intro-box { width: 100%; }
    body.trmms-intro-open > :not(#trmmsIntroOverlay) { filter: blur(1.5px); }
}
