/* emdrmobile.com — free browser BLS tool (/bls/).
   Colours and sizes mirror the app: src/constants/appearance.js, BlsVisual.js. */

.bls-tool {
    --bls-bg-dark: linear-gradient(180deg, #0b1020 0%, #0e1526 50%, #0b1020 100%);
    --bls-bg-light: linear-gradient(180deg, #e0f7fa 0%, #ffffff 60%);
    --glow: #ffd664;
    --core: #ffffff;
    --size: 100px;
    padding: 96px 24px 8px;
    background: #fff;
}

.bls-tool [hidden] {
    display: none !important;
}

.bls-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

.bls-wrap .breadcrumb {
    margin-bottom: 14px;
}

.bls-head h1 {
    font-size: clamp(1.5rem, 3.4vw, 2.1rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: #1c2b33;
    margin: 0 0 6px;
}

.bls-sub {
    color: #5b6b76;
    margin: 0 0 12px;
    font-size: 1rem;
}

.bls-notice {
    display: inline-block;
    font-size: 0.85rem;
    color: #5b4a1a;
    background: #fff7e0;
    border: 1px solid #f1dfa6;
    border-radius: 8px;
    padding: 6px 12px;
    margin: 0 0 16px;
}

/* ---------- stage ---------- */

.bls-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 28px;
    min-height: clamp(300px, 46vh, 480px);
    padding: 56px 24px 28px;
    border-radius: 20px;
    background: var(--bls-bg-dark);
    color: #e7ecf5;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.bls-stage.is-light {
    background: var(--bls-bg-light);
    color: #1c2b33;
    box-shadow: inset 0 0 0 1px #e3eaee;
}

.bls-stage[data-size='s'] { --size: 68px; }
.bls-stage[data-size='m'] { --size: 100px; }
.bls-stage[data-size='l'] { --size: 140px; }

@media (max-width: 600px) {
    .bls-stage[data-size='l'] { --size: 110px; }
    .bls-stage { padding: 52px 14px 22px; gap: 22px; }
}

.bls-counters {
    position: absolute;
    top: 14px;
    left: 18px;
    right: 64px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 0.8rem;
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
    transition: opacity 0.6s ease;
}

.bls-counters b {
    font-weight: 600;
}

.bls-fs {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.6s ease;
}

.bls-fs:hover,
.bls-fs:focus-visible {
    opacity: 1;
    background: rgba(127, 127, 127, 0.15);
}

/* ---------- visual ---------- */

.bls-field {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.bls-shell {
    height: 60px;
    border-radius: 30px;
    padding: 8px 10px;
    background: linear-gradient(180deg, #2a2f3a, #1c212b 50%, #141821 75%, #1c212b 90%, #2a2f3a);
    border-bottom: 1px solid #0a0d12;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}

.is-light .bls-shell {
    background: linear-gradient(180deg, #e0e0e0, #bdbdbd 50%, #9e9e9e 75%, #bdbdbd 90%, #e0e0e0);
    border-bottom-color: #757575;
}

.bls-track {
    position: relative;
    height: 100%;
    border-radius: 22px;
    background: #05070c;
    overflow: hidden;
}

.is-light .bls-track {
    background: #333;
}

.bls-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--size);
    height: 100%;
    border-radius: 22px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--glow) 60%, transparent) 25%,
        var(--core) 50%,
        color-mix(in srgb, var(--glow) 60%, transparent) 75%,
        transparent
    );
    will-change: transform;
}

/* sphere and dot: no rail, the object travels across the stage */
.bls-stage[data-vis='sphere'] .bls-shell,
.bls-stage[data-vis='dot'] .bls-shell {
    height: var(--size);
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

.bls-stage[data-vis='sphere'] .bls-track,
.bls-stage[data-vis='dot'] .bls-track {
    background: none;
    overflow: visible;
}

.bls-stage[data-vis='sphere'] .bls-thumb {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, var(--core) 0 14%, var(--glow) 48%, color-mix(in srgb, var(--glow) 55%, #000) 100%);
    box-shadow: 0 0 calc(var(--size) * 0.45) color-mix(in srgb, var(--glow) 45%, transparent);
}

.bls-stage[data-vis='dot'] .bls-thumb {
    border-radius: 50%;
    background: var(--glow);
    box-shadow: 0 0 8px color-mix(in srgb, var(--glow) 60%, transparent);
}

.bls-stage[data-vis='off'] .bls-field {
    display: none;
}

.bls-off-note {
    display: none;
    text-align: center;
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.75;
}

.bls-stage[data-vis='off'] .bls-off-note {
    display: block;
}

/* ---------- start ---------- */

.bls-stage-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: opacity 0.6s ease;
}

.bls-start {
    min-width: min(320px, 100%);
    height: 60px;
    padding: 0 36px;
    border: 0;
    border-radius: 999px;
    background: #03c3a5;
    color: #fff;
    font: 600 1.1rem/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(3, 195, 165, 0.35);
    transition: background 0.2s ease, transform 0.1s ease;
}

.bls-start:hover {
    background: #029c84;
}

.bls-start:active {
    transform: scale(0.98);
}

.bls-start:focus-visible,
.bls-btn:focus-visible,
.bls-seg input:focus-visible + span {
    outline: 3px solid #7fe7d6;
    outline-offset: 3px;
}

.bls-start-stop,
.is-playing .bls-start-play {
    display: none;
}

.is-playing .bls-start-stop {
    display: inline;
}

.is-playing .bls-start {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.is-light.is-playing .bls-start {
    background: #fff;
    color: #1c2b33;
    box-shadow: inset 0 0 0 2px #1c2b33;
}

.bls-hint {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.7;
    text-align: center;
}

/* full screen: clean surface for screen sharing, controls fade when idle */
.bls-stage:fullscreen {
    border-radius: 0;
    min-height: 100vh;
}

.bls-stage:-webkit-full-screen {
    border-radius: 0;
    min-height: 100vh;
    width: 100%;
}

.bls-stage:fullscreen.is-idle,
.bls-stage:-webkit-full-screen.is-idle {
    cursor: none;
}

.bls-stage:fullscreen.is-idle .bls-stage-actions,
.bls-stage:fullscreen.is-idle .bls-counters,
.bls-stage:fullscreen.is-idle .bls-fs,
.bls-stage:-webkit-full-screen.is-idle .bls-stage-actions,
.bls-stage:-webkit-full-screen.is-idle .bls-counters,
.bls-stage:-webkit-full-screen.is-idle .bls-fs {
    opacity: 0;
    pointer-events: none;
}

.bls-status {
    min-height: 1.6em;
    margin: 10px 2px 6px;
    font-size: 0.9rem;
    color: #3d5360;
}

/* ---------- controls ---------- */

.bls-dock {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    padding: 18px;
    border: 1px solid #e3eaee;
    border-radius: 16px;
    background: #f5f9fa;
}

.bls-ctl {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.bls-ctl > label,
.bls-ctl > legend {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1c2b33;
}

.bls-ctl output {
    font-variant-numeric: tabular-nums;
    color: #029c84;
}

.bls-ctl small {
    font-size: 0.78rem;
    color: #5b6b76;
}

.bls-ctl input[type='range'] {
    width: 100%;
    height: 32px;
    accent-color: #03c3a5;
    cursor: pointer;
}

.bls-ctl select {
    height: 40px;
    padding: 0 10px;
    border: 1px solid #cfdbe0;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 0.9rem;
}

.bls-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.bls-seg label {
    position: relative;
    flex: 1 1 auto;
    cursor: pointer;
}

.bls-seg input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.bls-seg span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 10px;
    background: #fff;
    box-shadow: inset 0 0 0 1px #cfdbe0;
    font-size: 0.85rem;
    color: #1c2b33;
    white-space: nowrap;
}

.bls-seg input:checked + span {
    background: #03c3a5;
    box-shadow: none;
    color: #fff;
    font-weight: 600;
}

.bls-swatches label {
    flex: 0 0 auto;
}

.bls-swatches span {
    width: 40px;
    min-height: 40px;
    padding: 0;
    border-radius: 50%;
    background: var(--sw);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.bls-swatches input:checked + span {
    background: var(--sw);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1c2b33;
}

.bls-ctl-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    grid-column: 1 / -1;
}

.bls-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin-right: auto;
    font-size: 0.9rem;
    cursor: pointer;
}

.bls-switch input {
    width: 18px;
    height: 18px;
    accent-color: #03c3a5;
}

.bls-btn {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid #cfdbe0;
    border-radius: 10px;
    background: #fff;
    color: #1c2b33;
    font: 500 0.88rem/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
}

.bls-btn:hover {
    border-color: #03c3a5;
    color: #029c84;
}

.bls-keys {
    margin: 10px 2px 0;
    font-size: 0.8rem;
    color: #5b6b76;
}

.bls-keys kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 0 5px;
    border: 1px solid #cfdbe0;
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    font: 600 0.75rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
    text-align: center;
}

@media (hover: none) {
    .bls-keys {
        display: none;
    }
}

/* ---------- app hand-off card ---------- */

.bls-upsell {
    position: relative;
    margin: 18px 0 0;
    padding: 22px 56px 22px 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, #e9fbf7, #f5f9fa);
    border: 1px solid #bfeee4;
}

.bls-upsell h2 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    line-height: 1.3;
    color: #1c2b33;
}

.bls-upsell p {
    margin: 0 0 10px;
    color: #3d5360;
    font-size: 0.95rem;
}

.bls-upsell .bls-upsell-terms {
    font-size: 0.85rem;
    color: #5b6b76;
}

.bls-upsell .store-btns {
    justify-content: flex-start;
    margin-top: 6px;
}

.bls-upsell-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    font-size: 1.4rem;
    color: #5b6b76;
    cursor: pointer;
}

.bls-upsell[data-device='ios'] .only-android,
.bls-upsell[data-device='ios'] .only-desktop,
.bls-upsell[data-device='android'] .only-ios,
.bls-upsell[data-device='android'] .only-desktop {
    display: none;
}

.bls-noscript {
    margin: 12px 0;
    padding: 12px;
    border-radius: 10px;
    background: #fff7e0;
}

/* article below the tool sits closer */
.bls-tool + .article-main {
    padding-top: 40px;
}

@media (prefers-reduced-motion: reduce) {
    .bls-start,
    .bls-stage-actions,
    .bls-counters,
    .bls-fs {
        transition: none;
    }
}

/* Collapsed detail under the tool: the page stays short, the detail is one tap away. */
.bls-more { border-top: 1px solid rgba(0, 0, 0, 0.1); }
.bls-more:last-of-type { border-bottom: 1px solid rgba(0, 0, 0, 0.1); }
.bls-more > summary {
    cursor: pointer;
    padding: 14px 0;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.bls-more > summary::-webkit-details-marker { display: none; }
.bls-more > summary::after { content: '+'; opacity: 0.6; }
.bls-more[open] > summary::after { content: '–'; }
.bls-more > :not(summary) { margin-top: 0; margin-bottom: 14px; }

.bls-upsell-qr {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
}

.bls-upsell-qr img {
    flex: none;
    width: 112px;
    height: 112px;
    border-radius: 8px;
    border: 1px solid #bfeee4;
}

.bls-upsell-qr p {
    margin: 0;
    max-width: 22em;
}
