/* LoopToSong Toolkit · Space and panning. Everything scoped under #p360-terbeliseg. */
#p360-terbeliseg {
  /* instrument groups: distinct but calm on charcoal, ink text stays readable on all four */
  --c-bas: #D597A8;
  --c-rit: #D2B46E;
  --c-vok: #86C3B4;
  --c-har: #A99CD8;
  display: block;
  color: var(--p-text);
  font-family: var(--p-font);
}
#p360-terbeliseg * { box-sizing: border-box; }
#p360-terbeliseg .c-bas { background: var(--c-bas); fill: var(--c-bas); }
#p360-terbeliseg .c-rit { background: var(--c-rit); fill: var(--c-rit); }
#p360-terbeliseg .c-vok { background: var(--c-vok); fill: var(--c-vok); }
#p360-terbeliseg .c-har { background: var(--c-har); fill: var(--c-har); }

#p360-terbeliseg .wrap { max-width: 1280px; margin: 0 auto; padding: 36px 20px 8px; }
@media (min-width: 900px) { #p360-terbeliseg .wrap { padding: 48px 56px 8px; } }

#p360-terbeliseg h1 { font-weight: 700; font-size: clamp(44px, 8.4vw, 92px); line-height: 0.92; letter-spacing: -0.04em; color: var(--p-head); margin: 0 0 16px; }
#p360-terbeliseg .lead { color: var(--p-muted); font-size: clamp(15px, 1.7vw, 18px); max-width: 68ch; line-height: 1.55; margin: 0; }
#p360-terbeliseg .lead b { color: var(--p-text); }
#p360-terbeliseg .lead b.hl { color: var(--p-sage); }

#p360-terbeliseg .sec { margin-top: 40px; }
/* the stage is the tool: it comes right after the purpose line; how to read it sits under it */
#p360-terbeliseg .stage-card { margin-top: 22px; }
#p360-terbeliseg .card .csub-after { margin: 10px 0 0; color: var(--p-muted); }
#p360-terbeliseg .sec-n, #p360-terbeliseg .acc-n { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--p-muted); margin-bottom: 8px; }
#p360-terbeliseg .sec-t { font-weight: 700; font-size: clamp(28px, 4.4vw, 44px); line-height: 1; letter-spacing: -0.04em; color: var(--p-head); margin: 0 0 12px; }
#p360-terbeliseg .sec-lead { color: var(--p-muted); font-size: 15px; line-height: 1.6; max-width: 78ch; margin: 0 0 18px; }
#p360-terbeliseg .sec-lead b { color: var(--p-text); }

#p360-terbeliseg .card { background: var(--p-panel); border: 1px solid var(--p-line); border-radius: 8px; padding: 18px 20px; }
#p360-terbeliseg .card + .card { margin-top: 14px; }
#p360-terbeliseg .card .ch { font-weight: 700; font-size: 20px; letter-spacing: -0.02em; margin: 0 0 4px; color: var(--p-head); }
#p360-terbeliseg .card .csub { font-size: 13px; color: var(--p-faint); margin: 0 0 14px; line-height: 1.45; }

/* frequency → width */
#p360-terbeliseg .freq-box { overflow-x: auto; }
#p360-terbeliseg .freq-svg { display: block; width: 100%; min-width: 440px; height: auto; max-width: 680px; margin: 0 auto; }
#p360-terbeliseg .fq-base { stroke: var(--p-line-2); stroke-width: 1; stroke-dasharray: 3 4; }
#p360-terbeliseg .fq-zt { font-family: var(--p-font); font-weight: 700; font-size: 11px; letter-spacing: 0.04em; fill: var(--p-sage); }
#p360-terbeliseg .fq-hz { font-family: var(--p-mono); font-size: 8.5px; fill: var(--p-muted); }
#p360-terbeliseg .fq-ex { font-family: var(--p-font); font-size: 9.5px; fill: var(--p-muted); }
#p360-terbeliseg .fq-cap { font-family: var(--p-font); font-weight: 600; font-size: 9px; letter-spacing: 0.07em; fill: var(--p-faint); text-transform: uppercase; }

/* the stage */
#p360-terbeliseg .stage-svg { display: block; width: 100%; height: auto; background: var(--p-deep); border: 1px solid var(--p-line); border-radius: 6px; }
#p360-terbeliseg .stage-box { overflow-x: auto; border-radius: 6px; }
#p360-terbeliseg .swipe-hint { display: none; margin: 8px 0 0; font-size: 12px; color: var(--p-faint); }
@media (max-width: 560px) { #p360-terbeliseg .stage-svg { width: 620px; max-width: none; } #p360-terbeliseg .swipe-hint { display: block; } }
#p360-terbeliseg .mk { cursor: pointer; outline: none; }
#p360-terbeliseg .mk-hit { fill: transparent; }
/* the narrow (mono) markers get a hit area at least 51 stage units wide (44 px on a phone's 620 px stage).
   Only sideways: the centre column is too tight to grow taller without taking taps from the marker above or below. */
#p360-terbeliseg .mk-hit { transform-box: fill-box; transform-origin: center; }
#p360-terbeliseg :is(.mk[data-id="bass"], .mk[data-id="kick"], .mk[data-id="bgvL"], .mk[data-id="bgvR"], .mk[data-id="adlibL"], .mk[data-id="adlibR"], .mk[data-id="gtrL"], .mk[data-id="gtrR"]) .mk-hit { transform: scaleX(1.9); }
#p360-terbeliseg .mk[data-id="vox"] .mk-hit { transform: scaleX(1.65); }
#p360-terbeliseg .mk[data-id="hat"] .mk-hit { transform: scaleX(1.17); }
/* the wide bars drawn on top of a neighbour keep their hit area to the bar's own height, so the bass, kick, ad-lib (right)
   and backing vocal (left) under them stay tappable */
#p360-terbeliseg :is(.mk[data-id="snare"], .mk[data-id="oh"], .mk[data-id="solo"], .mk[data-id="strings"]) .mk-hit { transform: scaleY(0.68); }
#p360-terbeliseg .mk-bar { stroke: var(--p-deep); stroke-width: 1.4; transition: opacity 0.15s; }
#p360-terbeliseg .mk-ring { fill: none; stroke-width: 2.5; opacity: 0; transition: opacity 0.15s; pointer-events: none; } /* invisible until selected: it must not catch taps meant for the marker under it */
#p360-terbeliseg .mk-lab { font-family: var(--p-font); font-weight: 700; font-size: 8.5px; text-anchor: middle; dominant-baseline: central; fill: var(--p-ink); pointer-events: none; letter-spacing: 0.01em; }
#p360-terbeliseg .mk.sel .mk-bar { stroke: var(--p-text); stroke-width: 2.4; }
#p360-terbeliseg .mk.sel .mk-ring, #p360-terbeliseg .mk.pr .mk-ring { opacity: 1; }
#p360-terbeliseg .mk.pr .mk-ring { stroke-dasharray: 2.5 3; }
#p360-terbeliseg .mk:hover .mk-ring { opacity: 0.5; }
#p360-terbeliseg .mk:focus-visible .mk-ring { opacity: 1; stroke: var(--p-sage-hi) !important; }
#p360-terbeliseg .axt { font-family: var(--p-font); font-weight: 600; font-size: 9px; letter-spacing: 0.07em; fill: var(--p-muted); text-transform: uppercase; }
#p360-terbeliseg .axt.dim { fill: var(--p-faint); }
#p360-terbeliseg .axline { stroke: var(--p-line-2); stroke-width: 1; stroke-dasharray: 3 4; }
#p360-terbeliseg .stagefloor { fill: #262826; stroke: var(--p-line-2); stroke-width: 1.1; }
#p360-terbeliseg .listener-b { fill: var(--p-panel-2); stroke: var(--p-sage); stroke-width: 1.4; }
#p360-terbeliseg .listener-h { fill: var(--p-sage); }
#p360-terbeliseg .readout { margin-top: 12px; background: var(--p-deep); border: 1px solid var(--p-line); border-left: 3px solid var(--p-sage); border-radius: 6px; padding: 12px 14px; font-size: 14px; line-height: 1.5; color: var(--p-muted); min-height: 48px; }
#p360-terbeliseg .readout .rn { font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--p-sage); margin-right: 10px; }
#p360-terbeliseg .readout .rp { font-family: var(--p-mono); font-size: 11px; color: var(--p-faint); }
#p360-terbeliseg .readout b { color: var(--p-text); }
#p360-terbeliseg .readout.empty { color: var(--p-faint); border-left-color: var(--p-line-2); }
#p360-terbeliseg .legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
#p360-terbeliseg .legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--p-muted); }
#p360-terbeliseg .legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
#p360-terbeliseg .legend .wnote { width: 100%; display: block; font-size: 12.5px; color: var(--p-faint); margin-top: 2px; }
#p360-terbeliseg .legend .wnote b { color: var(--p-muted); font-weight: 600; }

/* accordions */
/* display: block: the shared account menu (assets/account.css) also uses the class .acc, as inline-flex */
#p360-terbeliseg .acc { display: block; border: 1px solid var(--p-line); border-radius: 8px; background: var(--p-panel); margin-top: 14px; overflow: hidden; }
#p360-terbeliseg .acc > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 20px; min-height: 64px; user-select: none; }
#p360-terbeliseg .acc > summary::-webkit-details-marker { display: none; }
#p360-terbeliseg .acc > summary:hover .acc-t { color: var(--p-text); }
#p360-terbeliseg .acc > summary:focus-visible { outline-offset: -3px; }
#p360-terbeliseg .acc-h { flex: 1; display: flex; flex-direction: column; gap: 4px; }
#p360-terbeliseg .acc-n { margin-bottom: 0; }
#p360-terbeliseg .acc-t { font-weight: 700; font-size: clamp(19px, 2.4vw, 24px); letter-spacing: -0.03em; color: var(--p-head); line-height: 1.1; }
#p360-terbeliseg .acc-chev { flex: 0 0 auto; color: var(--p-muted); font-size: 14px; transition: transform 0.2s ease; }
#p360-terbeliseg .acc[open] .acc-chev { transform: rotate(180deg); }
#p360-terbeliseg .acc[open] > summary { border-bottom: 1px solid var(--p-line); margin-bottom: 18px; }
#p360-terbeliseg .acc-b { padding: 0 20px 20px; }

/* cheat sheet */
#p360-terbeliseg .note-band { background: var(--p-sage-dim); border: 1px solid var(--p-line); border-left: 3px solid var(--p-sage); border-radius: 6px; padding: 12px 14px; margin-bottom: 16px; font-size: 14px; line-height: 1.55; color: var(--p-muted); }
#p360-terbeliseg .note-band b { color: var(--p-text); }
#p360-terbeliseg .cheat { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
#p360-terbeliseg .cc { background: var(--p-panel-2); border: 1px solid var(--p-line); border-radius: 6px; padding: 13px 14px; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
#p360-terbeliseg .cc:hover { border-color: var(--p-line-2); }
#p360-terbeliseg .cc:focus-visible { outline: 2px solid var(--p-sage-hi); outline-offset: 2px; }
#p360-terbeliseg .cc.sel { border-color: var(--ac); box-shadow: 0 0 0 1px var(--ac); }
#p360-terbeliseg .cc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#p360-terbeliseg .cc-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
#p360-terbeliseg .cc-name { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--p-sage-hi); line-height: 1.15; }
#p360-terbeliseg .cc-pair { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: 0.07em; color: var(--p-muted); text-transform: uppercase; border: 1px solid var(--p-line-2); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
#p360-terbeliseg .cc-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
#p360-terbeliseg .cc-meta b { font-family: var(--p-mono); font-size: 10.5px; font-weight: 500; color: var(--p-text); background: var(--p-deep); border: 1px solid var(--p-line); border-radius: 4px; padding: 3px 7px; }
#p360-terbeliseg .cc-meta b u { text-decoration: none; color: var(--p-faint); margin-right: 5px; font-family: var(--p-font); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; font-size: 9.5px; }
#p360-terbeliseg .cc-tip { font-size: 13.5px; line-height: 1.5; color: var(--p-muted); }
#p360-terbeliseg .cc-tip b { color: var(--p-text); }

/* how to do it */
#p360-terbeliseg .how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 760px) { #p360-terbeliseg .how { grid-template-columns: 1fr; } }
#p360-terbeliseg .hcard { background: var(--p-panel-2); border: 1px solid var(--p-line); border-top: 3px solid var(--p-sage); border-radius: 6px; padding: 15px 16px; }
#p360-terbeliseg .hcard h4 { font-weight: 700; font-size: 21px; letter-spacing: -0.03em; margin: 0 0 3px; color: var(--p-head); }
#p360-terbeliseg .hcard .hl { font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--p-faint); margin: 0 0 12px; line-height: 1.4; }
#p360-terbeliseg .hcard ul { margin: 0; padding-left: 0; list-style: none; }
#p360-terbeliseg .hcard li { font-size: 13.5px; line-height: 1.5; color: var(--p-muted); padding: 8px 0; border-top: 1px solid var(--p-line); }
#p360-terbeliseg .hcard li:first-child { border-top: none; padding-top: 0; }
#p360-terbeliseg .hcard li b { color: var(--p-text); }
#p360-terbeliseg .rev-types { margin-top: 18px; border-top: 1px solid var(--p-line); padding-top: 16px; }
#p360-terbeliseg .rev-h { font-weight: 700; font-size: 18px; letter-spacing: -0.02em; color: var(--p-head); margin: 0 0 12px; }
#p360-terbeliseg .rev-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { #p360-terbeliseg .rev-grid { grid-template-columns: 1fr; } }
#p360-terbeliseg .rev { background: var(--p-panel-2); border: 1px solid var(--p-line); border-radius: 6px; padding: 13px 14px; }
#p360-terbeliseg .rev > b { display: block; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--p-sage-hi); margin-bottom: 4px; }
#p360-terbeliseg .rev span { font-size: 13.5px; line-height: 1.5; color: var(--p-muted); }
#p360-terbeliseg .rev span b { color: var(--p-text); font-weight: 700; }

/* research blocks (widening / M-S) */
#p360-terbeliseg .rblock { margin-bottom: 20px; }
#p360-terbeliseg .rblock:last-child { margin-bottom: 0; }
#p360-terbeliseg .rblock h4 { font-weight: 700; font-size: 20px; letter-spacing: -0.03em; margin: 0 0 8px; color: var(--p-sage); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
#p360-terbeliseg .rblock h4 .tag { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; border-radius: 4px; padding: 3px 7px; }
#p360-terbeliseg .tag.no { color: var(--p-warn); border: 1px solid rgba(226, 194, 125, .55); background: rgba(226, 194, 125, .1); }
#p360-terbeliseg .tag.ok { color: var(--p-sage); border: 1px solid var(--p-line-2); background: var(--p-sage-dim); }
#p360-terbeliseg .rblock p { margin: 0 0 10px; font-size: 14px; line-height: 1.6; color: var(--p-muted); max-width: 86ch; }
#p360-terbeliseg .rblock p:last-child { margin-bottom: 0; }
#p360-terbeliseg .rblock b { color: var(--p-text); }
#p360-terbeliseg .rblock .good { color: var(--p-good); font-weight: 700; }
#p360-terbeliseg .rblock .bad { color: var(--p-warn); font-weight: 700; }

/* golden rules */
#p360-terbeliseg .rules h2 { font-weight: 700; font-size: clamp(24px, 3.2vw, 32px); letter-spacing: -0.04em; color: var(--p-head); margin: 0 0 16px; }
#p360-terbeliseg .rulegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
#p360-terbeliseg .rule { display: flex; gap: 12px; align-items: flex-start; background: var(--p-panel-2); border: 1px solid var(--p-line); border-radius: 6px; padding: 13px 14px; }
#p360-terbeliseg .rule .ri { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 4px; background: var(--p-sage-dim); color: var(--p-sage); display: flex; align-items: center; justify-content: center; }
#p360-terbeliseg .rule p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--p-muted); }
#p360-terbeliseg .rule b { color: var(--p-text); }
#p360-terbeliseg .rule a { color: var(--p-sage); text-decoration: none; border-bottom: 1px solid var(--p-sage-2); }
#p360-terbeliseg .rule a:hover { color: var(--p-text); border-color: var(--p-text); }

#p360-terbeliseg .outro { margin: 32px 0 0; padding-top: 18px; border-top: 1px solid var(--p-line); font-size: 14px; color: var(--p-faint); }

@media (max-width: 560px) {
  #p360-terbeliseg .card, #p360-terbeliseg .acc > summary { padding-left: 14px; padding-right: 14px; }
  #p360-terbeliseg .acc-b { padding: 0 14px 16px; }
  #p360-terbeliseg .cheat { grid-template-columns: 1fr; }
}
/* phone readability: the small diagram labels one step larger */
#p360-terbeliseg .fq-cap, #p360-terbeliseg .axt { font-size: 11px; }
