/* J0210 field viewer. Dark, translucent surfaces over the sky: the sidebar, the object card and the top bar float
   above a deep background, the sky panels are rounded tiles, and every control inside a tile is a glass pill. */

:root {
  --bg: #05070b;
  --glass: rgba(17, 21, 30, 0.68);
  --glass-strong: rgba(15, 19, 27, 0.9);
  --glass-tile: rgba(9, 12, 18, 0.58);
  --fill: rgba(255, 255, 255, 0.045);
  --fill-hover: rgba(255, 255, 255, 0.085);
  --fill-active: rgba(255, 255, 255, 0.12);
  --border: rgba(255, 255, 255, 0.085);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9eef6;
  --text-2: #b2bccb;
  --muted: #7f8a9c;
  --accent: #8fa8ff;
  --accent-strong: #a9bcff;
  --accent-ink: #0a0f1f;
  --accent-soft: rgba(143, 168, 255, 0.16);
  --select: #ffd43b;
  --select-soft: rgba(255, 212, 59, 0.14);
  --pink: #f06595;
  --danger: #ff8787;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.75), 0 2px 10px -4px rgba(0, 0, 0, 0.5);
  --blur: blur(22px) saturate(160%);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b2bccb' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  --scroll-thumb: rgba(255, 255, 255, 0.13);
  --option-bg: #151a24;
  --switch-off: rgba(255, 255, 255, 0.13);
  --knob: #e6ebf3;
  --panel-edge: rgba(255, 255, 255, 0.08);
  --card-head-bg: rgba(16, 20, 28, 0.88);
  --grid: rgba(255, 255, 255, 0.07);
  --axis: rgba(255, 255, 255, 0.22);
  --point-edge: #1a1d24;
  --page-bg:
    radial-gradient(1100px 700px at -10% -20%, rgba(92, 110, 255, 0.16), transparent 60%),
    radial-gradient(900px 700px at 115% 120%, rgba(32, 201, 151, 0.08), transparent 60%),
    radial-gradient(600px 400px at 60% 40%, rgba(240, 101, 149, 0.04), transparent 70%),
    #05070b;
  --gap: 12px;
  --sidebar-w: 304px;
  --card-w: 396px;
  --r-lg: 16px;
  --r-md: 11px;
  --r-sm: 8px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace;
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  --left: calc(var(--gap) * 2 + var(--sidebar-w));
  --right: var(--gap);
  background: var(--page-bg);
  transition: background-color 0.3s;
}
body.panel-hidden { --left: var(--gap); }
body.card-open { --right: calc(var(--gap) * 2 + var(--card-w)); }

.glass { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--border); box-shadow: var(--shadow); }
.icon { width: 18px; height: 18px; flex: none; display: block; }

::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1 { font-size: 15px; margin: 0; font-weight: 650; letter-spacing: -0.005em; }
h2 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
h3 { font-size: 12px; margin: 0; font-weight: 600; color: var(--text-2); letter-spacing: 0.01em; }
kbd {
  font-family: var(--font); font-size: 10.5px; font-weight: 600; color: var(--text-2); min-width: 18px; height: 18px;
  display: inline-grid; place-items: center; padding: 0 5px; border-radius: 5px; background: var(--fill);
  border: 1px solid var(--border); box-shadow: inset 0 -1px 0 var(--fill);
}
.hint { margin: 0 0 10px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.pill { display: inline-block; font-size: 11px; font-weight: 500; color: var(--text-2); padding: 1px 8px; margin-left: 2px;
  border-radius: 999px; background: var(--fill); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }

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

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 13px;
  color: var(--accent-ink); background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  box-shadow: 0 6px 16px -8px rgba(143, 168, 255, 0.8); cursor: pointer; white-space: nowrap;
  transition: transform 0.12s var(--ease), filter 0.15s, background-color 0.15s, border-color 0.15s;
}
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(1px); }
.button:disabled { opacity: 0.5; cursor: default; }
.button.ghost { color: var(--text); background: var(--fill); border-color: var(--border); box-shadow: none; font-weight: 550; }
.button.ghost:hover { background: var(--fill-hover); border-color: var(--border-strong); }
.button.text { color: var(--text-2); background: transparent; box-shadow: none; font-weight: 550; padding: 0 8px; }
.button.text:hover { color: var(--text); background: var(--fill); }
.button.wide { width: 100%; }
.button .icon { width: 16px; height: 16px; }

.icon-button {
  display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; flex: none; border-radius: var(--r-sm);
  color: var(--text-2); background: transparent; border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}
.icon-button:hover { background: var(--fill-hover); color: var(--text); }
.icon-button:active { background: var(--fill-active); }
.icon-button[aria-pressed="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.icon-button:disabled { opacity: 0.35; cursor: default; background: transparent; }
.icon-button.small { width: 28px; height: 28px; border-radius: 7px; }
.icon-button.small .icon { width: 16px; height: 16px; }

select, input[type="number"], input[type="text"] {
  width: 100%; min-width: 0; height: 32px; padding: 0 10px; font: inherit; font-size: 13px; color: var(--text);
  background-color: var(--fill); border: 1px solid var(--border); border-radius: var(--r-sm);
  transition: border-color 0.15s, background-color 0.15s;
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer; text-overflow: ellipsis;
  background-image: var(--chevron);
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
select:hover, input[type="number"]:hover, input[type="text"]:hover { border-color: var(--border-strong); background-color: var(--fill-hover); }
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
option, optgroup { background: var(--option-bg); color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--accent); }

.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--fill); border: 1px solid var(--border); }
.segmented button {
  display: grid; place-items: center; width: 32px; height: 28px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background-color 0.15s, color 0.15s;
}
.segmented button:hover { color: var(--text); background: var(--fill-hover); }
.segmented button[aria-pressed="true"] { color: var(--accent-ink); background: linear-gradient(180deg, var(--accent-strong), var(--accent)); }

/* tooltips: <button data-tip="..."> */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 8px); left: 50%; transform: translate(-50%, -4px);
  white-space: pre; font-size: 11.5px; font-weight: 550; color: var(--text); padding: 5px 9px; border-radius: 7px;
  background: var(--glass-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.15s 0s, transform 0.15s 0s; z-index: 80;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); transition-delay: 0.35s; }
[data-tip-end]::after { left: auto; right: 0; transform: translate(0, -4px); }
[data-tip-end]:hover::after, [data-tip-end]:focus-visible::after { transform: none; }

/* ---------- sidebar ---------- */

.sidebar {
  position: fixed; top: var(--gap); bottom: var(--gap); left: var(--gap); width: var(--sidebar-w); z-index: 30;
  display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden;
  transition: transform 0.28s var(--ease), opacity 0.2s;
}
body.panel-hidden .sidebar { transform: translateX(calc(-100% - var(--gap) - 8px)); opacity: 0; pointer-events: none; }
.brand { display: flex; align-items: center; gap: 11px; padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
.sidebar-close { display: none; margin-left: auto; }
.card-fold { display: none; }
/* "?" buttons that open a short explanation */
.info { position: relative; display: inline-block; vertical-align: middle; }
.info > summary { list-style: none; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--border-strong); cursor: pointer; }
.info > summary::-webkit-details-marker { display: none; }
.info > summary:hover, .info[open] > summary { color: var(--accent-strong); border-color: var(--accent); }
.info-body { position: absolute; z-index: 30; right: 0; top: calc(100% + 6px); width: 270px; padding: 10px 12px; border-radius: 10px;
  font-size: 12px; line-height: 1.5; font-weight: 400; color: var(--text-2); text-transform: none; letter-spacing: 0;
  background: var(--glass-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
.info-body p { margin: 0 0 6px; }
.info-body.info-up { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.credits { position: relative; }
.credits .info { margin-left: 6px; position: static; } /* the popover spans the footer, inside the sidebar */
.credits .info-body.info-up { left: 0; right: 0; width: auto; }
.brand-mark { width: 46px; height: 46px; flex: none; border-radius: 12px; border: 1px solid var(--border-strong); box-shadow: 0 6px 18px -8px rgba(255, 170, 60, 0.45); }
.subtitle { margin: 2px 0 0; color: var(--text-2); font-size: 11.5px; letter-spacing: 0.01em; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 10px 16px; }
.group { padding: 12px 6px 14px; border-bottom: 1px solid var(--border); }
.group:last-of-type { border-bottom: 0; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.group-note { font-size: 11.5px; color: var(--muted); }

.layer-group { margin: 6px 0; border-radius: 10px; background: var(--fill); border: 1px solid var(--border); border-left: 3px solid var(--g); overflow: hidden; }
.layer-group > summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; transition: background-color 0.15s; }
.layer-group > summary::-webkit-details-marker { display: none; }
.layer-group > summary:hover { background: var(--fill-hover); }
.layer-group > summary::after { content: ''; flex: none; width: 16px; height: 16px; margin-left: auto; background: var(--chevron) center / contain no-repeat; transform: rotate(-90deg); transition: transform 0.2s var(--ease); opacity: 0.9; }
.layer-group[open] > summary::after { transform: none; }
.layer-group[open] > summary { border-bottom: 1px solid var(--border); }
.layer-group > .layer { margin: 0 4px; }
.layer-group > .layer:last-child { margin-bottom: 4px; }
.layer-group-title { font-size: 11.5px; font-weight: 650; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.layer-group-size, .layer-group-dots { flex: none; }
.layer-group-count { font-size: 11px; font-weight: 600; color: var(--accent-ink); background: var(--accent); padding: 0 6px; border-radius: 999px; }
.layer-group-count:empty { display: none; }
.layer-group-dots { display: inline-flex; gap: 3px; }
.layer-group-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.layer-group-size { display: none; } /* the dots already show how many layers a folded group holds */
.layer-group[open] .layer-group-dots, .layer-group[open] .layer-group-size { display: none; }
.layer {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto 34px; gap: 10px; align-items: center;
  padding: 6px 6px; margin: 0 -2px; border-radius: 9px; cursor: pointer; transition: background-color 0.15s;
}
.layer:hover { background: var(--fill); }
.glyph { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--c); margin-left: 2px; box-shadow: 0 0 8px -1px var(--c); }
.glyph.square { border-radius: 3px; }
.glyph.rhomb { border-radius: 2px; transform: rotate(45deg) scale(0.9); }
.layer-text { display: flex; flex-direction: column; min-width: 0; }
.layer-name { font-size: 13px; color: var(--text); line-height: 1.25; }
.layer-sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.layer.filtered .layer-count { color: var(--accent); font-weight: 600; } /* a selection filters this layer */
.switch {
  appearance: none; -webkit-appearance: none; width: 32px; height: 18px; margin: 0; border-radius: 999px; position: relative;
  background: var(--switch-off); cursor: pointer; transition: background-color 0.2s var(--ease); justify-self: end;
}
.switch::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--knob);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); transition: transform 0.2s var(--ease);
}
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); background: #fff; }

/* selection builder */
.sel-rows { display: flex; flex-direction: column; gap: 8px; }
.sel-row { position: relative; padding: 10px; background: var(--fill); border: 1px solid var(--border); border-radius: var(--r-md); display: flex; flex-direction: column; gap: 8px; }
.sel-row .row { display: flex; gap: 6px; align-items: center; }
.sel-row select, .sel-row input { height: 30px; font-size: 12.5px; }
.sel-op { width: 92px; flex: none; padding-left: 8px; padding-right: 20px; }
.sel-scope-field { margin-bottom: 10px; }
.plot-clear { height: 28px; padding: 0 10px; font-size: 12px; }
.sel-value { flex: 1 1 0; min-width: 0; width: auto; padding: 0 8px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
/* no spin buttons: they took half of a narrow field (the arrow keys still step the value) */
.sel-value::-webkit-outer-spin-button, .sel-value::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sel-actions .button { height: 30px; }
.sel-actions .button.primary-run { flex: 1; }
.sel-result { margin-top: 12px; font-size: 12.5px; color: var(--muted); max-height: 320px; overflow-y: auto; }
.sel-count { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--text); font-weight: 600; }
.sel-note { margin: 2px 0 6px; font-size: 12px; color: var(--muted); }
.sel-count::before { content: ''; width: 9px; height: 9px; border: 2px solid var(--c, var(--pink)); border-radius: 50%; } /* the glyph of the filtered layer */
.sel-count.square::before { border-radius: 2px; }
.sel-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sel-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 6px; white-space: nowrap; position: sticky; top: 0; background: var(--glass-strong); }
.sel-table td { padding: 5px 6px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sel-table tbody tr { cursor: pointer; }
.sel-table tbody tr:hover td { background: var(--fill-hover); color: var(--text); }
.sel-table tbody tr td:first-child { border-radius: 6px 0 0 6px; }
.sel-table tbody tr td:last-child { border-radius: 0 6px 6px 0; }
.sel-table .num, .sel-table th:not(:first-child) { text-align: right; }

.quantity { display: flex; flex-direction: column; gap: 6px; }
.quantity-colour { display: flex; gap: 6px; align-items: center; }
.quantity-colour .minus { color: var(--muted); }

.notice { padding: 14px 6px 4px; font-size: 12px; color: var(--muted); line-height: 1.5; display: flex; flex-direction: column; gap: 12px; }
.notice p { margin: 0; }
.notice-line { display: flex; gap: 8px; align-items: flex-start; color: var(--select); font-weight: 550; }
.notice-line .icon { width: 16px; height: 16px; margin-top: 1px; }
.shortcuts { display: flex; gap: 8px; align-items: flex-start; }
.shortcuts .icon { width: 16px; height: 16px; margin-top: 2px; }
.shortcuts kbd { margin: 0 1px; }
.help-link { text-decoration: none; }
.credits a { color: var(--text-2); }

/* ---------- map area ---------- */

#map { position: fixed; top: var(--gap); bottom: var(--gap); left: var(--left); right: var(--right); --plot-h: 38%; }
.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 50px; z-index: 40; display: flex; align-items: center; gap: 6px;
  padding: 0 8px; border-radius: 14px; container-type: inline-size;
}
.divider { width: 1px; height: 22px; background: var(--border-strong); margin: 0 3px; flex: none; }
.search { position: relative; display: flex; align-items: center; gap: 8px; width: 340px; min-width: 150px; flex: 0 1 340px; height: 36px;
  padding: 0 8px 0 11px; border-radius: 10px; background: var(--fill); border: 1px solid var(--border); color: var(--muted);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s; }
.search:hover { border-color: var(--border-strong); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--fill-hover); color: var(--text-2); }
.search .icon { width: 16px; height: 16px; }
.search input { flex: 1; height: 34px; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 13px; }
.search input:hover, .search input:focus { background: transparent; box-shadow: none; }
.search input::placeholder { color: var(--muted); }
.search:focus-within .search-key { display: none; }
.search-menu { position: absolute; top: calc(100% + 8px); left: 0; width: max(100%, 380px); border-radius: 12px; padding: 6px; background: var(--glass-strong); z-index: 70; }
.search-menu ul { list-style: none; margin: 0; padding: 0; }
.search-menu ul:empty { display: none; }
.search-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--text); }
.search-item[aria-selected="true"], .search-item:hover { background: var(--fill-active); }
.search-kind { font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; color: var(--accent-strong); background: var(--accent-soft); }
.search-kind.alias { color: var(--select); background: var(--select-soft); }
.search-main { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.search-sub { color: var(--muted); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.search-status { margin: 4px 10px 4px; font-size: 12px; color: var(--muted); }
.search-status:empty { display: none; }
.readout { flex: 1; min-width: 0; margin: 0 6px; font-family: var(--mono); font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; font-variant-numeric: tabular-nums; }
.readout b { color: var(--text-2); font-weight: 500; }
.readout .readout-kind { font-family: var(--font); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-right: 6px; color: var(--muted); }
@container (max-width: 780px) { .readout { visibility: hidden; } }
@container (max-width: 600px) { .search { flex-basis: 200px; } .search-key { display: none; } }

#panels { position: absolute; top: 60px; left: 0; right: 0; bottom: 0; display: grid; gap: 10px; transition: bottom 0.25s var(--ease); }
#panels[data-layout="1"] { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
#panels[data-layout="2"] { grid-template: minmax(0, 1fr) / minmax(0, 1fr) minmax(0, 1fr); }
#panels[data-layout="4"] { grid-template: minmax(0, 1fr) minmax(0, 1fr) / minmax(0, 1fr) minmax(0, 1fr); }
body.plot-open #panels { bottom: calc(var(--plot-h) + 10px); }
.panel { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #000; border-radius: 14px; box-shadow: var(--shadow); }
.panel::after { content: ''; position: absolute; inset: 0; border-radius: inherit; border: 1px solid var(--panel-edge); pointer-events: none; z-index: 25; }
.panel-sky { position: absolute; inset: 0; width: 100% !important; height: 100% !important; } /* Aladin Lite resets the position of its div */
.panel .aladin-logo-container { opacity: 0.4; transform: scale(0.8); transform-origin: right bottom; transition: opacity 0.2s; }
.panel .aladin-logo-container:hover { opacity: 0.9; }

.panel-bar {
  position: absolute; top: 10px; left: 10px; z-index: 20; display: flex; flex-wrap: wrap; gap: 2px; align-items: center;
  max-width: calc(100% - 20px); padding: 3px; border-radius: 12px; background: var(--glass-tile); border: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.8);
}
.panel-select {
  width: 148px; height: 28px; padding: 0 24px 0 9px; font-size: 12.5px; font-weight: 550; border-radius: 8px;
  background-color: transparent; border-color: transparent; background-position: right 6px center; background-size: 12px;
}
.panel-select:hover { background-color: var(--fill-hover); border-color: transparent; }
.panel-select.narrow { width: 126px; font-weight: 500; color: var(--text-2); }
.panel-select.mask { width: 116px; font-weight: 500; color: var(--text-2); }
.panel-settings { position: relative; }
.panel-settings summary { list-style: none; }
.panel-settings summary::-webkit-details-marker { display: none; }
.panel-settings[open] summary { color: var(--accent-strong); background: var(--accent-soft); }
.panel-popover {
  position: absolute; top: 36px; left: 0; width: 220px; padding: 12px; z-index: 30; border-radius: 12px;
  background: var(--glass-strong); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > span { font-size: 11.5px; color: var(--muted); }

.panel-status {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-2); padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--glass-tile); border: 1px solid var(--border); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.panel-status:empty { display: none; }
.panel-status.busy::before { content: ''; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hover-tip {
  position: absolute; z-index: 45; pointer-events: none; min-width: 170px; max-width: 280px; padding: 9px 11px; border-radius: 10px;
  background: var(--glass-strong); font-size: 12px; line-height: 1.4;
}
.hover-tip .tip-title { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hover-tip .tip-line { color: var(--text-2); font-variant-numeric: tabular-nums; }
.hover-tip .tip-layer { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.hover-tip .tip-layer::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.hover-tip .tip-alias { color: var(--select); font-size: 11.5px; }

.toast {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 60; padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; color: var(--text); background: var(--glass-strong); animation: toast-in 0.25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
#map-status:empty { display: none; }
#map-status {
  position: absolute; top: 72px; left: 50%; transform: translateX(-50%); z-index: 60; max-width: 80%; padding: 10px 16px;
  border-radius: 12px; background: var(--glass-strong); border: 1px solid var(--border-strong); font-size: 13px;
}
body.failed #map-status { color: var(--danger); }

/* scatter plot */
.plot { position: absolute; left: 0; right: 0; bottom: 0; height: var(--plot-h); z-index: 10; display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; animation: rise 0.28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.plot-header { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--border); }
.plot-title { font-size: 12.5px; font-weight: 650; color: var(--text); margin-right: 4px; }
.plot-axis { display: flex; gap: 6px; align-items: center; }
.plot-axis-name { color: var(--muted); font-weight: 650; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.plot-axis select { height: 28px; font-size: 12.5px; max-width: 190px; }
.plot-axis .quantity { flex-direction: row; }
.plot-status { color: var(--muted); font-size: 12px; flex: 1; }
.plot-close { margin-left: auto; }
.plot-modes button { width: auto; padding: 0 10px; font: inherit; font-size: 12px; font-weight: 550; }
.plot-body[data-mode="pan"] { cursor: grab; }
.plot-body[data-mode="zoom"] { cursor: zoom-in; }
.plot-body { position: relative; flex: 1; min-height: 0; cursor: crosshair; touch-action: none; }
.plot-canvas { position: absolute; inset: 0; }
.plot-box { display: none; position: absolute; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 3px; pointer-events: none; }

/* ---------- object card ---------- */

.card {
  position: fixed; top: var(--gap); bottom: var(--gap); right: var(--gap); width: var(--card-w); z-index: 30;
  border-radius: var(--r-lg); overflow-y: auto; overflow-x: hidden;
  transform: translateX(calc(100% + var(--gap) + 8px)); opacity: 0; visibility: hidden;
  transition: transform 0.3s var(--ease), opacity 0.2s, visibility 0s 0.3s;
}
body.card-open .card { transform: none; opacity: 1; visibility: visible; transition: transform 0.3s var(--ease), opacity 0.2s, visibility 0s; }
.card-head {
  position: sticky; top: 0; z-index: 5; padding: 10px 10px 12px 18px; margin-bottom: 12px;
  background: var(--card-head-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; }
.card-name { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.card-name h2 { font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.card-sub .mono { font-family: var(--mono); font-size: 11.5px; }
.card-actions { display: flex; gap: 2px; flex: none; }
.card-body { padding: 0 18px 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; color: var(--text-2); background: var(--fill); border: 1px solid var(--border); }
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--chip, var(--muted)); box-shadow: 0 0 6px var(--chip, transparent); }
.chip-alias { color: var(--select); background: var(--select-soft); border-color: rgba(255, 212, 59, 0.28); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip-alias::before { display: none; }
.card-note { color: var(--muted); line-height: 1.5; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.stat { padding: 10px 12px; border-radius: var(--r-md); background: var(--fill); border: 1px solid var(--border); min-width: 0; }
.stat-label { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-value.empty { color: var(--muted); font-weight: 500; }
.stat-sub { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat.highlight { background: linear-gradient(160deg, rgba(105, 219, 124, 0.14), var(--fill)); border-color: rgba(105, 219, 124, 0.28); }
.fit-line { font-size: 12px; color: var(--muted); margin: 0 0 16px; }

.card-section { margin: 0 0 14px; padding: 12px; border-radius: var(--r-md); background: var(--fill); border: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--select); }
.lg-open { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); }
.lg-line { width: 14px; height: 2px; border-radius: 2px; background: var(--c); }
.lg-band { width: 12px; height: 8px; border-radius: 2px; background: rgba(105, 219, 124, 0.25); }
.lg-dash { width: 14px; height: 0; border-top: 2px dashed #69db7c; }
.caption { font-size: 11.5px; color: var(--muted); line-height: 1.45; margin: 8px 0 0; }

details.card-section { padding: 0; }
details.card-section > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-2); border-radius: var(--r-md);
}
details.card-section > summary::-webkit-details-marker { display: none; }
details.card-section > summary::after {
  content: ''; width: 14px; height: 14px; transition: transform 0.2s var(--ease);
  background: var(--chevron) center / contain no-repeat;
}
details.card-section[open] > summary::after { transform: rotate(180deg); }
details.card-section > summary:hover { color: var(--text); background: var(--fill); }
details.card-section > :not(summary) { padding: 0 12px 12px; }

.skeleton { border-radius: 8px; background: linear-gradient(90deg, var(--fill) 0%, var(--fill-active) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.skeleton.line { height: 12px; margin: 6px 0; }
.skeleton.block { height: 64px; }
.skeleton.chart { height: 190px; margin-top: 8px; }

.phot { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.phot th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 0; border-bottom: 1px solid var(--border); }
.phot td { padding: 4px 0; border-bottom: 1px solid var(--fill); font-variant-numeric: tabular-nums; }
.phot .num { text-align: right; }
.phot th:not(:first-child) { text-align: right; }
.phot tr.unfitted td { color: var(--muted); }

/* SED and P(z) charts */
.sed, .pz { width: 100%; height: auto; display: block; overflow: visible; }
.sed-frame { fill: none; stroke: none; }
.chart-grid { stroke: var(--grid); stroke-width: 1; }
.chart-axis { stroke: var(--axis); stroke-width: 1; }
.sed-tick { stroke: var(--axis); stroke-width: 1; }
.sed-label { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.sed-axis { fill: var(--text-2); font-size: 10.5px; font-family: var(--font); }
.sed-empty { fill: var(--muted); font-size: 12px; }
.sed-point line, .sed-point path { stroke: var(--select); stroke-width: 1.5; }
.sed-point circle { fill: var(--select); stroke: var(--point-edge); stroke-width: 1.4; transition: r 0.15s; }
.sed-point:hover circle { r: 6; }
.sed-unfitted line, .sed-unfitted path { stroke: var(--muted); }
.sed-unfitted circle { fill: var(--point-edge); stroke: var(--muted); stroke-width: 1.6; }
.sed-model { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: 0.9; }
.sed-model-alt { fill: none; stroke: #74c0fc; stroke-width: 1.3; stroke-dasharray: 5 3; opacity: 0.85; }
.sed.hide-eazy .sed-model-alt { display: none; }
.legend-toggle { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; margin: -1px 0; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text-2); font: inherit; font-size: 11.5px; cursor: pointer; }
.legend-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.legend-toggle[aria-pressed="false"] { opacity: 0.6; }
.legend-toggle[aria-pressed="true"] { border-color: rgba(116, 192, 252, 0.5); background: rgba(116, 192, 252, 0.1); }
.lg-dashline { width: 14px; height: 0; border-top: 2px dashed #74c0fc; }
.pz-window { fill: rgba(105, 219, 124, 0.1); }
.pz-lephare { fill: none; stroke: var(--select); stroke-width: 1.8; }
.pz-lephare-qso { fill: none; stroke: #cc5de8; stroke-width: 1.4; stroke-dasharray: 3 2; }
.pz-eazy { fill: none; stroke: #74c0fc; stroke-width: 1.5; }
.pz-lephare-area { fill: url(#pz-grad-lephare); stroke: none; }
.pz-eazy-area { fill: url(#pz-grad-eazy); stroke: none; }
.pz-spec { stroke: #69db7c; stroke-width: 1.5; stroke-dasharray: 4 3; }
.pz-adopted { stroke-width: 2.4; stroke-dasharray: none; }
.pz-other { stroke-width: 1.1; opacity: 0.55; }
.pz-lephare-qso-area { fill: url(#pz-grad-lephare_qso); stroke: none; }
.stat.wide { grid-column: 1 / -1; padding: 6px 12px; }
.stat.muted .stat-value { font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.35; white-space: normal; }

.kv-heading { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 10px 0 4px; }
.kv-heading:first-child { margin-top: 2px; }
.kv-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.kv-table td { padding: 3px 0; border-bottom: 1px solid var(--fill); vertical-align: top; }
.kv-key { font-family: var(--mono); color: var(--muted); padding-right: 8px; word-break: break-word; }
.kv-val { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; word-break: break-word; }

/* cut-outs */
.cutout-host { position: fixed; left: -10000px; top: 0; width: 160px; }
.cutout-viewer { width: 160px; height: 160px; }
.cutout-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.cutout { margin: 0; position: relative; }
.cutout img { width: 100%; aspect-ratio: 1; display: block; background: #000; border-radius: 8px; border: 1px solid var(--border); }
.cutout.loading img { visibility: hidden; }
.cutout.loading::before { content: ''; position: absolute; inset: 0 0 18px; border-radius: 8px; background: linear-gradient(90deg, var(--fill) 0%, var(--fill-active) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
/* four ticks around the position, leaving the center clear */
.cutout::after { content: ''; position: absolute; left: 50%; top: calc(50% - 9px); width: 30px; height: 30px; transform: translate(-50%, -50%);
  background:
    linear-gradient(#ffd43b, #ffd43b) center top / 1.5px 9px no-repeat,
    linear-gradient(#ffd43b, #ffd43b) center bottom / 1.5px 9px no-repeat,
    linear-gradient(#ffd43b, #ffd43b) left center / 9px 1.5px no-repeat,
    linear-gradient(#ffd43b, #ffd43b) right center / 9px 1.5px no-repeat;
  opacity: 0.85; pointer-events: none; }
.cutout.loading::after { display: none; }
.cutout figcaption { font-size: 10.5px; color: var(--muted); text-align: center; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* ---------- day theme (html[data-theme="light"], set by theme.js: by time of day, or chosen by the viewer) ---------- */

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eef1f6;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.95);
  --glass-tile: rgba(255, 255, 255, 0.78);
  --fill: rgba(15, 23, 42, 0.045);
  --fill-hover: rgba(15, 23, 42, 0.075);
  --fill-active: rgba(15, 23, 42, 0.11);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #18202d;
  --text-2: #3f4a5c;
  --muted: #667185;
  --accent: #4c6ef5;
  --accent-strong: #5c7cfa;
  --accent-ink: #ffffff;
  --accent-soft: rgba(76, 110, 245, 0.13);
  --select: #c98a00;
  --select-soft: rgba(230, 160, 0, 0.13);
  --shadow: 0 18px 44px -20px rgba(15, 23, 42, 0.28), 0 2px 8px -4px rgba(15, 23, 42, 0.14);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6577' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  --scroll-thumb: rgba(15, 23, 42, 0.18);
  --option-bg: #ffffff;
  --switch-off: rgba(15, 23, 42, 0.16);
  --knob: #ffffff;
  --panel-edge: rgba(15, 23, 42, 0.12);
  --card-head-bg: rgba(255, 255, 255, 0.9);
  --grid: rgba(15, 23, 42, 0.08);
  --axis: rgba(15, 23, 42, 0.3);
  --point-edge: #ffffff;
  --page-bg:
    radial-gradient(1100px 700px at -10% -20%, rgba(92, 124, 250, 0.16), transparent 60%),
    radial-gradient(900px 700px at 115% 120%, rgba(32, 201, 151, 0.1), transparent 60%),
    #eef1f6;
}
:root[data-theme="light"] .button { box-shadow: 0 6px 16px -8px rgba(76, 110, 245, 0.6); }
:root[data-theme="light"] .chip-alias { border-color: rgba(201, 138, 0, 0.35); }
:root[data-theme="light"] .brand-mark { box-shadow: 0 6px 18px -8px rgba(15, 23, 42, 0.35); }
.brand-mark.day { display: none; }
:root[data-theme="light"] .brand-mark.day { display: block; }
:root[data-theme="light"] .brand-mark.night { display: none; }

/* ---------- narrow screens: sidebar and card float over the map ---------- */

@media (max-width: 900px) {
  :root { --gap: 8px; --card-w: calc(100vw - 16px); }
  body, body.card-open, body.panel-hidden { --left: var(--gap); --right: var(--gap); }
  .sidebar { z-index: 50; width: min(320px, calc(100vw - 16px)); }
  .sidebar-close { display: inline-grid; }
  /* the card is a bottom sheet; folded, only its header shows */
  .card { z-index: 55; top: auto; height: 62vh; transform: translateY(calc(100% + 16px)); transition: transform 0.3s var(--ease), height 0.25s var(--ease), opacity 0.2s, visibility 0s 0.3s; }
  body.card-open .card { transform: none; }
  body.card-folded .card { height: 118px; overflow: hidden; }
  .card-fold { display: inline-grid; }
  .card-fold .icon { transition: transform 0.2s var(--ease); }
  body.card-folded .card-fold .icon { transform: rotate(180deg); }
  /* the top bar keeps search, view buttons, plot, theme and guide; layouts and the readout need a wide screen */
  .topbar { gap: 2px; padding: 0 4px; }
  .topbar .segmented, .topbar .readout, .topbar .divider { display: none; }
  .search { flex: 1 1 auto; min-width: 0; width: auto; }
  .search-key { display: none; }
  .search-menu { width: calc(100vw - 24px); }
  /* the plot header scrolls sideways so that its close button stays reachable */
  #map { --plot-h: 48%; }
  .plot-header { flex-wrap: nowrap; overflow-x: auto; }
  .plot-header > * { flex: none; }
  .plot-close { position: sticky; right: 0; background: var(--glass-strong); }
  [data-tip]::after { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* showcase: the note on withheld data, a yellow triangle in the top bar that opens on click */
.data-note { position: relative; display: inline-flex; }
.data-note > summary.icon-button { list-style: none; color: #f59f00; }
.data-note > summary.icon-button:hover, .data-note[open] > summary.icon-button { color: #fcc419; }
.data-note[open] > summary[data-tip]::after, .data-note[open] > summary[data-tip]::before { display: none; } /* no tooltip over the open note */
.data-note > summary::-webkit-details-marker { display: none; }
.data-note .info-body { width: 250px; }

/* showcase: the introduction shown on the first visit of a release (dismissed once, remembered in the browser) */
.intro { padding: 0; border: none; background: transparent; color: var(--text); width: min(430px, calc(100vw - 32px)); max-width: none; }
.intro::backdrop { background: rgba(3, 5, 9, 0.42); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
:root[data-theme="light"] .intro::backdrop { background: rgba(214, 221, 233, 0.4); }
.intro-card { position: relative; margin: 0; padding: 22px 22px 18px; border-radius: 18px; background: var(--glass-strong);
  border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.intro-close { position: absolute; top: 12px; right: 12px; }
.intro-head { display: flex; gap: 12px; align-items: center; margin: 0 28px 14px 0; }
.intro-head .brand-mark { width: 40px; height: 40px; flex: none; }
.intro-eyebrow { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.intro h2 { margin: 2px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -0.01em; }
.intro-lead { margin: 0 0 14px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.intro-facts { list-style: none; margin: 0 0 18px; padding: 12px 14px; display: grid; gap: 9px; border-radius: 12px;
  background: var(--fill); border: 1px solid var(--border); }
.intro-facts li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; font-size: 12.8px; line-height: 1.5; }
.intro-facts .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.intro-facts li.note .icon { color: #f59f00; }
.intro-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.intro[open] { animation: intro-in 180ms ease-out; }
@keyframes intro-in { from { opacity: 0; transform: translateY(6px) scale(0.985); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .intro[open] { animation: none; } }
.intro-actions a.button { text-decoration: none; }
.intro .nowrap { white-space: nowrap; }

/* showcase: the guided tour (assets/tour.js) */
.tour-overlay { position: fixed; inset: 0; z-index: 900; background: transparent; }
.tour-spot { position: fixed; z-index: 901; pointer-events: none; border-radius: 12px; border: 2px solid var(--accent);
  box-shadow: 0 0 0 9999px rgba(3, 5, 9, 0.5); transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease; }
:root[data-theme="light"] .tour-spot { box-shadow: 0 0 0 9999px rgba(20, 28, 42, 0.3); }
.tour-spot::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent);
  animation: tour-pulse 1.6s ease-out infinite; }
.tour-spot.tour-spot-area { border-style: dashed; }
@keyframes tour-pulse { from { opacity: 0.7; transform: scale(1); } to { opacity: 0; transform: scale(1.08); } }
.tour-bubble { position: fixed; z-index: 902; width: min(290px, calc(100vw - 24px)); padding: 12px 14px 10px; border-radius: 14px;
  background: var(--glass-strong); transition: left 0.25s ease, top 0.25s ease; }
.tour-bubble::before { content: ''; position: absolute; width: 12px; height: 12px; background: inherit; border: inherit;
  border-right: none; border-bottom: none; }
.tour-bubble[data-side="bottom"]::before { top: -7px; left: calc(var(--arrow) - 6px); transform: rotate(45deg); }
.tour-bubble[data-side="top"]::before { bottom: -7px; left: calc(var(--arrow) - 6px); transform: rotate(225deg); }
.tour-bubble[data-side="right"]::before { left: -7px; top: calc(var(--arrow) - 6px); transform: rotate(-45deg); }
.tour-bubble[data-side="center"]::before { display: none; }
.tour-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tour-title { font-weight: 650; font-size: 13.5px; }
.tour-count { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tour-text { margin: 4px 0 10px; font-size: 12.8px; line-height: 1.5; color: var(--text-2); }
.tour-actions { display: flex; justify-content: flex-end; gap: 6px; }
.tour-actions .button { height: 28px; padding: 0 12px; font-size: 12.5px; }
.tour-actions .button.text { margin-right: auto; padding: 0 4px; }
.tour-start { margin-top: 2px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-bubble { transition: none; } .tour-spot::after { animation: none; } }

/* selection tabs (collab only), circle condition, SQL pane, and download dialog */
.sel-tabs { display: flex; width: 100%; margin-bottom: 10px; }
.sel-tabs button { flex: 1; width: auto; height: 28px; font: inherit; font-size: 12.5px; font-weight: 600; }
.sel-circle-name { flex: 1 1 auto; min-width: 0; }
.sel-resolve { height: 30px; padding: 0 9px; font-size: 12px; flex: none; }
.sel-circle-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sel-mini-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sel-mini-field > span { font-size: 10.5px; color: var(--muted); }
.sel-circle-status { font-size: 11.5px; color: var(--muted); }
.sel-circle-status:empty { display: none; }
.sel-circle-status.error, .sql-status.error, .dl-status.error { color: var(--danger); }
.sel-download { flex: 1 1 auto; }

.sql-pane { display: flex; flex-direction: column; gap: 8px; }
.sql-tpl-field { margin-bottom: 0; }
.sql-input {
  width: 100%; min-height: 124px; resize: vertical; padding: 8px 10px; font-family: var(--mono); font-size: 11.5px;
  line-height: 1.45; color: var(--text); background: var(--fill); border: 1px solid var(--border); border-radius: var(--r-sm);
}
.sql-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sql-actions { margin-top: 2px; }
.sql-status { font-size: 12px; color: var(--text-2); font-weight: 550; }
.sql-status:empty { display: none; }
.sql-result { max-height: 300px; overflow: auto; }
.sql-table-wrap { overflow-x: auto; }
.sql-table td, .sql-table th { white-space: nowrap; }
.sql-table:not(.clickable) tbody tr { cursor: default; }

.download-dialog { width: min(460px, calc(100vw - 32px)); }
.dl-summary { margin: 6px 0 12px; }
.dl-hdu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 10px; margin-top: 2px; }
.dl-hdu-item { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.dl-hdu-item input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.dl-always-note { margin: 6px 0 0; }
.dl-status { margin: 8px 0 10px; font-size: 12.5px; color: var(--text-2); min-height: 18px; }

/* the labelled link to the data release in the top bar (collab profile) */
.products-button { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.products-button:hover { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.products-button svg { width: 15px; height: 15px; }
@media (max-width: 760px) { .products-button span { display: none; } .products-button { padding: 0 8px; } }
