/* Stitch marker lines + their menus (rowbie#126/#130/#131).
   components/stitch_markers.rs. Prefix: sm-* */

/* Marker lines: blocks snapped to whole screen pixels (stitch_markers.rs). */
.sm-line,
.sm-line-emphasis,
.sm-line-halo {
  position: absolute;
  pointer-events: none;
}

/* Under a lifted marker: a soft accent halo. */
.sm-line-halo {
  background: var(--accent);
  opacity: 0.35;
  border-radius: 100px;
}

/* Covers the chart page box inside CroppedChartImage (page % coordinates). */
.sm-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ── Menus (rendered outside the zoom canvas) ─────────────────────────── */
.sm-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
}

/* Swallows the tap a browser sends when the long-press finger lifts. */
.sm-shield {
  position: fixed;
  inset: 0;
  z-index: 301;
}

.sm-menu {
  position: fixed;
  z-index: 300;
  width: 260px;
  max-height: calc(100vh - 16px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--ink);
}

.sm-head {
  font-size: var(--fs-10);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mid);
  padding: 6px 8px;
}

.sm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font-size: var(--fs-14);
  text-align: left;
  cursor: pointer;
}

.sm-item:hover { background: var(--surface2); }

.sm-danger { color: var(--danger); }

.sm-sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.sm-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
}

.sm-msg {
  margin: 6px 8px;
  font-size: var(--fs-14);
  line-height: 1.4;
}

.sm-hint {
  margin: 0 8px;
  font-size: var(--fs-12);
  color: var(--ink-mid);
}

.sm-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px;
  font-size: var(--fs-14);
  color: var(--ink-mid);
}

.sm-input {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-14);
}

.sm-range { flex: 1; min-width: 0; }

.sm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 8px;
}

.sm-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface2);
  color: var(--ink);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
}

/* CLAUDE.md button colour rule: accent background → var(--bg) text. */
.sm-btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}

.sm-btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.sm-style-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  min-height: 40px;
}

.sm-style-name {
  flex: 1;
  min-width: 0;
  font-size: var(--fs-14);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sm-style-uses {
  font-size: var(--fs-12);
  color: var(--ink-mid);
  font-variant-numeric: tabular-nums;
}

.sm-mini {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: none;
  color: var(--ink);
  font-size: var(--fs-12);
  cursor: pointer;
}

.sm-mini.sm-danger { color: var(--danger); }

/* Row-instruction badge for written instructions: the linked style's dot. */
.sm-badge-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin: 0 4px 0 2px;
  vertical-align: middle;
}

.sm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  font-size: var(--fs-14);
  color: var(--ink-mid);
  cursor: pointer;
}

.sm-link {
  border: 0;
  background: none;
  padding: 0 4px;
  font-size: var(--fs-12);
  color: var(--ink-mid);
  text-decoration: underline;
  cursor: pointer;
}
.sm-link.sm-danger { color: var(--danger); }

.sm-actions-gap { flex: 1; }

/* Editor's trash-can delete. */
.sm-icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: none;
  cursor: pointer;
}
.sm-icon-btn.sm-danger { color: var(--danger); }
.sm-icon-btn:hover { background: var(--danger-lt); }
