/* ─── Sheet Detail — Visual Analysis button + modal ─── */

.sheet-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.sheet-detail-btn {
  appearance: none;
  border: 1px solid var(--blue, #14b8a6);
  background: transparent;
  color: var(--blue, #14b8a6);
  font-family: var(--font, inherit);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 0.35rem;
  transition: background 0.15s, color 0.15s;
}
.sheet-detail-btn:hover {
  background: var(--blue, #14b8a6);
  color: #fff;
}
.sheet-detail-btn:disabled {
  opacity: 0.55;
  cursor: progress;
}

.sheet-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: none;
}
.sheet-detail-modal.is-open {
  display: block;
}

.sheet-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 25, 0.55);
  backdrop-filter: blur(2px);
}

.sheet-detail-panel {
  position: absolute;
  top: 5vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 92vw);
  max-height: 88vh;
  background: #fff;
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sheet-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.sheet-detail-title {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
}

.sheet-detail-close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
  padding: 0 0.25rem;
}
.sheet-detail-close:hover {
  color: #111827;
}

.sheet-detail-body {
  padding: 1rem 1.25rem 1.5rem;
  overflow-y: auto;
  font-size: 0.88rem;
  color: #1f2937;
  line-height: 1.45;
}

.sheet-detail-body h4 {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sheet-detail-summary {
  padding: 0.75rem 0.9rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  color: #065f46;
}

.sheet-detail-loading {
  text-align: center;
  padding: 3rem 1rem;
  color: #4b5563;
}

.sheet-detail-spinner {
  margin: 0 auto 1rem;
  width: 32px;
  height: 32px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--blue, #14b8a6);
  border-radius: 50%;
  animation: sheet-detail-spin 0.8s linear infinite;
}

@keyframes sheet-detail-spin {
  to { transform: rotate(360deg); }
}

.sheet-detail-error {
  padding: 0.75rem 0.9rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
}

.sheet-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.sheet-detail-table th,
.sheet-detail-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: top;
}
.sheet-detail-table thead th {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}

.sheet-detail-flag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.sheet-detail-list {
  margin: 0;
  padding-left: 1.1rem;
}
.sheet-detail-list li {
  margin-bottom: 0.45rem;
}

.sheet-detail-tag {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 0.25rem;
  background: #e5e7eb;
  color: #374151;
}
.sheet-detail-tag.tag-material { background: #dcfce7; color: #166534; }
.sheet-detail-tag.tag-dimension { background: #dbeafe; color: #1e40af; }
.sheet-detail-tag.tag-note { background: #e5e7eb; color: #374151; }
.sheet-detail-tag.tag-detail { background: #fef3c7; color: #92400e; }
.sheet-detail-tag.tag-schedule { background: #f3e8ff; color: #6b21a8; }
