/* ==========================================================================
   HipnoOnline player
   Collapsed bar pinned to the bottom of every page, expanding into a full
   screen stage. Both states are in the DOM at all times; expanding is a class
   toggle so it is instant.
   ========================================================================== */

.hipno-player {
    --hp-accent: #a8df00;
    --hp-bg: #11131a;
    --hp-bg-soft: #1b1e28;
    --hp-text: #f4f6f8;
    --hp-dim: #9aa3b2;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99000;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #f4f6f8;
}

/* Keep the bar from covering the end of the page. */
body.hipno-player-on { padding-bottom: 76px; }

/* Nothing queued: the bar stays out of the way until a page or a click gives it
   a track. It is still in the DOM and still bound, so a play button anywhere on
   the page brings it back. */
.hipno-player.is-empty { display: none; }
body.hipno-player-on.hipno-player-empty { padding-bottom: 0; }

/* ---------- collapsed bar ---------- */
.hipno-player .hp-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    height: 76px;
    padding: 0 18px;
    box-sizing: border-box;
    background: #11131a;
    background: var(--hp-bg);
    border-top: 1px solid rgba(255, 255, 255, .08);
    box-shadow: 0 -6px 24px rgba(0, 0, 0, .35);
}

.hipno-player .hp-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 0 1 26%;
}

.hipno-player .hp-bar-art {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    object-fit: cover;
    background: #1b1e28;
    flex: 0 0 auto;
}

.hipno-player .hp-bar-text { min-width: 0; }

.hipno-player .hp-bar-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hipno-player .hp-bar-sub {
    font-size: 11.5px;
    color: #9aa3b2;
    color: var(--hp-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.hipno-player .hp-bar-center {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.hipno-player .hp-bar-right {
    flex: 0 1 26%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

/* ---------- transport ---------- */
.hipno-player .hp-controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hipno-player .hp-btn {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    color: #f4f6f8;
    color: var(--hp-text);
    font-size: 17px;
    line-height: 1;
    opacity: .85;
    transition: opacity .15s ease, transform .15s ease;
}

.hipno-player .hp-btn:hover { opacity: 1; }
.hipno-player .hp-btn:disabled { opacity: .3; cursor: default; }

/* Play is the dominant control, as on a music player. */
.hipno-player .hp-play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #a8df00;
    background: var(--hp-accent);
    color: #11131a;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.hipno-player .hp-play:hover { transform: scale(1.06); }
.hipno-player .hp-play--big { width: 62px; height: 62px; }

/* Triangle and bars drawn in CSS so no icon font is needed. */
.hipno-player .hp-play span {
    display: block;
    width: 0;
    height: 0;
    margin-left: 3px;
    border-left: 13px solid #11131a;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.hipno-player .hp-play--big span {
    border-left-width: 20px;
    border-top-width: 13px;
    border-bottom-width: 13px;
}

.hipno-player.is-playing .hp-play span {
    width: 13px;
    height: 16px;
    margin-left: 0;
    border: 0;
    background:
        linear-gradient(to right, #11131a 0 4px, transparent 4px 9px, #11131a 9px 13px);
}

.hipno-player.is-playing .hp-play--big span { width: 20px; height: 24px;
    background: linear-gradient(to right, #11131a 0 6px, transparent 6px 14px, #11131a 14px 20px); }

/* ---------- scrubber ---------- */
.hipno-player .hp-scrub {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 620px;
}

.hipno-player .hp-time {
    font-size: 11px;
    color: #9aa3b2;
    color: var(--hp-dim);
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
    min-width: 38px;
    text-align: center;
}

.hipno-player .hp-rail {
    position: relative;
    height: 4px;
    flex: 1 1 auto;
    background: rgba(255, 255, 255, .16);
    border-radius: 2px;
    cursor: pointer;
}

.hipno-player .hp-buffer {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0;
    background: rgba(255, 255, 255, .14);
    border-radius: 2px;
}

.hipno-player .hp-progress {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 0;
    background: #a8df00;
    background: var(--hp-accent);
    border-radius: 2px;
}

.hipno-player .hp-knob {
    position: absolute;
    right: -6px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transition: opacity .15s ease;
}

.hipno-player .hp-rail:hover .hp-knob,
.hipno-player .hp-rail:focus .hp-knob { opacity: 1; }

/* A preview stops early; show how far it reaches. */
.hipno-player.is-preview .hp-rail {
    background: repeating-linear-gradient(
        90deg, rgba(255,255,255,.16) 0 6px, rgba(255,255,255,.06) 6px 12px);
}

/* ---------- volume ---------- */
.hipno-player .hp-vol { display: flex; align-items: center; gap: 8px; }

.hipno-player .hp-vol-range {
    width: 88px;
    accent-color: #a8df00;
}

.hipno-player .hp-expand {
    background: none;
    border: 0;
    color: #f4f6f8;
    cursor: pointer;
    font-size: 13px;
    opacity: .7;
    padding: 6px;
}

.hipno-player .hp-expand:hover { opacity: 1; }

/* ---------- expanded stage ---------- */
.hipno-player .hp-stage {
    position: fixed;
    left: 0; right: 0; top: 0; bottom: 0;
    background: radial-gradient(circle at 50% 42%, #1b1e28 0%, #0a0b10 70%);
    display: none;
    overflow: auto;
}

.hipno-player.is-expanded .hp-stage { display: block; }
.hipno-player.is-expanded .hp-bar { position: relative; z-index: 2; }

.hipno-player .hp-stage-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: none;
    border: 0;
    color: #9aa3b2;
    font-size: 20px;
    cursor: pointer;
}

.hipno-player .hp-stage-inner {
    max-width: 1080px;
    margin: 0 auto;
    /* Tightened from 64/110: with the library underneath, generous padding pushed
       the cards off the first screen and left a dead band in the middle. */
    padding: 38px 24px 26px;
    display: flex;
    align-items: center;
    gap: 48px;
}

/* ---------- the spiral ---------- */
.hipno-player .hp-spiral-wrap {
    position: relative;
    flex: 0 0 auto;
    width: 420px;
    height: 420px;
}

.hipno-player .hp-spiral {
    width: 100%;
    height: 100%;
    display: block;
}

/* Artwork sits in the eye of the spiral, small, so the spiral leads. */
.hipno-player .hp-stage-art {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 118px;
    height: 118px;
    margin: -59px 0 0 -59px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
}

.hipno-player .hp-stage-meta { flex: 1 1 auto; min-width: 0; }

.hipno-player .hp-stage-product {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #9aa3b2;
    margin-bottom: 10px;
}

.hipno-player .hp-stage-title {
    font-size: 2rem;
    line-height: 1.2;
    margin: 0 0 14px;
    color: #f4f6f8;
    font-weight: 700;
}

.hipno-player .hp-stage-badge {
    display: inline-block;
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 100px;
    background: rgba(168, 223, 0, .14);
    color: #a8df00;
    margin-bottom: 26px;
}

.hipno-player.is-preview .hp-stage-badge {
    background: rgba(255, 255, 255, .08);
    color: #9aa3b2;
}

.hipno-player .hp-scrub--stage { max-width: none; margin-bottom: 22px; }
.hipno-player .hp-controls--stage { gap: 26px; margin-bottom: 28px; }

.hipno-player .hp-cta {
    display: none;
    background: #a8df00;
    color: #11131a;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: 100px;
    text-decoration: none;
}

.hipno-player.is-preview .hp-cta { display: inline-block; }
.hipno-player .hp-cta:hover { filter: brightness(1.08); }

/* ---------- narrow screens ---------- */
@media only screen and (max-width: 900px) {
    .hipno-player .hp-stage-inner {
        flex-direction: column;
        gap: 28px;
        padding-top: 42px;
    }
    .hipno-player .hp-spiral-wrap { width: 300px; height: 300px; }
    .hipno-player .hp-stage-title { font-size: 1.5rem; }
    .hipno-player .hp-stage-meta { text-align: center; }
    .hipno-player .hp-controls--stage { justify-content: center; }
}

@media only screen and (max-width: 640px) {
    body.hipno-player-on { padding-bottom: 64px; }
    .hipno-player .hp-bar { height: 64px; padding: 0 10px; gap: 10px; }
    .hipno-player .hp-bar-art { width: 44px; height: 44px; }
    /* On a phone the bar keeps artwork, title and play only. The scrubber and
       volume live in the expanded view, where there is room for them. */
    .hipno-player .hp-bar-center .hp-scrub,
    .hipno-player .hp-bar-right .hp-vol,
    .hipno-player .hp-bar-center .hp-prev,
    .hipno-player .hp-bar-center .hp-next { display: none; }
    .hipno-player .hp-bar-left { flex: 1 1 auto; }
    .hipno-player .hp-bar-center { flex: 0 0 auto; }
    .hipno-player .hp-bar-right { flex: 0 0 auto; }
}

/* Someone who prefers less motion should not be given a rotating spiral. */
@media (prefers-reduced-motion: reduce) {
    .hipno-player .hp-spiral { opacity: .35; }
}

/* ==========================================================================
   Chooser
   A pill at the head of the bar and the list it opens upward. Not a native
   select: an <option> is one run of text, so the solution name could never be
   set apart from the track name inside it.
   ========================================================================== */

.hipno-player .hp-pick {
    position: relative;
    flex: 0 0 auto;
    width: 250px;
}

.hipno-player .hp-pick-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 32px 0 13px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
    color: #f4f6f8;
    font: inherit;
    text-align: left;
    cursor: pointer;
    position: relative;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.hipno-player .hp-pick-btn:hover {
    border-color: rgba(168, 223, 0, .55);
    background: linear-gradient(180deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04));
}

.hipno-player .hp-pick-btn:focus {
    outline: none;
    border-color: #a8df00;
    border-color: var(--hp-accent, #a8df00);
    box-shadow: 0 0 0 3px rgba(168, 223, 0, .22);
}

.hipno-player .hp-pick.is-open .hp-pick-btn {
    border-color: #a8df00;
    border-color: var(--hp-accent, #a8df00);
    background: rgba(255, 255, 255, .1);
}

.hipno-player .hp-pick-ico {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #a8df00;
    stroke: var(--hp-accent, #a8df00);
    stroke-width: 1.7;
    stroke-linecap: round;
}

.hipno-player .hp-pick.is-unset .hp-pick-ico { stroke: #9aa3b2; }

.hipno-player .hp-pick-text {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.15;
}

.hipno-player .hp-pick-placeholder {
    display: none;
    font-size: 12.5px;
    font-weight: 500;
    color: #9aa3b2;
}

.hipno-player .hp-pick.is-unset .hp-pick-placeholder { display: block; }
.hipno-player .hp-pick.is-unset .hp-pick-current { display: none; }

.hipno-player .hp-pick-current { display: block; }

/* The solution name is the thing being chosen, so it carries the weight. */
.hipno-player .hp-pick-product {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #f4f6f8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hipno-player .hp-pick-track {
    display: block;
    margin-top: 1px;
    font-size: 10.5px;
    font-weight: 400;
    color: #9aa3b2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hipno-player .hp-pick-chev {
    position: absolute;
    right: 13px;
    top: 50%;
    margin-top: -3px;
    width: 11px;
    height: 7px;
    fill: none;
    stroke: #9aa3b2;
    stroke-width: 1.8;
    stroke-linecap: round;
    transition: transform .16s ease, stroke .15s ease;
}

.hipno-player .hp-pick-btn:hover .hp-pick-chev { stroke: #f4f6f8; }
.hipno-player .hp-pick.is-open .hp-pick-chev { transform: rotate(180deg); stroke: #f4f6f8; }

/* ---------- the list ---------- */

.hipno-player .hp-pick-panel {
    position: absolute;
    left: 0;
    /* Opens upward: the bar is pinned to the bottom of the window. */
    bottom: 54px;
    width: 340px;
    max-height: 62vh;
    display: flex;
    flex-direction: column;
    background: #14171f;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
    overflow: hidden;
    z-index: 5;
}

.hipno-player .hp-pick-panel[hidden] { display: none; }

.hipno-player .hp-pick-search {
    flex: 0 0 auto;
    padding: 11px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.hipno-player .hp-pick-filter {
    width: 100%;
    height: 34px;
    padding: 0 12px;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 17px;
    background: rgba(255, 255, 255, .05);
    color: #f4f6f8;
    font: 400 12.5px inherit;
    font-family: inherit;
}

.hipno-player .hp-pick-filter::-webkit-input-placeholder { color: #6f7887; }
.hipno-player .hp-pick-filter:focus {
    outline: none;
    border-color: rgba(168, 223, 0, .6);
    background: rgba(255, 255, 255, .08);
}

.hipno-player .hp-pick-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px 0 8px;
    -webkit-overflow-scrolling: touch;
}

.hipno-player .hp-pick-scroll::-webkit-scrollbar { width: 9px; }
.hipno-player .hp-pick-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .14);
    border-radius: 5px;
}

.hipno-player .hp-pick-sec[hidden] { display: none; }

.hipno-player .hp-pick-sec-label {
    padding: 9px 14px 5px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #6f7887;
}

.hipno-player .hp-pick-group[hidden] { display: none; }

.hipno-player .hp-pick-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 3px;
}

.hipno-player .hp-pick-art {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    background: #0d0f14;
}

/* The solution name, bold, in both shapes of row. */
.hipno-player .hp-pick-name {
    font-size: 12.5px;
    font-weight: 700;
    color: #f4f6f8;
    line-height: 1.25;
}

.hipno-player .hp-pick-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    cursor: pointer;
    border-left: 2px solid transparent;
}

.hipno-player .hp-pick-row:hover,
.hipno-player .hp-pick-row.is-active {
    background: rgba(255, 255, 255, .06);
}

.hipno-player .hp-pick-row.is-active { border-left-color: rgba(168, 223, 0, .5); }

.hipno-player .hp-pick-row.is-current {
    border-left-color: #a8df00;
    border-left-color: var(--hp-accent, #a8df00);
}

.hipno-player .hp-pick-row.is-current .hp-pick-name,
.hipno-player .hp-pick-row.is-current .hp-pick-row-track {
    color: #a8df00;
    color: var(--hp-accent, #a8df00);
}

.hipno-player .hp-pick-row-text { flex: 1 1 auto; min-width: 0; }

.hipno-player .hp-pick-row--track { padding: 5px 14px 5px 26px; }

.hipno-player .hp-pick-row-track {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11.5px;
    color: #b6bdc9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hipno-player .hp-pick-play {
    flex: 0 0 11px;
    width: 11px;
    height: 11px;
    fill: #6f7887;
    opacity: 0;
    transition: opacity .12s ease;
}

.hipno-player .hp-pick-row:hover .hp-pick-play,
.hipno-player .hp-pick-row.is-active .hp-pick-play { opacity: 1; }
.hipno-player .hp-pick-row.is-current .hp-pick-play {
    opacity: 1;
    fill: #a8df00;
    fill: var(--hp-accent, #a8df00);
}

.hipno-player .hp-pick-none {
    margin: 0;
    padding: 18px 14px;
    color: #6f7887;
    font-size: 12px;
    text-align: center;
}

.hipno-player .hp-pick-none[hidden] { display: none; }

/* A hairline between the chooser and the track it is playing. */
.hipno-player .hp-pick + .hp-bar-left {
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, .08);
}

/* ==========================================================================
   Library
   One set of styles for the cards, used by the player stage, the account
   dashboard and the digital materials page. Scoped on .hipno-lib, and the two
   themes it has to live in are handled by .hipno-lib--light.
   ========================================================================== */

.hipno-lib {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin: 26px 0 0;
}

.hipno-lib-head {
    margin: 0 0 14px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #9aa3b2;
}

.hipno-lib .hl-sec {
    margin: 0 0 26px;
}

.hipno-lib .hl-sec-head h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #f4f6f8;
}

.hipno-lib .hl-sec-head p {
    margin: 3px 0 13px;
    font-size: .85rem;
    color: #9aa3b2;
}

.hipno-lib .hl-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 16px;
}

.hipno-lib .hl-card {
    margin: 0;
    padding: 0;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 10px;
    overflow: hidden;
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}

.hipno-lib .hl-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .16);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}

.hipno-lib .hl-card.hipno-on {
    border-color: #a8df00;
    border-color: var(--hp-accent, #a8df00);
}

.hipno-lib .hl-card-art {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    background: #11131a;
}

.hipno-lib .hl-card-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hipno-lib .hl-card-play {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #a8df00;
    background: var(--hp-accent, #a8df00);
    color: #11131a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
    opacity: .94;
    transition: transform .12s ease, opacity .12s ease;
}

.hipno-lib .hl-card-play:hover { transform: scale(1.07); opacity: 1; }
.hipno-lib .hl-card-play:focus { outline: 2px solid #fff; outline-offset: 2px; }
.hipno-lib .hl-card-play svg { width: 19px; height: 19px; fill: currentColor; display: block; }
.hipno-lib .hl-card-play .hl-ico-pause { display: none; }
.hipno-lib .hl-card-play.hipno-on .hl-ico-pause { display: block; }
.hipno-lib .hl-card-play.hipno-on .hl-ico-play { display: none; }

.hipno-lib .hl-card-flag {
    position: absolute;
    left: 9px;
    top: 9px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: #a8df00;
    background: var(--hp-accent, #a8df00);
    color: #11131a;
}

.hipno-lib .hl-card-flag--demo {
    background: rgba(17, 19, 26, .78);
    color: #f4f6f8;
}

.hipno-lib .hl-card-body {
    padding: 11px 12px 13px;
}

.hipno-lib .hl-card-name {
    display: block;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.3;
    color: #f4f6f8;
    text-decoration: none;
    /* Two lines, then ellipsis: names here run long and a ragged grid reads badly. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hipno-lib .hl-card-name:hover { text-decoration: underline; }

.hipno-lib .hl-card-meta {
    display: block;
    margin-top: 4px;
    font-size: .76rem;
    color: #9aa3b2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hipno-lib .hl-tracks {
    list-style: none;
    margin: 9px 0 0;
    padding: 9px 0 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.hipno-lib .hl-track-play {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 5px 0;
    border: 0;
    background: none;
    color: #cfd6e0;
    font: inherit;
    font-size: .78rem;
    text-align: left;
    cursor: pointer;
}

.hipno-lib .hl-track-play:hover { color: #fff; }
.hipno-lib .hl-track-play svg { width: 11px; height: 11px; fill: currentColor; flex: 0 0 11px; }
.hipno-lib .hl-track-play.hipno-on { color: #a8df00; color: var(--hp-accent, #a8df00); font-weight: 700; }
.hipno-lib .hl-track-play span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- the same library on a white page ---------- */

.hipno-lib--light .hipno-lib-head,
.hipno-lib--light .hl-sec-head h3 { color: #1a202c; }
.hipno-lib--light .hl-sec-head p { color: #718096; }

.hipno-lib--light .hl-card {
    background: #fff;
    border-color: #e6ebf1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}

.hipno-lib--light .hl-card:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, .1); border-color: #cbd5e0; }
.hipno-lib--light .hl-card-art { background: #f2f5f8; }
.hipno-lib--light .hl-card-name { color: #1a202c; }
.hipno-lib--light .hl-card-meta { color: #718096; }
.hipno-lib--light .hl-tracks { border-top-color: #edf2f7; }
.hipno-lib--light .hl-track-play { color: #4a5568; }
.hipno-lib--light .hl-track-play:hover { color: #1a202c; }
.hipno-lib--light .hl-track-play.hipno-on { color: #2b6cb0; }

/* The stage already scrolls; the library sits under the spiral and the meta. */
.hipno-player .hp-stage .hipno-lib {
    max-width: 1100px;
    margin: 0 auto 40px;
    padding: 0 24px 90px;
}

/* The demo flag reads as a word, not a count, so it is not shouted in caps. */
.hipno-lib .hl-card-flag--demo { text-transform: none; letter-spacing: .02em; }

@media only screen and (max-width: 900px) {
    /* Collapsed to the icon, so the artwork and the title keep the room. The list
       it opens is still full width, which is where the choosing happens anyway. */
    .hipno-player .hp-pick { width: 52px; }
    .hipno-player .hp-pick-btn { padding: 0 26px 0 13px; }
    .hipno-player .hp-pick-text { display: none; }
    .hipno-player .hp-pick-chev { right: 9px; }
    .hipno-player .hp-pick-panel { width: 88vw; max-width: 340px; }
    .hipno-player .hp-pick + .hp-bar-left { padding-left: 12px; }
}

@media only screen and (max-width: 760px) {
    .hipno-lib .hl-grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }
    .hipno-lib .hl-card-play { width: 38px; height: 38px; }
}

/* ==========================================================================
   Account pages
   The dashboard and the materials page are the same library, so they get the
   same frame around it. The theme's own .box-account sets the border and the
   shadow; only what the library needs is added here.
   ========================================================================== */

.hipno-dash-block { margin-bottom: 26px; }

.hipno-dash-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.hipno-dash-head a {
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
}

/* The dashboard already has a heading for the block, so the library's own
   section headings would repeat it. */
.hipno-dash-block .hipno-lib { margin-top: 12px; }
.hipno-dash-block .hipno-lib-head { display: none; }
.hipno-dash-block .hl-sec--mine > .hl-sec-head { display: none; }

.hipno-docs,
.hipno-pending {
    margin: 26px 0 0;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e6ebf1;
    border-radius: 3px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.hipno-docs h3,
.hipno-pending h3 {
    margin: 0 0 11px;
    font-size: .95rem;
    font-weight: 700;
    color: #1a202c;
}

.hipno-docs ul,
.hipno-pending ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hipno-docs li {
    padding: 8px 0;
    border-top: 1px solid #edf2f7;
    font-size: .88rem;
}

.hipno-docs li:first-child { border-top: 0; }
.hipno-docs li a { font-weight: 600; }
.hipno-docs li span { color: #718096; margin-left: 8px; font-size: .8rem; }

.hipno-pending { border-left: 4px solid #f6ad55; }

.hipno-pending li {
    padding: 9px 0;
    border-top: 1px solid #edf2f7;
    font-size: .86rem;
    color: #4a5568;
}

.hipno-pending li:first-child { border-top: 0; }
.hipno-pending li strong { display: block; color: #1a202c; }
.hipno-pending li span { display: block; color: #718096; font-size: .8rem; }
.hipno-pending li a { font-size: .78rem; }

.hipno-empty {
    margin: 22px 0;
    padding: 18px 20px;
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
    border-radius: 3px;
    color: #4a5568;
    font-size: .9rem;
}

/* ==========================================================================
   Keeping a track on the device
   A second control on a card, next to the play button but distinct from it: one
   starts the audio, the other decides whether it will still be there on a train.
   ========================================================================== */

.hipno-lib .hl-keep {
    position: absolute;
    left: 9px;
    bottom: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(17, 19, 26, .72);
    color: #f4f6f8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .14s ease, border-color .14s ease, transform .12s ease;
}

.hipno-lib .hl-keep:hover { transform: scale(1.06); border-color: rgba(255, 255, 255, .45); }
.hipno-lib .hl-keep:focus { outline: 2px solid #a8df00; outline-offset: 2px; }

.hipno-lib .hl-keep svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hipno-lib .hl-keep .hl-keep-on { display: none; }

/* Already here: the control becomes a statement rather than an invitation. */
.hipno-lib .hl-keep.is-stored {
    background: #a8df00;
    background: var(--hp-accent, #a8df00);
    border-color: transparent;
    color: #11131a;
}

.hipno-lib .hl-keep.is-stored .hl-keep-on { display: block; }
.hipno-lib .hl-keep.is-stored .hl-keep-off { display: none; }

/* Working on it. The spin is slow on purpose: a 36MB track is not instant and a
   frantic animation would suggest otherwise. */
.hipno-lib .hl-keep.is-busy {
    cursor: progress;
    border-color: rgba(168, 223, 0, .5);
    animation: hp-keep-pulse 1.4s ease-in-out infinite;
}

@keyframes hp-keep-pulse {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}

.hipno-lib .hl-forget {
    margin-top: 9px;
    padding: 5px 11px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 13px;
    background: none;
    color: #9aa3b2;
    font: inherit;
    font-size: .74rem;
    cursor: pointer;
}

.hipno-lib .hl-forget:hover { color: #f4f6f8; border-color: rgba(255, 255, 255, .34); }

/* The offline page's own library: same cards, no section headings to speak of. */
.hipno-lib--offline { margin-top: 6px; }
.hipno-lib--offline .hl-sec { margin-bottom: 0; }

@media only screen and (max-width: 760px) {
    .hipno-lib .hl-keep { width: 30px; height: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .hipno-lib .hl-keep.is-busy { animation: none; opacity: .7; }
}

/* ==========================================================================
   Catalog fixes that have to live here rather than in local.css
   --------------------------------------------------------------------------
   These rules are not about the player. They are here because this is the only
   stylesheet on the site that actually reaches a returning visitor: Bar.php emits it
   as hipno-player.css?v=<mtime>, so every change gets a fresh url.

   /skin is served with Cache-Control: max-age=315360000 and Expires 2037, and
   Cloudflare caches it at the edge on top of that. local.css was answering with a copy
   whose Last-Modified was February 2021, cf-cache-status HIT, Age 21 days - so edits to
   it were invisible to browsers and to the CDN alike. Fetching it with a cache busting
   query returned the new file and made the deploy look fine, which is exactly how this
   was missed the first time.

   The durable fix for the theme as a whole is to version its stylesheet urls the same
   way, or to purge the edge cache on deploy. Until then, put anything that must take
   effect immediately in this file.
   ========================================================================== */

@media only screen and (max-width: 979px) {
    /*
     * The product image frame. local.css line 2271 gives .product-img-box a flat
     * width:363px; added to the container's left padding that reaches past the right edge
     * of a 412px viewport, so the card is clipped down its right hand side while the
     * image inside it scales correctly - which is precisely how it was reported.
     *
     * media.phtml then writes the wrapper's own size inline in pixels
     * (style="width:494px; height:494px"), and an inline style needs !important.
     */
    .product-view .product-img-box {
        width: auto !important;
        max-width: 100%;
    }

    .product-view .product-img-box .product-image,
    .product-view .product-img-box .product-image-zoom {
        width: auto !important;
        height: auto !important;
        max-width: 100%;
    }

    /*
     * The image has to come back into flow, and this is not cosmetic.
     *
     * cloud-zoom positions #image absolutely, which is why the template sets an explicit pixel
     * height on the wrapper: out of flow, the image contributes nothing to its parent's height.
     * Release the height without releasing the positioning and the frame collapses to 0px -
     * the card renders empty and the image is drawn over the content beneath it.
     *
     * Static positioning lets the image define the frame's height again. The zoom lens is lost
     * on small screens, which is no loss: it is a hover affordance and there is no hover here.
     */
    .product-view .product-img-box .product-image img,
    .product-view .product-img-box .product-image-zoom img {
        position: static !important;
        width: auto !important;
        height: auto !important;
        max-width: 100%;
        display: block;
        margin: 0 auto;
    }

    /* The gallery strip receives pixel widths from inline script for the same reason. */
    .product-view .product-img-box .more-views .jcarousel-skin-tango .jcarousel-container-horizontal,
    .product-view .product-img-box .more-views .jcarousel-skin-tango .jcarousel-clip-horizontal {
        width: 100% !important;
        max-width: 100%;
    }

    /*
     * The lightbox is FancyBox 1.3.4, from 2010, which predates responsive layouts: it
     * measures the image and writes width, height and left onto its containers in pixels,
     * so on a phone it opens wider than the screen and offset from a position computed for
     * a desktop viewport. The 20px padding stays - it is the skin's border and the close
     * button is positioned against it.
     */
    #fancybox-wrap {
        left: 0 !important;
        right: 0 !important;
        margin: 0 auto !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }

    #fancybox-outer,
    #fancybox-content {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }

    #fancybox-content > div,
    #fancybox-content img,
    #fancybox-img {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
    }

    /* The other popup: gallery.phtml opened via popWin, also sized inline in pixels. */
    .product-image-popup {
        width: auto !important;
        max-width: 100% !important;
    }

    .product-image-popup img {
        width: auto !important;
        height: auto !important;
        max-width: 100% !important;
    }
}
