/* ThreadMark: styles that exist only in this tool. Shared look: ../../shared/css/style.css */

/* Page shell: a one-screen cockpit on desktop; stacked and scrolling below 1024px. */

html, body { min-height: 100%; }

.app-shell { min-height: 100vh; min-height: 100dvh; }

@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden; }

  .app-shell { height: 100vh; height: 100dvh; }
}

/* 1 · Artwork: the picture well (drop target, same as QuizCard AI's file box) */

.tm-art { display: flex; align-items: center; justify-content: center; min-height: 120px; }

.tm-art__figure { display: flex; align-items: center; justify-content: center; width: 100%; }

.tm-art__figure img {
  max-width: 100%; max-height: 160px; object-fit: contain; border-radius: 8px;
  background: repeating-conic-gradient(#f1f5f9 0% 25%, #ffffff 0% 50%) 50% / 16px 16px;
}

.tm-art__empty {
  width: 100%; min-height: 100px; border: 1px dashed #cbd5e1; border-radius: 10px;
  color: #94a3b8; font-size: 10pt; font-weight: 600; transition: border-color 0.15s, color 0.15s;
}

.tm-art__empty:hover { border-color: #6366f1; color: #4f46e5; }

.tm-art__figure.hidden, .tm-art__empty.hidden { display: none; }

.tm-check { align-self: end; padding-bottom: 8px; }

.crystal-well-3d.is-drop-target {
  border-color: #6366f1;
  border-style: dashed;
  background: #eef2ff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

/* Run sheet: summary tiles */

.tm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }

.tm-stat { display: flex; flex-direction: column; gap: 1px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 10px; }

.tm-stat__label { font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #64748b; }

.tm-stat__value { font-size: 14pt; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; line-height: 1.2; }

.tm-stat__sub { font-size: 8.5pt; color: #94a3b8; }

/* Run sheet: sections and color rows (same card, number badge and pills as QuizCard AI) */

.tm-block { display: flex; flex-direction: column; gap: 6px; }

.tm-h { font-size: 9pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #4338ca; }

.tm-row { display: flex; align-items: flex-start; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 10px; }

.q-num {
  flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  display: grid; place-items: center; font-size: 9pt; font-weight: 700; color: #fff; background: #4f46e5;
}

.tm-swatch {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.tm-arrow { flex-shrink: 0; color: #94a3b8; font-weight: 700; line-height: 22px; }

.tm-row__main { flex: 1; min-width: 0; }

.tm-row__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 10.5pt; color: #0f172a; }

.tm-row__meta { margin-top: 2px; font-size: 9pt; color: #64748b; font-variant-numeric: tabular-nums; }

.tm-alts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 5px; font-size: 8.5pt; color: #64748b; }

.tm-alt { display: inline-flex; align-items: center; gap: 4px; }

.tm-alt .tm-swatch { width: 14px; height: 14px; border-radius: 4px; }

.hide-alternates .tm-alts { display: none; }

.prio { font-size: 7.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.tm-q-exact { background: #dcfce7; color: #15803d; }
.tm-q-close { background: #e0e7ff; color: #4338ca; }
.tm-q-fair { background: #fef3c7; color: #b45309; }
.tm-q-check-card { background: #ffe4e6; color: #be123c; }

/* Run sheet: machine speeds */

.tm-speeds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }

.tm-speed { display: flex; flex-direction: column; align-items: center; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 6px 4px; font-size: 8.5pt; color: #64748b; }

.tm-speed strong { font-size: 10.5pt; color: #0f172a; font-variant-numeric: tabular-nums; }

.tm-speed.is-active { border-color: #a5b4fc; background: #eef2ff; }

.tm-speed.is-active strong { color: #4338ca; }

.tm-notes { list-style: disc; padding-left: 18px; font-size: 10pt; color: #1e293b; line-height: 1.5; }

.tm-notes li + li { margin-top: 3px; }

.tm-muted { font-size: 9pt; color: #64748b; line-height: 1.45; }

.tm-fine { font-size: 8.5pt; color: #94a3b8; line-height: 1.4; }

.tm-empty { margin: auto; max-width: 340px; text-align: center; font-size: 10pt; color: #64748b; line-height: 1.5; padding: 24px 8px; }

/* Print / PDF: the operator run sheet. */

.print-only { display: none; }

@media print {
  @page { margin: 12mm; size: letter portrait; }

  html, body, main, main > section, main section > div, #sheetList {
    height: auto !important; min-height: 0 !important; max-height: none !important;
    overflow: visible !important; position: static !important; display: block !important;
    background: #fff !important; box-shadow: none !important; border: 0 !important; padding: 0 !important;
  }
  #toolHeader, #outputLockOverlay, #exampleBadge, #countText, .no-print { display: none !important; }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-only { display: block !important; white-space: pre-wrap; font-size: 11pt; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
  .tm-stats { display: grid !important; grid-template-columns: repeat(5, 1fr); margin-bottom: 10px; }
  .tm-block { display: block !important; margin-bottom: 10px; }
  .tm-row { break-inside: avoid; border: 1px solid #cbd5e1 !important; margin-bottom: 6px; }
  .tm-speeds { display: grid !important; }
}
