/* Step 1: picture screen. */

.pic-viewport canvas { cursor: default; touch-action: none; }
.pic-hint {
  position: absolute; left: 12px; right: 12px; bottom: 10px; margin: 0;
  padding: 7px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--text); font-size: 13px; text-align: center; pointer-events: none;
  transition: opacity .4s ease;
}
.pic-hint.gone { opacity: 0; }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }
.btn.block { display: flex; width: 100%; margin-top: 8px; }
.slider input[type="range"] { width: 100%; accent-color: var(--accent); }
.slider b { font-weight: 400; color: var(--muted); }
.pic-mini {
  display: grid; place-items: center; min-height: 120px; max-height: 340px; overflow: hidden;
  padding: 4px; border-radius: 10px; background: var(--chart-bg); border: 1px solid var(--line);
}
.pic-mini canvas { display: block; max-width: 100%; height: auto !important; }
.pic-info { margin: 10px 0 2px; font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
.pic-quality { margin: 4px 0; font-size: 13px; }
.pic-quality[data-level="good"] { color: var(--done); }
.pic-quality[data-level="low"] { color: var(--danger); }
.pic-nomesh { margin: 0; padding: 12px; border-radius: 10px; background: var(--surface-2, rgba(0, 0, 0, 0.05)); color: var(--danger); font-weight: 600; line-height: 1.4; }
.linkbtn { border: 0; padding: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
kbd {
  padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  background: var(--surface); font: 600 13px var(--font); white-space: nowrap;
}

/* Chart editor: checking unsure squares */
.review-btn { background: color-mix(in srgb, #f2bf1a 25%, var(--surface)); border-color: #e2b014; }
.review-bar {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 5;
  display: flex; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.viewport .review-bar canvas { position: static; inset: auto; flex: none; width: 104px; height: 104px; border-radius: 10px; cursor: default; }
@media (max-width: 720px) {
  .viewport .review-bar canvas { width: 84px; height: 84px; }
  .review-bar { gap: 10px; padding: 8px; }
  .review-bar p { font-size: 13px; }
  .review-actions .btn { min-height: 40px; padding: 0 8px; }
}
.review-main { flex: 1; min-width: 0; }
.review-bar p { margin: 0 0 8px; font-size: 14px; font-weight: 560; }
.review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.review-actions .btn { flex: 1; min-height: 44px; }
.review-actions .btn.ghost { flex: 0 0 auto; }
.menu-pop button:disabled { opacity: .4; cursor: default; }

/* Help dialog */
.help h4 { margin: 14px 0 4px; font-size: 15px; }
.help h4:first-child { margin-top: 0; }
.help p { margin: 0 0 8px; color: var(--text); font-size: 14px; }
.help .keys { margin: 0 0 8px; padding-left: 18px; font-size: 14px; line-height: 1.9; }
.dlg .help { max-height: 62dvh; overflow: auto; }

/* Dropping a file anywhere */
body.dropping::after {
  content: 'Drop the picture to read it';
  position: fixed; inset: 12px; z-index: 200;
  display: grid; place-items: center;
  border: 3px dashed var(--accent); border-radius: 20px;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  color: var(--text); font: 650 22px var(--font-display);
  pointer-events: none;
}

@media (max-width: 720px) {
  .pic-viewport { min-height: 52dvh; }
  .pic-hint { font-size: 12px; bottom: 6px; }
  #panel-picture .toolbar .seg button span { display: inline; }
}

/* First visit: keep it as an app */
.install .inst-lead { margin: 0 0 12px; font-size: 15px; }
.inst-steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.inst-steps li { display: flex; gap: 12px; align-items: center; font-size: 15px; line-height: 1.4; }
.inst-n {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.share-ico { width: 20px; height: 20px; vertical-align: -4px; color: #0a84ff; }
