/* ASTRA tool demo pages (annotation / converter / vibetools / datasets), 2026-11-02.
 * Static demos: the layout and interactions of the old 1Cellbio tool pages, no real computation.
 * Loaded after astra-page.css (uses its --pg-* tokens). Sizes in px for the same reason as there. */

.tool-wrap { position: relative; width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 37.5px 96px; }
.tool-wrap--narrow { max-width: 1200px; }
.tool-center { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: -8px 0 40px; }

/* ---- small round chips under the hero ---- */
.tool-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--pg-border); background: rgba(10, 10, 12, 0.55); color: var(--pg-fg);
  font: 500 11px/1.2 var(--pg-mono); letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none; cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.tool-chip:hover, .tool-chip:focus-visible { background: rgba(229, 231, 235, 0.1); border-color: var(--pg-accent); }
.tool-chip--warn { color: var(--pg-warn); border-color: rgba(251, 191, 36, 0.35); }
.tool-chip--warn::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pg-warn); box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
.tool-chip svg { width: 14px; height: 14px; flex: none; }

/* ---- segmented tabs (pill rail) ---- */
.tool-seg {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 5px;
  border-radius: 999px; border: 1px solid var(--pg-border); background: rgba(10, 10, 12, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tool-seg--sq { border-radius: 12px; padding: 4px; }
.tool-seg__btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 22px; border-radius: 999px; border: 0;
  background: transparent; color: rgba(229, 231, 235, 0.55); cursor: pointer; white-space: nowrap;
  font: 500 12px/1.2 var(--pg-mono); letter-spacing: 0.12em; text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.tool-seg--sq .tool-seg__btn { border-radius: 9px; padding: 8px 16px; font: 500 14px/1.2 inherit; font-family: inherit; letter-spacing: 0; text-transform: none; }
.tool-seg__btn:hover { color: var(--pg-fg); }
.tool-seg__btn[aria-selected="true"] { background: var(--pg-fg); color: #111; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.6); }
.tool-seg--sq .tool-seg__btn[aria-selected="true"] { background: rgba(229, 231, 235, 0.16); color: #fff; }
.tool-seg__btn[disabled] { cursor: not-allowed; color: rgba(229, 231, 235, 0.3); }
.tool-seg__btn svg { width: 15px; height: 15px; flex: none; }
.tool-soon { padding: 2px 6px; border-radius: 4px; border: 1px solid var(--pg-border); font-size: 8px; letter-spacing: 0.1em; color: rgba(229, 231, 235, 0.35); }
.tool-hint { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--pg-muted); }
/* "you're signed in" bar (G2): only for signed-in visitors; a plain link to the app, never a redirect */
.tool-signed-hint {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 16px; max-width: 960px; margin: 0 auto 28px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid rgba(52, 211, 153, 0.3); background: rgba(10, 10, 12, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tool-signed-hint::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--pg-ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.tool-signed-hint p { margin: 0; font-size: 13px; color: var(--pg-fg); }
.tool-signed-hint .tool-btn { min-height: 30px; padding: 5px 14px; }
/* small-device notice (G10, converter page): a phone, a tablet or a low-memory machine — a real sample needs several GB in this tab */
.tool-device-note {
  display: flex; align-items: flex-start; gap: 10px; max-width: 960px; margin: 0 auto 28px; padding: 12px 18px;
  border-radius: 16px; border: 1px solid rgba(251, 191, 36, 0.32); background: rgba(10, 10, 12, 0.6);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tool-device-note::before { content: ''; flex: none; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.6); }
.tool-device-note p { margin: 0; font-size: 13px; line-height: 1.55; color: var(--pg-fg); }
.tool-tabs { display: flex; flex-direction: column; align-items: center; margin-bottom: 40px; }
.tool-tabs > .tool-seg + .tool-seg { margin-top: 24px; }
/* The mode switch under the tool tabs (Cell Bin | Square Bin …) and its one-line hint share the centre line of the tab rail above them.
 * .js-modes is a shrink-wrapped flex item of .tool-tabs, so its own children need centring too — as plain blocks the inline-flex
 * switch hugged the left edge of the hint's width while the hint (text-align: center inside a box exactly as wide as itself) looked left-aligned. */
.tool-tabs > .js-modes { display: flex; flex-direction: column; align-items: center; max-width: 100%; }

/* ---- grid + glass panels ---- */
.tool-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.tool-grid--side { grid-template-columns: 432px minmax(0, 1fr); gap: 24px; }
.tool-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tool-panel {
  position: relative; padding: 24px; border-radius: 24px; border: 1px solid rgba(229, 231, 235, 0.12);
  background: rgba(12, 12, 14, 0.62); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.5);
}
.tool-panel--tall { min-height: 560px; display: flex; flex-direction: column; }
.tool-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.tool-panel__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: #fff; }
.tool-panel__title svg { width: 20px; height: 20px; flex: none; opacity: 0.85; }
.tool-panel__sub { margin: -10px 0 18px; font-size: 13px; color: var(--pg-muted); }
.tool-label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--pg-fg); }
.tool-micro { font: 500 10px/1.2 var(--pg-mono); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(229, 231, 235, 0.45); }
.tool-field + .tool-field { margin-top: 18px; }
.tool-help { margin: 6px 0 0; font-size: 12px; color: rgba(229, 231, 235, 0.45); }

/* ---- drop zone ---- */
.tool-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 136px; padding: 28px 20px; border-radius: 16px; border: 1.5px dashed rgba(229, 231, 235, 0.25);
  background: rgba(0, 0, 0, 0.25); color: var(--pg-muted); text-align: center; cursor: pointer; font: inherit; font-size: 14px;
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}
.tool-drop:hover, .tool-drop:focus-visible, .tool-drop.is-drag {
  border-color: var(--pg-accent); background: rgba(229, 231, 235, 0.06);
  transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(0, 0, 0, 0.55);
}
.tool-drop svg { width: 30px; height: 30px; opacity: 0.75; color: var(--pg-fg); margin-bottom: 4px; transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease; }
.tool-drop:hover svg, .tool-drop.is-drag svg { transform: translateY(-3px) scale(1.06); opacity: 1; }
.tool-drop b { color: var(--pg-fg); font-weight: 600; }
.tool-drop small { font-size: 12px; color: rgba(229, 231, 235, 0.45); }
.tool-drop.has-file { border-style: solid; border-color: rgba(52, 211, 153, 0.45); }
.tool-drop input[type="file"] { display: none; }
.tool-file { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--pg-ok); word-break: break-all; }
.tool-file[hidden] { display: none; }
.tool-file--err { color: #f87171; }

/* ---- buttons ---- */
.tool-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.tool-row[hidden], .tool-panel[hidden] { display: none; }
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 34px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--pg-border); background: rgba(229, 231, 235, 0.06); color: var(--pg-fg);
  font: inherit; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.tool-btn:hover, .tool-btn:focus-visible { background: rgba(229, 231, 235, 0.14); border-color: var(--pg-accent); }
.tool-btn svg { width: 14px; height: 14px; flex: none; }
.tool-btn--sq { border-radius: 8px; }
.tool-btn--on { background: var(--pg-fg); color: #111; border-color: var(--pg-fg); }
.tool-btn--on:hover { background: #fff; color: #111; }
.tool-btn--primary {
  width: 100%; min-height: 44px; margin-top: 20px; border-radius: 12px; border: 0;
  background: linear-gradient(180deg, #f4f4f5, #d4d4d8); color: #111; font-size: 14px; font-weight: 600; letter-spacing: 0.12em;
  box-shadow: 0 10px 30px -10px rgba(229, 231, 235, 0.35);
}
.tool-btn--primary:hover { background: linear-gradient(180deg, #fff, #e4e4e7); color: #111; }
.tool-btn[disabled], .tool-btn--primary[disabled] {
  cursor: not-allowed; opacity: 1; background: rgba(229, 231, 235, 0.14); color: rgba(229, 231, 235, 0.45); box-shadow: none; border-color: transparent;
}
.tool-btn.is-busy { cursor: progress; }
.tool-btn.is-busy::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: tool-spin 0.8s linear infinite;
}
@keyframes tool-spin { to { transform: rotate(360deg); } }

/* ---- inputs ---- */
.tool-textarea, .tool-input {
  display: block; width: 100%; border-radius: 16px; border: 1px solid rgba(229, 231, 235, 0.14); background: rgba(229, 231, 235, 0.06);
  color: var(--pg-fg); font: 13px/1.6 var(--pg-mono); padding: 14px 16px; outline: none;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.tool-textarea { min-height: 128px; resize: vertical; }
.tool-input { border-radius: 10px; padding: 10px 14px; font-family: inherit; font-size: 14px; }
.tool-textarea:focus, .tool-input:focus { border-color: var(--pg-accent); background: rgba(229, 231, 235, 0.09); }
.tool-textarea::placeholder, .tool-input::placeholder { color: rgba(229, 231, 235, 0.35); }
.tool-check { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; color: var(--pg-fg); cursor: pointer; }
.tool-check input { width: 16px; height: 16px; margin: 0; accent-color: #60a5fa; }
.tool-check em { font-style: normal; color: rgba(229, 231, 235, 0.4); }
.tool-check input:disabled + span { opacity: 0.45; }
.tool-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 8px; }
.tool-pick .tool-btn { border-radius: 8px; min-height: 36px; font-size: 13px; }

/* ---- results ---- */
.tool-table-wrap { flex: 1 1 auto; display: flex; flex-direction: column; border-radius: 16px; border: 1px solid rgba(229, 231, 235, 0.12); background: rgba(0, 0, 0, 0.22); overflow: hidden; min-height: 420px; }
.tool-table-scroll { overflow-x: auto; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tool-table th {
  padding: 14px 16px; text-align: left; white-space: nowrap; border-bottom: 1px solid rgba(229, 231, 235, 0.1);
  font: 600 10px/1.2 var(--pg-mono); letter-spacing: 0.12em; text-transform: uppercase; color: rgba(229, 231, 235, 0.55);
}
.tool-table td { padding: 12px 16px; border-bottom: 1px solid rgba(229, 231, 235, 0.06); color: var(--pg-fg); vertical-align: middle; }
.tool-table tbody tr { animation: tool-row-in 0.45s ease both; }
.tool-table tbody tr:hover td { background: rgba(229, 231, 235, 0.04); }
@keyframes tool-row-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tool-mono { font-family: var(--pg-mono); font-size: 12px; color: var(--pg-muted); }
.tool-type { font-weight: 600; color: #fff; }
.tool-conf { display: inline-flex; align-items: center; gap: 8px; font-family: var(--pg-mono); font-size: 12px; }
.tool-conf i { display: block; width: 56px; height: 4px; border-radius: 999px; background: rgba(229, 231, 235, 0.12); overflow: hidden; }
.tool-conf i::after { content: ''; display: block; height: 100%; width: var(--v, 0%); background: linear-gradient(90deg, #60a5fa, #34d399); }
.tool-gene { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 7px; border-radius: 6px; background: rgba(229, 231, 235, 0.08); font: 11px/1.4 var(--pg-mono); color: var(--pg-accent); }
.tool-meter { display: inline-flex; align-items: center; gap: 10px; }
.tool-meter i { display: block; width: 48px; height: 4px; border-radius: 999px; background: rgba(229, 231, 235, 0.15); overflow: hidden; }
.tool-meter i::after { content: ''; display: block; height: 100%; width: var(--v, 82%); background: var(--pg-fg); transition: width 0.6s ease; }

.tool-empty {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 300px; padding: 32px; text-align: center; color: rgba(229, 231, 235, 0.42); font-size: 14px; letter-spacing: 0.08em;
}
.tool-empty svg { width: 44px; height: 44px; opacity: 0.55; color: var(--pg-fg); }
.tool-empty[hidden] { display: none; }
.tool-note { margin: 16px 0 0; font: italic 11px/1.5 var(--pg-mono); letter-spacing: 0.04em; color: rgba(229, 231, 235, 0.4); }

/* running state */
.tool-progress { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 300px; padding: 32px; }
.tool-progress[hidden] { display: none; }
.tool-progress__bar { width: min(320px, 80%); height: 4px; border-radius: 999px; background: rgba(229, 231, 235, 0.12); overflow: hidden; }
.tool-progress__bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #60a5fa, #a78bfa, #34d399); transition: width 0.25s linear; }
.tool-progress__text { font: 500 12px/1.4 var(--pg-mono); letter-spacing: 0.12em; color: var(--pg-muted); text-transform: uppercase; }

.tool-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tool-stat { padding: 18px 16px; border-radius: 14px; border: 1px solid rgba(229, 231, 235, 0.1); background: rgba(229, 231, 235, 0.04); }
.tool-stat b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: #fff; }
.tool-stat span { display: block; margin-top: 4px; font-size: 12px; color: var(--pg-muted); }
.tool-done { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 600; color: var(--pg-ok); }
.tool-done svg { width: 20px; height: 20px; }
.tool-kv { margin: 18px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--pg-muted); }
.tool-kv li { padding: 6px 0; border-bottom: 1px dashed rgba(229, 231, 235, 0.08); }
.tool-about { padding: 18px 16px; border-radius: 16px; border: 1px solid rgba(229, 231, 235, 0.14); background: rgba(12, 12, 14, 0.62); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.tool-about h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: #fff; }
.tool-about ul { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.75; color: var(--pg-fg); }
.tool-about li::before { content: '• '; color: var(--pg-muted); }
.tool-files { margin: 16px 0 0; padding: 0; list-style: none; font-size: 13px; }
.tool-files li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid rgba(229, 231, 235, 0.06); }
.tool-files code { font: 12px/1.4 var(--pg-mono); color: var(--pg-fg); word-break: break-all; }
.tool-tag { flex: none; padding: 2px 8px; border-radius: 999px; font: 500 10px/1.5 var(--pg-mono); letter-spacing: 0.06em; border: 1px solid var(--pg-border); color: var(--pg-muted); }
.tool-tag--req { color: var(--pg-warn); border-color: rgba(251, 191, 36, 0.35); }
.tool-tag--ok { color: var(--pg-ok); border-color: rgba(52, 211, 153, 0.4); }

/* toast */
.tool-toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 80; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px; border: 1px solid var(--pg-border);
  background: rgba(18, 18, 20, 0.95); color: var(--pg-fg); font-size: 13px; box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.tool-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---- VIBE / CIMA ---- */
.cima-stage { position: relative; min-height: 640px; }
.cima-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid rgba(229, 231, 235, 0.1); }
.cima-bar[hidden] { display: none; }
.cima-range { flex: 1 1 160px; accent-color: #60a5fa; }
.cima-bar b { font: 600 13px/1 var(--pg-mono); min-width: 40px; }
.cima-presets { display: flex; gap: 6px; }
.cima-presets .tool-btn { min-height: 28px; padding: 4px 10px; font-size: 11px; }
.cima-svg { display: block; width: 100%; height: auto; max-height: 820px; aspect-ratio: 1; cursor: grab; touch-action: none; user-select: none; }
.cima-svg.is-drag { cursor: grabbing; }
.cima-svg[hidden], .cima-intro[hidden] { display: none; }
.cima-svg .levels { animation: cima-layer-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
.cima-svg .links { animation: cima-layer-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both; }
.cima-svg .leaves { animation: cima-layer-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both; }
.cima-svg .heatmap-rings { animation: cima-layer-in 0.78s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both; }
.cima-svg .heatmap-legend { animation: cima-layer-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) 0.30s both; }
.cima-svg .heatmap-rings path { transition: opacity 0.18s ease, filter 0.18s ease; }
.cima-svg .heatmap-rings path:hover { opacity: 1 !important; filter: brightness(1.22) drop-shadow(0 0 5px rgba(255, 255, 255, 0.45)); }
.cima-svg .leaves line { transition: filter 0.18s ease; }
.cima-svg .leaves line:hover { filter: brightness(1.3); }
@keyframes cima-layer-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.cima-intro { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 24px; text-align: center; }
.cima-intro__icon { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; margin-bottom: 28px; border-radius: 50%; background: rgba(229, 231, 235, 0.1); color: var(--pg-fg); }
.cima-intro__icon svg { width: 36px; height: 36px; }
.cima-intro h3 { margin: 0 0 10px; font-size: 20px; font-weight: 600; color: #fff; }
.cima-intro > p { margin: 0 0 28px; font-size: 14px; color: var(--pg-muted); }
.cima-req { width: min(414px, 100%); padding: 20px; border-radius: 14px; border: 1px solid rgba(229, 231, 235, 0.14); background: rgba(229, 231, 235, 0.05); text-align: left; }
.cima-req h4 { margin: 0 0 10px; font-size: 14px; color: #fff; }
.cima-req ul { margin: 0 0 16px; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.8; color: var(--pg-muted); }
.cima-req li::before { content: '• '; }
.cima-req em { font-style: normal; color: #fb923c; }
.cima-code { padding: 12px; border-radius: 10px; border: 1px solid rgba(229, 231, 235, 0.14); background: rgba(0, 0, 0, 0.3); font-size: 12px; color: var(--pg-fg); }
.cima-code pre { margin: 6px 0 0; font: 12px/1.45 var(--pg-mono); white-space: pre-wrap; color: var(--pg-accent); }
.cima-select { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(229, 231, 235, 0.14); background: rgba(229, 231, 235, 0.05); }
.cima-select select { position: relative; margin-left: auto; border: 0; background: transparent; color: var(--pg-fg); font: inherit; font-size: 13px; cursor: pointer; }
.cima-select select option { color: #111; }
.cima-sw { display: flex; gap: 3px; }
.cima-sw i { width: 12px; height: 12px; border-radius: 50%; }
.cima-grad { flex: 1 1 auto; height: 14px; border-radius: 3px; }
.cima-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cima-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; border: 1px solid rgba(229, 231, 235, 0.14); background: transparent; color: var(--pg-fg); font: inherit; font-size: 12px; cursor: pointer; }
.cima-chip:hover, .cima-chip:focus-visible, .cima-chip[aria-expanded="true"] { border-color: var(--pg-accent); }
.cima-chip i { width: 10px; height: 10px; border-radius: 50%; }
/* colour popover of an L1 chip: 16 quick colours + the browser's own colour input (G3) */
.cima-pick { position: relative; }
.cima-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 164px; padding: 10px; border-radius: 12px; border: 1px solid rgba(229, 231, 235, 0.18); background: rgba(14, 14, 16, 0.98); box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.7); }
.cima-pop[hidden] { display: none; }
.cima-pop__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; justify-items: center; }
.cima-pop__sw { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.cima-pop__sw:hover, .cima-pop__sw:focus-visible { border-color: var(--pg-accent); }
.cima-pop__sw.is-on { border-color: #fff; }
.cima-pop__input { display: block; width: 100%; height: 26px; margin-top: 10px; padding: 0; border: 1px solid rgba(229, 231, 235, 0.18); border-radius: 6px; background: transparent; cursor: pointer; }
.cima-val { padding: 5px 10px; border-radius: 6px; border: 1px solid rgba(229, 231, 235, 0.14); background: transparent; color: var(--pg-muted); font: 600 11px/1.4 inherit; font-family: inherit; cursor: pointer; }
.cima-val.is-on { background: #f97316; border-color: #f97316; color: #fff; }

@media (max-width: 1023px) {
  .tool-grid, .tool-grid--side { grid-template-columns: minmax(0, 1fr); }
  .tool-panel--tall { min-height: 0; }
}
@media (max-width: 640px) {
  .tool-signed-hint { border-radius: 20px; padding: 14px 16px; text-align: center; }
  .tool-device-note { padding: 14px 16px; }
  .tool-wrap { padding: 0 16px 64px; }
  .tool-panel { padding: 20px; border-radius: 20px; }
  .tool-seg__btn { padding: 9px 14px; letter-spacing: 0.06em; }
  .tool-stats { grid-template-columns: minmax(0, 1fr); }
  .tool-table-wrap { min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  .tool-table tbody tr { animation: none; }
  .tool-btn.is-busy::before { animation-duration: 2s; }
}

/* ---- AI annotation page (G4): status line, confidence badges, model configuration dialog ---- */
.tool-btn[hidden], .tool-field[hidden], .tool-input[hidden] { display: none; }
.ann-warn { color: var(--pg-warn); }
.tool-drop.has-error { border-color: rgba(248, 113, 113, 0.5); }
.ann-chip { cursor: default; }
.ann-chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pg-ok); box-shadow: 0 0 8px rgba(52, 211, 153, 0.7); }
.ann-chip:hover { background: rgba(10, 10, 12, 0.55); border-color: var(--pg-border); }
.ann-preview { min-height: 0; max-height: 300px; overflow: auto; }
.ann-more { margin: 10px 0 0; font-size: 12px; color: var(--pg-muted); }
.ann-more[hidden] { display: none; }
.ann-status {
  display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.3); background: rgba(96, 165, 250, 0.08); color: #93c5fd;
  font: 500 12px/1.5 var(--pg-mono); word-break: break-word; white-space: pre-line;
}
.ann-status[hidden] { display: none; }
.ann-status--ok { border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); color: var(--pg-ok); }
.ann-status--err { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); color: #f87171; }
.ann-status__pct { margin-left: auto; opacity: 0.7; }
.ann-spin { flex: none; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tool-spin 0.8s linear infinite; }
.ann-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px solid; font: 700 10px/1.6 var(--pg-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.ann-badge--high { color: #34d399; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.25); }
.ann-badge--mid { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.25); }
.ann-badge--low { color: #fb7185; background: rgba(251, 113, 133, 0.1); border-color: rgba(251, 113, 133, 0.25); }
.ann-state { display: block; margin-top: 4px; font: 10px/1.4 var(--pg-mono); letter-spacing: 0.06em; text-transform: uppercase; color: rgba(229, 231, 235, 0.45); }
.ann-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.ann-foot .tool-note { margin: 0; flex: 1 1 260px; }

body.ann-lock { overflow: hidden; }
/* above the fixed site header (z-index 1000), below the page-transition masks (9998 / 9999) */
.ann-modal { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ann-modal[hidden] { display: none; }
.ann-modal__back { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: rgba(0, 0, 0, 0.62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.ann-modal__box {
  position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 28px; border-radius: 24px;
  border: 1px solid rgba(229, 231, 235, 0.16); background: rgba(14, 14, 16, 0.98); box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.8); outline: none;
}
.ann-modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ann-modal__head .tool-micro { display: block; margin-top: 8px; }
.ann-x { flex: none; width: 34px; padding: 0; font-size: 20px; line-height: 1; }
.ann-notice {
  display: flex; gap: 10px; margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(96, 165, 250, 0.3);
  background: rgba(96, 165, 250, 0.08); font-size: 12.5px; line-height: 1.6; color: var(--pg-fg);
}
.ann-notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: #93c5fd; }
.ann-select { cursor: pointer; color-scheme: dark; }
.ann-select option { background: #16161a; color: #e5e7eb; }
.ann-gap { margin-top: 8px; }
.tool-input.is-bad { border-color: rgba(248, 113, 113, 0.6); }
.ann-err { margin: 6px 0 0; font-size: 12px; color: #f87171; }
.ann-err[hidden] { display: none; }
.ann-test { width: 100%; margin-top: 20px; min-height: 40px; border-radius: 10px; }
.ann-test--ok { color: var(--pg-ok); border-color: rgba(52, 211, 153, 0.45); }
.ann-test--err { color: #f87171; border-color: rgba(248, 113, 113, 0.45); }
.ann-conn { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: #f87171; white-space: pre-line; word-break: break-word; }
.ann-conn[hidden] { display: none; }
.ann-modal__foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
@media (max-width: 640px) {
  .ann-modal { align-items: flex-end; padding: 8px; }
  .ann-modal__box { padding: 22px 18px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .ann-spin { animation-duration: 2s; }
}
