/* Aureality favourites, layer sets and connections (au-sets.js). Uses the sidebar's colour tokens; works in the dark and the grey-light theme. */

.au-sb, .au-ss-dlg {
  --ss-gold: #FFC857; --ss-gold-ink: #FFC857; --ss-warn: #FF8A6B; --ss-neg: #FF9F7A; --ss-solid: #11151B; --ss-card: rgba(255,255,255,.035);
  --ss-mono: var(--mono, ui-monospace, "SF Mono", Menlo, monospace);
}
:root[data-au-theme="light"] .au-sb, :root[data-au-theme="light"] .au-ss-dlg {
  --ss-gold: #E0A100; --ss-gold-ink: #8A5A00; --ss-warn: #C2410C; --ss-neg: #C2410C; --ss-solid: #E6E9ED; --ss-card: rgba(255,255,255,.45);
}

/* ---------- Sets / Connections buttons at the top of the sidebar ---------- */
.au-ss-bar { display: flex; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--sb-line); }
.au-ss-tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--sb-line); border-radius: 999px; background: var(--sb-alt); color: var(--sb-text); font: inherit; font-size: 13.5px; line-height: 1; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s; }
.au-ss-tab svg { width: 16px; height: 16px; flex: none; }
.au-ss-tab:hover, .au-ss-tab[aria-expanded="true"] { border-color: var(--sb-hi); color: var(--sb-hi); }

/* ---------- the Sets panel ---------- */
.au-ss-panel { padding: 2px 12px 10px; border-bottom: 1px solid var(--sb-line); }
.au-ss-sec { padding: 10px 0 6px; }
.au-ss-sec + .au-ss-sec { border-top: 1px solid var(--sb-line); }
.au-ss-sec h3, .au-ss-topic { margin: 2px 0 6px; font: 500 10.5px/1.2 var(--ss-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--sb-muted); }
.au-ss-note { margin: 0 0 8px; color: var(--sb-muted); font-size: 12.5px; line-height: 1.45; font-weight: 300; transition: color .2s; }
.au-ss-ok { color: var(--sb-hi) !important; font-weight: 400; }
.au-ss-btns { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.au-ss-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px; border: 1px solid var(--sb-line); border-radius: 999px;
  background: none; color: var(--sb-text); font: inherit; font-size: 12.5px; line-height: 1.2; cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.au-ss-btn svg { width: 14px; height: 14px; flex: none; }
.au-ss-btn:hover { border-color: var(--sb-hi); }
.au-ss-main { background: var(--sb-on); border-color: var(--sb-on); color: #fff; }
.au-ss-main:hover { filter: brightness(1.1); border-color: var(--sb-on); }
.au-ss-mapbtn[aria-pressed="true"] { border-color: var(--sb-hi); color: var(--sb-hi); }
.au-ss-list { list-style: none; margin: 0 -6px; padding: 0; }
.au-ss-set { position: relative; display: flex; align-items: stretch; gap: 2px; border-radius: 12px; transition: background .15s; }
.au-ss-set + .au-ss-set { margin-top: 2px; }
.au-ss-set.au-ss-on { background: color-mix(in srgb, var(--sb-hi) 12%, transparent); }
.au-ss-set.au-ss-on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--sb-hi); }
.au-ss-pick { flex: 1; min-width: 0; padding: 8px 8px 8px 10px; border: 0; border-radius: 12px; background: none; color: var(--sb-text); font: inherit; text-align: left; cursor: pointer; }
.au-ss-pick:hover { background: var(--sb-alt); }
.au-ss-name { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 1.3; }
.au-ss-name > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.au-ss-pill { display: none; flex: none; padding: 2px 7px; border-radius: 999px; background: var(--sb-hi); color: var(--ss-solid); font: 600 9.5px/1.3 var(--ss-mono); text-transform: uppercase; letter-spacing: .06em; }
.au-ss-on .au-ss-pill { display: inline-block; }
.au-ss-pick small { display: block; margin-top: 3px; color: var(--sb-muted); font-size: 12px; line-height: 1.4; font-weight: 300; }
.au-ss-count { display: inline-block; margin-top: 5px; color: var(--sb-muted); font: 400 10.5px/1 var(--ss-mono); letter-spacing: .03em; }
.au-ss-icon { flex: none; display: inline-grid; place-items: center; min-width: 34px; padding: 0 6px; border: 0; border-radius: 10px; background: none; color: var(--sb-muted); font: inherit; font-size: 16px; cursor: pointer; }
.au-ss-icon svg { width: 16px; height: 16px; }
.au-ss-icon:hover { color: var(--sb-hi); background: var(--sb-alt); }
.au-ss-warn { color: var(--ss-warn) !important; font-size: 12px; }
.au-ss-form { display: flex; gap: 6px; margin-top: 8px; }
.au-ss-form input, .au-ss-search, .au-ss-sel { min-height: 34px; padding: 0 12px; border: 1px solid var(--sb-line); border-radius: 999px; background: var(--sb-alt); color: var(--sb-text); font: inherit; font-size: 13px; }
.au-ss-form input { flex: 1; min-width: 0; }
.au-ss-form input:focus, .au-ss-search:focus, .au-ss-sel:focus { outline: none; border-color: var(--sb-hi); }
.au-ss-form input::placeholder, .au-ss-search::placeholder { color: var(--sb-muted); opacity: .8; }

/* ---------- stars next to the layers, Favourites group ---------- */
.au-ss-line { display: flex; align-items: center; gap: 2px; }
.au-ss-line > .au-sb-row { flex: 1; min-width: 0; }
.au-ss-star { flex: none; display: grid; place-items: center; width: 30px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--sb-muted); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, transform .15s; }
.au-ss-star svg { width: 15px; height: 15px; }
.au-sb-item:hover .au-ss-star, .au-ss-star:focus-visible, .au-ss-star[aria-pressed="true"] { opacity: 1; }
.au-ss-star[aria-pressed="true"] { color: var(--ss-gold); --star-fill: var(--ss-gold); }
.au-ss-star:hover { color: var(--ss-gold); }
.au-ss-star:active { transform: scale(.85); }
@media (hover: none), (pointer: coarse) { .au-ss-star { opacity: .55; width: 40px; height: 44px; } }
.au-ss-favs > summary { color: var(--sb-text); }
.au-ss-favs.au-ss-empty .au-sb-note { font-style: normal; }

/* ---------- Connections: a pane on the right on wide screens, a sheet from the bottom on phones ---------- */
.au-ss-dlg { position: fixed; z-index: 60; top: calc(var(--ax-top-h, 64px) + 12px); right: 12px; bottom: 16px; width: min(480px, calc(100vw - 24px));
  display: flex; flex-direction: column; background: var(--au-pane, rgba(17,21,27,.97)); color: var(--sb-text, #F5F7FB);
  border: 1px solid var(--sb-line, #262C36); border-radius: 16px; box-shadow: 0 18px 50px rgba(0,0,0,.45); overflow: hidden;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  --sb-line: var(--line, #262C36); --sb-muted: var(--muted, #A4ADBA); --sb-hi: var(--hi, #8DBBFF); --sb-alt: var(--alt, #0E1116); --sb-on: var(--button, #2563EB); --sb-text: var(--text, #F5F7FB);
  animation: au-ss-in .18s ease-out; }
@keyframes au-ss-in { from { opacity: 0; transform: translateY(8px); } }
:root[data-au-theme="light"] .au-ss-dlg { box-shadow: 0 18px 50px rgba(20,25,32,.25); }
.au-ss-dlg[hidden] { display: none; }
.au-ss-dhead, .au-ss-tabs { flex: none; }
.au-ss-dhead { display: flex; align-items: flex-start; gap: 8px; padding: 14px 10px 8px 18px; }
.au-ss-dtitle { flex: 1; min-width: 0; }
.au-ss-dhead h2 { margin: 0; font: 500 18px/1.2 inherit; font-family: inherit; letter-spacing: -.005em; }
.au-ss-dsub { margin: 3px 0 0; color: var(--sb-muted); font-size: 12px; line-height: 1.35; font-weight: 300; }
.au-ss-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--sb-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.au-ss-x:hover { background: var(--sb-alt); color: var(--sb-text); }
.au-ss-tabs { display: flex; gap: 4px; padding: 0 12px 10px; border-bottom: 1px solid var(--sb-line); overflow-x: auto; scrollbar-width: none; }
.au-ss-tabs::-webkit-scrollbar { display: none; }
.au-ss-dtab { flex: none; padding: 7px 13px; border: 0; border-radius: 999px; background: none; color: var(--sb-muted); font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.au-ss-dtab:hover { color: var(--sb-text); }
.au-ss-dtab[aria-selected="true"] { background: var(--sb-alt); color: var(--sb-text); box-shadow: inset 0 0 0 1px var(--sb-line); }
.au-ss-dbody { flex: 1; overflow: auto; padding: 4px 16px 18px; overscroll-behavior: contain; scrollbar-width: thin; }
.au-ss-intro { margin: 12px 0 12px; color: var(--sb-muted); font-size: 13px; line-height: 1.5; font-weight: 300; }
.au-ss-loading { margin: 28px 0; color: var(--sb-muted); font-size: 13px; text-align: center; animation: au-ss-pulse 1.4s ease-in-out infinite; }
@keyframes au-ss-pulse { 50% { opacity: .45; } }

/* filter chips */
.au-ss-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.au-ss-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 6px 4px 11px; border: 1px solid var(--sb-line); border-radius: 999px;
  background: none; color: var(--sb-text); font: inherit; font-size: 12.5px; cursor: pointer; }
.au-ss-chip span { min-width: 20px; padding: 2px 6px; border-radius: 999px; background: var(--sb-alt); color: var(--sb-muted); font: 400 10.5px/1.2 var(--ss-mono); text-align: center; }
.au-ss-chip:hover { border-color: var(--sb-hi); }
.au-ss-chip[aria-pressed="true"] { background: var(--sb-text); border-color: var(--sb-text); color: var(--ss-solid); }
.au-ss-chip[aria-pressed="true"] span { background: color-mix(in srgb, var(--ss-solid) 22%, transparent); color: var(--ss-solid); }

/* cards */
.au-ss-card { margin: 0 0 12px; padding: 14px 14px 12px; border: 1px solid var(--sb-line); border-radius: 14px; background: var(--ss-card); }
.au-ss-card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; line-height: 1.3; }
.au-ss-card p { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.au-ss-chead { display: flex; align-items: flex-start; gap: 12px; }
.au-ss-chead > div { flex: 1; min-width: 0; }
.au-ss-topic { display: block; margin: 0 0 5px; }
.au-ss-verdict { color: var(--sb-muted); font-size: 12.5px !important; }
.au-ss-thumb { flex: none; width: 96px; height: 64px; padding: 0; border: 1px solid var(--sb-line); border-radius: 10px; background: var(--sb-alt); cursor: zoom-in; overflow: hidden; transition: border-color .15s; }
.au-ss-thumb:hover { border-color: var(--sb-hi); }
.au-ss-thumb svg { width: 100%; height: 100%; }
.au-ss-text { color: var(--sb-text); font-weight: 300; }
.au-ss-ctrl { color: var(--sb-hi); font-size: 12.5px !important; }
.au-ss-src { margin-top: 8px !important; color: var(--sb-muted); font-size: 11.5px !important; font-weight: 300; line-height: 1.45 !important; }
.au-ss-src a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 2px; }
.au-ss-src a:hover { color: var(--sb-hi); }
.au-ss-chartbox:not(:empty) { margin-top: 4px; }
.au-ss-cmpcard { margin-top: 12px; }

/* strength scale −1 … +1 */
.au-ss-gwrap { margin: 10px 0 8px; }
.au-ss-gauge { display: block; width: 100%; height: auto; max-height: 34px; }
.au-ss-gauge .gt { fill: var(--sb-alt); stroke: var(--sb-line); stroke-width: 1; }
.au-ss-gauge .gk { stroke: var(--sb-muted); stroke-opacity: .45; stroke-width: 1; }
.au-ss-gauge .g0 { stroke: var(--sb-text); stroke-opacity: .7; stroke-width: 1.2; }
.au-ss-gauge .gl { fill: var(--sb-muted); font: 9px var(--ss-mono); }
.au-ss-gauge .gb { fill: var(--sb-muted); }
.au-ss-gauge .gb[data-s="1"] { fill: var(--sb-hi); fill-opacity: .55; }
.au-ss-gauge .gb[data-s="2"] { fill: var(--sb-hi); }
.au-ss-gauge .gb[data-s="3"] { fill: var(--ss-gold); }
.au-ss-gauge .gp { fill: var(--ss-solid); stroke: var(--sb-text); stroke-width: 2; }
.au-ss-gleg { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 4px 0 0 !important; color: var(--sb-muted); font-size: 11.5px !important; line-height: 1.3 !important; }
.au-ss-gleg b { color: var(--sb-text); font: 500 11.5px var(--ss-mono); font-variant-numeric: tabular-nums; }
.au-ss-gleg i { display: inline-block; vertical-align: -1px; margin-right: 5px; }
.au-ss-k1 i { width: 14px; height: 7px; border-radius: 3px; background: var(--sb-hi); }
.au-ss-k1[data-s="0"] i { background: var(--sb-muted); } .au-ss-k1[data-s="1"] i { opacity: .55; } .au-ss-k1[data-s="3"] i { background: var(--ss-gold); }
.au-ss-k2 i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--sb-text); background: var(--ss-solid); }
.au-ss-n { margin-left: auto; font: 400 10.5px var(--ss-mono); }

/* the scatter chart */
.au-ss-fig2 { margin: 8px 0 4px; }
.au-ss-fig2 figcaption { margin-top: 2px; color: var(--sb-muted); font-size: 11.5px; }
.au-ss-mkdot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--ss-gold); vertical-align: 0; }
.au-ss-chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.au-ss-chart .bg { fill: var(--sb-alt); fill-opacity: .55; }
.au-ss-chart .grid { stroke: var(--sb-line); stroke-width: 1; stroke-opacity: .7; }
.au-ss-chart .ax { stroke: var(--sb-line); stroke-width: 1; }
.au-ss-chart .tk { fill: var(--sb-muted); font: 9px var(--ss-mono); }
.au-ss-chart .lb { fill: var(--sb-muted); font-size: 10px; }
.au-ss-chart .nm { fill: var(--sb-muted); font-size: 8.5px; }
.au-ss-chart .mkl { fill: var(--ss-gold-ink); font-weight: 600; }
.au-ss-chart .pt { fill: var(--sb-hi); fill-opacity: .55; }
.au-ss-chart .mk { fill: var(--ss-gold); fill-opacity: 1; stroke: var(--ss-solid); stroke-width: .8; }
.au-ss-chart .trend { fill: none; stroke: var(--sb-text); stroke-opacity: .55; stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 4 3; }
.au-ss-mini .pt { fill-opacity: .7; }
.au-ss-mini .trend { stroke-width: 1.2; stroke-dasharray: none; }
.au-ss-chart .tip { pointer-events: none; }
.au-ss-chart .tip rect { fill: var(--ss-solid); stroke: var(--sb-line); stroke-width: 1; }
.au-ss-chart .t1 { fill: var(--sb-text); font-size: 10px; font-weight: 500; }
.au-ss-chart .t2 { fill: var(--sb-muted); font: 9px var(--ss-mono); }
.au-ss-chart .ring { fill: none; stroke: var(--sb-text); stroke-width: 1.5; }

/* Compare */
.au-ss-cmp { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.au-ss-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.au-ss-field > span { color: var(--sb-muted); font: 500 10.5px/1.2 var(--ss-mono); text-transform: uppercase; letter-spacing: .08em; }
.au-ss-sel { width: 100%; min-width: 0; padding-right: 28px; border-radius: 10px; appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.au-ss-sel option, .au-ss-sel optgroup { background: var(--ss-solid); color: var(--sb-text); }
.au-ss-swap { height: 34px; border: 1px solid var(--sb-line); border-radius: 50%; min-width: 34px; }

/* All pairs */
.au-ss-tools { position: sticky; top: -4px; z-index: 1; margin: 0 -16px; padding: 8px 16px 2px; background: var(--ss-solid); }
.au-ss-search { width: 100%; margin-bottom: 8px; }
.au-ss-tools .au-ss-chips { margin-bottom: 8px; }
.au-ss-tablewrap { overflow-x: auto; }
.au-ss-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.au-ss-table th { text-align: left; font: 500 11px/1.2 inherit; font-family: inherit; color: var(--sb-muted); padding: 8px 4px 6px; border-bottom: 1px solid var(--sb-line); }
.au-ss-table th:not(:first-child) { text-align: right; }
.au-ss-table td { padding: 8px 4px; border-bottom: 1px solid var(--sb-line); vertical-align: middle; line-height: 1.35; }
.au-ss-table tbody tr { cursor: pointer; }
.au-ss-table tbody tr:hover, .au-ss-table tbody tr:focus-visible { background: var(--sb-alt); }
.au-ss-num { font: 400 12px var(--ss-mono); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.au-ss-num[data-s="3"] { color: var(--ss-gold-ink); } .au-ss-num[data-s="2"] { color: var(--sb-hi); }
.au-ss-bar1 { display: inline-block; vertical-align: middle; width: 34px; height: 5px; margin-right: 7px; border-radius: 3px; background: var(--sb-alt);
  background-image: linear-gradient(currentColor, currentColor); background-repeat: no-repeat; background-size: var(--w) 100%; opacity: .9; }
.au-ss-bar1[data-neg="true"] { background-position: right; }
.au-ss-weak { opacity: .5; }
.au-ss-amp { color: var(--sb-muted); }

/* On the map */
.au-ss-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.au-ss-tags span { padding: 3px 9px; border: 1px solid var(--sb-line); border-radius: 999px; color: var(--sb-muted); font-size: 11.5px; }
.au-ss-tags span[data-on="true"] { border-color: var(--sb-hi); color: var(--sb-hi); }

.au-ss-how { margin: 16px 0 6px; padding: 10px 12px; border-radius: 12px; background: var(--sb-alt); color: var(--sb-muted); font-size: 12.5px; line-height: 1.55; }
.au-ss-how summary { cursor: pointer; color: var(--sb-text); }
.au-ss-how p { margin: 8px 0 2px; }
.au-ss-stamp { margin: 8px 0 0; color: var(--sb-muted); font: 400 10.5px/1.4 var(--ss-mono); }

.au-ss-dlg :focus-visible, .au-ss-panel :focus-visible, .au-ss-bar :focus-visible { outline: 2px solid var(--sb-hi); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .au-ss-dlg, .au-ss-loading { animation: none; } }

@media (max-width: 640px) {
  .au-ss-dlg { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 86vh; max-height: 86dvh; background: var(--ss-solid); border-radius: 18px 18px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); animation-name: au-ss-up; }
  .au-ss-dlg::before { content: ""; display: block; width: 38px; height: 4px; margin: 8px auto -4px; border-radius: 2px; background: var(--sb-line); flex: none; }
  .au-ss-dbody { padding: 4px 12px 18px; }
  .au-ss-tools { margin: 0 -12px; padding: 8px 12px 2px; }
  .au-ss-card { padding: 12px; }
  .au-ss-thumb { width: 78px; height: 54px; }
  .au-ss-cmp { grid-template-columns: 1fr; }
  .au-ss-swap { justify-self: center; transform: rotate(90deg); }
  .au-ss-btn, .au-ss-chip { min-height: 36px; }
}
@keyframes au-ss-up { from { transform: translateY(30px); opacity: 0; } }
