/* PackSlip: 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; }
}

/* Lesson material: imported files as cards above the text box (same as ScopeLine) */

.well-stack { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }

.well-stack > textarea { flex: 1 0 auto; height: auto; }

.well-stack.has-docs > textarea { min-height: 70px; }

.doc-list { display: flex; flex-direction: column; gap: 10px; }

.doc-list[hidden] { display: none; }

.doc-card {
  --accent: #6366f1;
  --accent-soft: #eef2ff;
  position: relative;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px 12px 10px 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 6px 16px -8px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  animation: doc-card-in 0.28s ease-out;
}

.doc-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #a855f7));
}

.doc-card__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

.doc-card__badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 40%, transparent);
}

.doc-card__kind {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-card__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
}

.doc-card__remove {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 18px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}

.doc-card__remove:hover,
.doc-card__remove:focus-visible { background: var(--accent-soft); color: var(--accent); }

.doc-card__body {
  margin: 0;
  color: #1e293b;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.doc-card__body.is-open { display: block; }

.doc-card__more {
  margin-top: 4px;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
}

.doc-card__more:hover { text-decoration: underline; }

@keyframes doc-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .doc-card { animation: none; }
}

.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);
}

/* Slips box: the empty drop target and each file's status */

.drop-empty {
  width: 100%; height: 100%; min-height: 160px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px;
  border: 1.5px dashed #c7d2fe; border-radius: 12px; transition: border-color 0.15s, background 0.15s;
}

.drop-empty:hover { border-color: #6366f1; background: #eef2ff; }

.drop-empty[hidden] { display: none; }

.slip-status {
  flex-shrink: 0; font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 1px 6px; border-radius: 6px; background: #f1f5f9; color: #475569; white-space: nowrap;
}

.slip-card.is-working .slip-status { background: #e0e7ff; color: #4338ca; }
.slip-card.is-done .slip-status { background: #dcfce7; color: #047857; }
.slip-card.is-failed .slip-status { background: #fef3c7; color: #b45309; }

.slip-meta { margin: 4px 0 0 30px; font-size: 9pt; color: #64748b; }
.slip-card.is-failed .slip-meta { color: #b45309; }

.doc-card__remove:disabled { opacity: 0.35; cursor: default; }

/* Line-item table (same row buttons as HostCheck's tasks) */

/* Grid columns may shrink below the table's width; the table scrolls inside its box instead of widening the page. */
main > section { min-width: 0; }

.item-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }

.item-table th {
  position: sticky; top: 0; z-index: 1; background: #f8fafc; text-align: left; white-space: nowrap;
  padding: 7px 6px; font-size: 8pt; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: #475569; border-bottom: 1px solid #e2e8f0;
}

.item-table td { padding: 2px 3px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }

.item-table tbody tr:hover td { background: #f8fafc; }

.cell-input {
  width: 100%; min-width: 64px; padding: 4px 5px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: #1e293b; font: inherit; transition: border-color 0.15s, background 0.15s;
}

.cell-input:hover { border-color: #e2e8f0; background: #fff; }

.cell-input:focus { outline: none; border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.cell-input.is-missing { background: #fffbeb; border-color: #fcd34d; }

.cell-n { width: 28px; text-align: right; color: #94a3b8; font-weight: 700; font-size: 8.5pt; font-variant-numeric: tabular-nums; }
.cell-code .cell-input { min-width: 110px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9pt; }
.cell-wide .cell-input { min-width: 200px; }
.cell-num .cell-input { min-width: 56px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cell-uom .cell-input { min-width: 48px; text-transform: uppercase; }
.cell-src { max-width: 140px; padding: 2px 6px; font-size: 8.5pt; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.task-btn { color: #94a3b8; font-size: 11pt; line-height: 1; padding: 1px 3px; }
.task-btn:hover { color: #e11d48; }

.add-task { font-size: 9pt; font-weight: 600; color: #4f46e5; }
.add-task:hover { color: #312e81; text-decoration: underline; }

/* Print / PDF: a receiving checklist to tick off against the boxes. */

.print-only { display: none; }

@media print {
  @page { margin: 10mm; size: letter landscape; }

  html, body, main, main > section, main section > div {
    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, #flagText, #tableEmpty, .add-task, .task-btn, .no-print { display: none !important; }

  .print-only { display: block !important; white-space: pre-wrap; font-size: 11pt; font-weight: 600; line-height: 1.4; margin-bottom: 8px; }
  .item-table { display: table !important; font-size: 8.5pt; }
  .item-table th { position: static; border-bottom: 1.5px solid #334155; }
  .item-table td { border-bottom: 1px solid #cbd5e1; }
  .item-table tr { break-inside: avoid; }
  .cell-input { border: 0 !important; background: transparent !important; padding: 2px 3px !important; min-width: 0 !important; box-shadow: none !important; }
}
