/* SyncStudio interactive screen (#ss-demo) for the TV Pro guide.
   Loaded by userguides/electronics/tv-pro/index.php. Needs only style3.css
   (--text-main, --text-muted, --border-subtle, --accent-teal, --accent-purple). */

/* ---------------------------------------------------------------------
   B. SYNCSTUDIO INTERACTIVE SCREEN
   One container (.ss-demo) sized by the column; everything inside scales
   with it (cqw) like a picture of the TV. Hotspots are % boxes over a
   1742x979 screenshot. isolation keeps every z-index local, below the
   site's fixed nav (100), back-to-top (99) and search dropdown (1000).
   --------------------------------------------------------------------- */
.ss-demo {
    --ss-bezel-top: #0b0b11;
    --ss-bezel-bot: #050508;
    --ss-bezel-line: rgba(255, 255, 255, 0.09);
    --ss-tip-bg: #15151d;
    --ss-tip-line: rgba(255, 255, 255, 0.14);
    --ss-tip-text: #cbd5e1;
    --ss-row-text: #e2e8f0;
    --ss-ring: #2dd4bf;
    --ss-glow: rgba(45, 212, 191, 0.42);
    --ss-ring-owner: #c4b5fd;
    --ss-glow-owner: rgba(196, 181, 253, 0.42);
    --ss-ink: #0d0d12;
    --ss-screen-bg: #000;
    --ss-chip-bg: rgba(139, 92, 246, 0.15);
    --ss-chip-line: rgba(139, 92, 246, 0.4);
    --ss-chip-text: #c4b5fd;

    container: ssdemo / inline-size;
    position: relative;
    isolation: isolate;
    margin: 34px 0 10px;
}
/* the site has no [hidden] helper, and .ss-chip's display would beat the attribute */
.ss-demo [hidden] { display: none !important; }
.ss-hint { margin: 0 0 14px; }

.ss-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 18px; }
.ss-tabs {
    display: flex; flex-wrap: wrap; gap: 4px; padding: 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
}
.ss-tab {
    font: 600 14px/1 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-muted);
    background: transparent; border: 0; border-radius: 9px;
    padding: 9px 14px; cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.ss-tab:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.04); }
.ss-tab[aria-selected="true"] { color: var(--text-main); background: rgba(139, 92, 246, 0.2); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.5); }

.ss-showall {
    font: 600 13px/1 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 7px 12px 7px 7px;
    display: inline-flex; align-items: center; gap: 8px;
    cursor: pointer;
}
.ss-showall:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.03); }
.ss-knob {
    position: relative; flex: 0 0 auto; width: 28px; height: 16px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: background 0.15s ease;
}
.ss-knob::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.15s ease, background 0.15s ease;
}
.ss-showall[aria-pressed="true"] { color: var(--text-main); border-color: rgba(45, 212, 191, 0.45); }
.ss-showall[aria-pressed="true"] .ss-knob { background: rgba(45, 212, 191, 0.4); }
.ss-showall[aria-pressed="true"] .ss-knob::after { transform: translateX(12px); background: var(--accent-teal); }

.ss-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }

/* the TV */
.ss-tv {
    position: relative;
    padding: clamp(5px, 1.1cqw, 13px);
    border-radius: clamp(9px, 1.5cqw, 18px);
    background: linear-gradient(180deg, var(--ss-bezel-top), var(--ss-bezel-bot));
    border: 1px solid var(--ss-bezel-line);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.6),
        0 26px 60px -22px rgba(139, 92, 246, 0.45),
        0 34px 80px -40px rgba(45, 212, 191, 0.35);
}
/* the TV Pro's LED glow strip */
.ss-tv::after {
    content: ''; position: absolute; left: 14%; right: 14%; bottom: -2px; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-teal), transparent);
    opacity: 0.75;
}
.ss-screen {
    position: relative;
    width: 100%; max-width: 100%;
    aspect-ratio: 1742 / 979;
    border-radius: clamp(3px, 0.45cqw, 6px);
    background: var(--ss-screen-bg);
}
.ss-screen > img {
    position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
    display: block; border-radius: inherit; object-fit: cover;
    user-select: none; -webkit-user-drag: none;
}
.ss-cap { font-size: 13px; line-height: 1.5; color: var(--text-muted); margin: 14px 0 0; }

/* hotspots */
.ss-layer { position: absolute; inset: 0; }
.ss-hs {
    --ring: var(--ss-ring); --glow: var(--ss-glow);
    position: absolute; display: block;
    margin: 0; padding: 0; border: 0;
    background: transparent;
    font: inherit; color: inherit;
    border-radius: clamp(3px, 0.55cqw, 9px);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: box-shadow 0.15s ease, background-color 0.15s ease;
}
.ss-hs[data-owner] { --ring: var(--ss-ring-owner); --glow: var(--ss-glow-owner); }
.ss-hs:focus { outline: none; }
.ss-hs:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.ss-hs.is-on {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 0 2px var(--ring), 0 0 14px 2px var(--glow);
}
.ss-hs.is-anchor {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px var(--ring), 0 0 0 5px rgba(13, 13, 18, 0.35), 0 0 26px 6px var(--glow);
}
.ss-num {
    display: none;
    position: absolute; left: 0; top: 0; transform: translate(-40%, -40%);
    min-width: clamp(13px, 2cqw, 19px); height: clamp(13px, 2cqw, 19px); padding: 0 3px;
    border-radius: 999px;
    align-items: center; justify-content: center;
    font: 700 clamp(8px, 1.1cqw, 11px)/1 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    color: var(--ss-ink); background: var(--ring);
    box-shadow: 0 0 0 2px rgba(13, 13, 18, 0.85);
    pointer-events: none;
}
.ss-show-all .ss-hs { box-shadow: inset 0 0 0 1px var(--ring); background: rgba(13, 13, 18, 0.12); }
.ss-show-all .ss-hs.is-on { box-shadow: 0 0 0 2px var(--ring), 0 0 14px 2px var(--glow); }
.ss-show-all .ss-hs.is-anchor { box-shadow: 0 0 0 2px var(--ring), 0 0 0 5px rgba(13, 13, 18, 0.35), 0 0 26px 6px var(--glow); }
.ss-num[data-at="tr"] { left: auto; right: 0; transform: translate(40%, -40%); }
.ss-num[data-at="bl"] { top: auto; bottom: 0; transform: translate(-40%, 40%); }
.ss-num[data-at="br"] { left: auto; top: auto; right: 0; bottom: 0; transform: translate(40%, 40%); }
.ss-num[data-at="ro"] { left: 100%; top: 50%; transform: translate(10%, -50%); }
.ss-num[data-at="lo"] { left: auto; right: 100%; top: 50%; transform: translate(-10%, -50%); }
.ss-num[data-at="to"] { left: 50%; top: auto; bottom: 100%; transform: translate(-50%, -10%); }
.ss-num[data-at="bo"] { left: 50%; top: 100%; transform: translate(-50%, 10%); }
.ss-show-all .ss-hs[data-n] .ss-num { display: flex; }

/* tooltip: floats over the screen, or docks under it on narrow screens */
.ss-tip {
    position: absolute; left: 0; top: 0; z-index: 500;
    width: max-content; max-width: 300px;
    background: var(--ss-tip-bg);
    border: 1px solid var(--ss-tip-line);
    border-radius: 12px;
    padding: 10px 12px 11px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    text-align: left;
}
.ss-tip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ss-tip-label { font: 700 14px/1.3 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text-main); }
.ss-tip-body { font: 400 13px/1.5 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ss-tip-text); }
.ss-tip-body ul { list-style: none; margin: 7px 0 0; padding: 0; display: grid; gap: 5px; }
.ss-tip-body li { font-size: 13px; line-height: 1.45; color: var(--ss-tip-text); padding-left: 10px; position: relative; }
.ss-tip-body li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 4px; height: 4px; border-radius: 50%; background: var(--accent-teal); }
.ss-tip-body li b { color: var(--text-main); font-weight: 600; }
.ss-tip-arrow {
    position: absolute; width: 10px; height: 10px;
    background: var(--ss-tip-bg); border: 1px solid var(--ss-tip-line);
    transform: rotate(45deg);
}
.ss-tip[data-side="top"] .ss-tip-arrow    { bottom: -6px; margin-left: -5px; border-top: 0; border-left: 0; }
.ss-tip[data-side="bottom"] .ss-tip-arrow { top: -6px; margin-left: -5px; border-bottom: 0; border-right: 0; }
.ss-tip[data-side="left"] .ss-tip-arrow   { right: -6px; margin-top: -5px; border-bottom: 0; border-left: 0; }
.ss-tip[data-side="right"] .ss-tip-arrow  { left: -6px; margin-top: -5px; border-top: 0; border-right: 0; }
.ss-tip[data-side="none"] .ss-tip-arrow   { display: none; }

.ss-dock { display: none; margin-top: 14px; }
.ss-dock.is-forced { display: block; }
.ss-dock.is-forced .ss-dock-hint { display: none; }
.ss-dock-hint {
    margin: 0; padding: 10px 12px;
    font-size: 13px; line-height: 1.5; color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.14); border-radius: 12px;
}
.ss-dock.has-tip .ss-dock-hint { display: none; }
.ss-tip.is-dock {
    position: relative; left: auto !important; top: auto !important;
    width: auto; max-width: none;
    pointer-events: auto;
}
.ss-tip.is-dock .ss-tip-arrow { top: -6px; bottom: auto; margin-left: -5px; border-bottom: 0; border-right: 0; border-top: 1px solid var(--ss-tip-line); border-left: 1px solid var(--ss-tip-line); }

/* chips */
.ss-chip {
    flex: 0 0 auto;
    display: inline-block;
    font: 700 10px/1 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.5px; text-transform: uppercase;
    padding: 4px 7px; border-radius: 999px;
    background: var(--ss-chip-bg); border: 1px solid var(--ss-chip-line);
    color: var(--ss-chip-text);
    vertical-align: 2px;
}

/* legend */
.ss-legend {
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    padding: 4px 6px 8px;
    overflow-y: auto;
    max-height: min(340px, 58vh);
    overscroll-behavior: contain;
    scrollbar-width: thin;
}
.ss-legend.has-more {
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), rgba(0, 0, 0, 0.15));
    mask-image: linear-gradient(to bottom, #000 calc(100% - 44px), rgba(0, 0, 0, 0.15));
}
.ss-lg-cap { font-size: 13px; line-height: 1.5; color: var(--text-muted); margin: 8px 8px 2px; }
.ss-lg-head {
    font: 700 11px/1 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 1px; text-transform: uppercase;
    color: var(--text-muted);
    padding: 14px 8px 6px;
}
.ss-lg-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 6px; }
.ss-lg-row {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 36px; min-width: 0;
    text-align: left;
    font: 500 14px/1.3 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ss-row-text);
    background: transparent; border: 0; border-radius: 9px;
    padding: 6px 8px;
    cursor: pointer;
}
.ss-lg-row:hover, .ss-lg-row.is-on { background: rgba(45, 212, 191, 0.09); color: var(--text-main); }
.ss-lg-row[data-owner]:hover, .ss-lg-row[data-owner].is-on { background: rgba(139, 92, 246, 0.12); }
.ss-lg-n {
    flex: 0 0 auto;
    min-width: 22px; height: 22px; padding: 0 4px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font: 700 11px/1 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-variant-numeric: tabular-nums;
    background: rgba(255, 255, 255, 0.06); color: var(--text-muted);
}
.ss-lg-row.is-on .ss-lg-n { background: var(--ss-ring); color: var(--ss-ink); }
.ss-lg-row[data-owner].is-on .ss-lg-n { background: var(--ss-ring-owner); }
.ss-lg-l { flex: 1 1 auto; min-width: 0; }
.ss-lg-shared { margin-top: 6px; }
.ss-lg-shared > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px;
    font: 600 13px/1.3 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-muted);
    padding: 10px 8px; border-radius: 9px;
}
.ss-lg-shared > summary::-webkit-details-marker { display: none; }
.ss-lg-shared > summary::before {
    content: ''; width: 7px; height: 7px; flex: 0 0 auto;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(-45deg); transition: transform 0.15s ease; margin: 0 3px;
}
.ss-lg-shared[open] > summary::before { transform: rotate(45deg); }
.ss-lg-shared > summary:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.03); }

/* side-by-side when the column is wide (about 1700px+ windows) */
@container ssdemo (min-width: 1000px) {
    .ss-stage { grid-template-columns: minmax(0, 1fr) 260px; align-items: stretch; }
    .ss-legend { height: 0; min-height: 100%; max-height: none; }
    .ss-lg-rows { grid-template-columns: minmax(0, 1fr); }
}
/* narrow: the tooltip docks under the screen */
@container ssdemo (max-width: 539.98px) {
    .ss-dock { display: block; }
    .ss-tab { padding: 8px 11px; font-size: 13px; }
    .ss-lg-rows { grid-template-columns: minmax(0, 1fr); }
    .ss-legend { max-height: none; overflow: visible; overscroll-behavior: auto; }
    .ss-legend.has-more { -webkit-mask-image: none; mask-image: none; }
    .ss-show-all .ss-hs[data-n] .ss-num { display: none; }
}
/* phones: give the TV picture a little more of the width */
@media (max-width: 600px) {
    .ss-tv { margin-left: -24px; margin-right: -24px; }
}

@media (prefers-reduced-motion: reduce) {
    .ss-hs, .ss-tab, .ss-knob, .ss-knob::after, .ss-lg-shared > summary::before { transition: none; }
}
