/* External stylesheet for L11: Label Roll Unwind Direction Chart (#1-#8) & Roll Calculator */
.reading-content {
  min-width: 0;
  max-width: 100%;
}

.reading-content code {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.reading-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.unwind-tool-shell {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #0f172a;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

.unwind-tool-shell * {
  box-sizing: border-box;
  min-width: 0;
}

.unwind-tool-header {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.unwind-tool-header h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.35rem;
  color: #0f172a;
}

.unwind-tool-header p {
  margin: 0;
  font-size: 0.95rem;
  color: #475569;
}

.unwind-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.unwind-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.unwind-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.unwind-field select,
.unwind-field input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: 0.92rem;
  color: #0f172a;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  box-sizing: border-box;
}

.unwind-field select:focus,
.unwind-field input:focus {
  outline: 2px solid #2563eb;
  border-color: #2563eb;
}

.unwind-field-hint {
  font-size: 0.78rem;
  color: #64748b;
}

/* 8-Position Selector Grid */
.unwind-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.unwind-pos-card {
  padding: 0.9rem;
  background: #ffffff;
  border: 2px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
  text-align: left;
}

.unwind-pos-card:hover {
  border-color: #2563eb;
}

.unwind-pos-card.is-selected {
  background: #eff6ff;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.18);
}

.unwind-pos-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}

.unwind-pos-num {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a8a;
}

.unwind-pos-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e40af;
}

.unwind-pos-badge.is-inside {
  background: #ccfbf1;
  color: #115e59;
}

.unwind-pos-lead {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 0.25rem;
}

.unwind-pos-use {
  font-size: 0.8rem;
  color: #475569;
  line-height: 1.35;
}

/* Active Position Banner */
.unwind-active-summary {
  padding: 1rem 1.15rem;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 8px;
  margin-bottom: 1.75rem;
}

.unwind-active-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.35rem 0;
}

.unwind-active-desc {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.45;
}

/* Calculator Results Panel */
.unwind-calc-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 1.5rem 0;
}

.unwind-metric-box {
  padding: 0.9rem 1rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #1d4ed8;
  border-radius: 6px;
}

.unwind-metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #475569;
  margin-bottom: 0.25rem;
}

.unwind-metric-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #0f172a;
}

.unwind-metric-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.2rem;
}

/* RFQ Spec Output Block */
.unwind-rfq-panel {
  margin-top: 1.5rem;
  padding: 1.15rem;
  background: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 8px;
}

.unwind-rfq-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.unwind-rfq-header h4 {
  margin: 0;
  font-size: 1rem;
  color: #0f172a;
}

.unwind-rfq-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.unwind-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  background: #1d4ed8;
  border: 1px solid #1e40af;
  border-radius: 6px;
  cursor: pointer;
}

.unwind-btn:hover {
  background: #1e40af;
}

.unwind-btn-secondary {
  color: #0f172a;
  background: #f1f5f9;
  border-color: #94a3b8;
}

.unwind-btn-secondary:hover {
  background: #e2e8f0;
}

.unwind-rfq-pre {
  margin: 0;
  padding: 0.85rem;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-variant-numeric: tabular-nums;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-x: auto;
}

@media (max-width: 640px) {
  .unwind-tool-shell {
    padding: 1rem;
  }
  .unwind-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
  .unwind-calc-results {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .unwind-cards-grid {
    grid-template-columns: 1fr;
  }
  .unwind-calc-results {
    grid-template-columns: 1fr;
  }
}
