/* fv-measure.css — measurement toolbar for the SATYR client file viewer.
   Uses the tokens already defined in index.html's :root so it inherits the
   portal's palette rather than introducing a second one. */

.fv-measure-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  background: rgba(13, 20, 36, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border, rgba(255,255,255,0.06));
  padding: 8px 12px calc(8px + var(--safe-bot, 0px));
  font-family: var(--ui, system-ui, sans-serif);
  display: grid;
  gap: 7px;
}

.fvm-tools,
.fvm-export {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.fv-measure-bar button {
  background: var(--bg-card, #121b2e);
  color: var(--text-dim, #8a9ab8);
  border: 1px solid var(--border, rgba(255,255,255,0.06));
  border-radius: 5px;
  padding: 6px 11px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.fv-measure-bar button:hover {
  color: var(--text, #e8edf5);
  border-color: var(--border-t, rgba(45,224,196,0.28));
}
.fv-measure-bar button.on {
  background: var(--teal, #2de0c4);
  color: #070c16;
  border-color: var(--teal, #2de0c4);
  font-weight: 600;
}
.fv-measure-bar button:focus-visible {
  outline: 2px solid var(--teal, #2de0c4);
  outline-offset: 2px;
}

.fvm-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border, rgba(255,255,255,0.08));
  margin: 0 3px;
}

.fvm-status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.66rem;
  color: var(--text-off, #4a5a78);
  letter-spacing: 0.04em;
}
.fv-measure-bar button.fvm-link {
  background: none;
  border: none;
  color: var(--teal, #2de0c4);
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.fvm-export button {
  font-size: 0.66rem;
  padding: 5px 9px;
}

.fvm-list {
  max-height: 132px;
  overflow-y: auto;
  display: grid;
  gap: 3px;
}
.fvm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.74rem;
}
.fvm-dot {
  width: 8px; height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.fvm-type {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-off, #4a5a78);
  min-width: 58px;
}
.fvm-val {
  font-family: var(--mono, ui-monospace, monospace);
  color: var(--text, #e8edf5);
  font-weight: 600;
}
.fvm-sec {
  font-size: 0.68rem;
  color: var(--text-dim, #8a9ab8);
}
.fvm-del {
  margin-left: auto;
  background: none !important;
  border: none !important;
  color: var(--text-off, #4a5a78) !important;
  font-size: 1rem !important;
  line-height: 1;
  padding: 2px 6px !important;
}
.fvm-del:hover { color: var(--danger, #ef4444) !important; }

.fvm-empty {
  font-size: 0.72rem;
  color: var(--text-off, #4a5a78);
  padding: 6px 2px;
}

/* The image wrapper needs room for the bar so the toolbar never covers
   the bottom of the report figure. */
#fv-img-wrap.measuring { padding-bottom: 190px; }

@media (max-width: 520px) {
  .fvm-list { max-height: 96px; }
  .fv-measure-bar button { padding: 5px 9px; font-size: 0.66rem; }
}

@media (prefers-reduced-motion: reduce) {
  .fv-measure-bar button { transition: none; }
}

/* ── Inline calibration (replaces prompt(), which browsers suppress) ── */
.fvm-calib { padding: 4px 2px; }
.fvm-calib-q {
  font-size: 0.78rem;
  color: var(--text, #e8edf5);
  margin-bottom: 7px;
}
.fvm-calib-q b { font-family: var(--mono, ui-monospace, monospace); }
.fvm-calib-row { display: flex; gap: 6px; align-items: center; }
.fvm-calib-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-deep, #070c16);
  color: var(--text, #e8edf5);
  border: 1px solid var(--border-t, rgba(45,224,196,0.28));
  border-radius: 5px;
  padding: 7px 9px;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.82rem;
}
.fvm-calib-input:focus {
  outline: 2px solid var(--teal, #2de0c4);
  outline-offset: 1px;
}
.fvm-calib-input.bad {
  border-color: var(--danger, #ef4444);
  outline-color: var(--danger, #ef4444);
}
#fvm-calib-ok {
  background: var(--teal, #2de0c4) !important;
  color: #070c16 !important;
  border-color: var(--teal, #2de0c4) !important;
  font-weight: 600;
}
.fvm-calib-hint {
  font-size: 0.68rem;
  color: var(--text-off, #4a5a78);
  margin-top: 6px;
  line-height: 1.4;
}
