/**
 * Scenario Coach 面板與高亮；底部安全區變數 --eip-sc-coach-reserve-px 由 JS 寫入。
 * <spec-ref>scenario-coach-reusable-plan</spec-ref>
 */
:root {
  --eip-sc-coach-reserve-px: 0px;
}

html.eip-scenario-coach-active {
  scroll-padding-bottom: calc(
    max(18rem, 38vh, var(--eip-sc-coach-reserve-px)) + env(safe-area-inset-bottom, 0px)
  );
}

html.eip-scenario-coach-active body.admin-body {
  padding-bottom: calc(
    max(18rem, 38vh, var(--eip-sc-coach-reserve-px)) + env(safe-area-inset-bottom, 0px)
  );
}

#eip-scenario-coach-mount {
  position: relative;
}

.eip-scenario-coach-panel {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  max-width: 100%;
  z-index: 1040;
  background: rgba(16, 24, 40, 0.96);
  color: #eff6ff;
  border: 1px solid rgba(191, 219, 254, 0.22);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(14px);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-size: 14px;
}

@media (min-width: 768px) {
  .eip-scenario-coach-panel {
    right: auto;
    width: min(440px, calc(100vw - 1.5rem));
  }
}

.eip-sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem 0.75rem;
  border-bottom: 1px solid rgba(191, 219, 254, 0.18);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(14, 165, 233, 0.08));
  border-radius: 16px 16px 0 0;
}

.eip-sc-title {
  font-weight: 700;
  font-size: 14px;
  color: #f8fafc;
}

.eip-sc-close {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  color: #bfdbfe;
  padding: 0 0.25rem;
}

.eip-sc-close:hover {
  color: #eff6ff;
  background: rgba(191, 219, 254, 0.1);
  border-radius: 999px;
}

.eip-sc-body {
  padding: 1rem;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  color: #dbeafe;
}

.eip-sc-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
  border: 1px solid rgba(191, 219, 254, 0.16);
  margin-bottom: 0.5rem;
}

.eip-sc-step-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 0.5rem;
  color: #f8fafc;
}

.eip-sc-instruction {
  font-size: 13px;
  color: #dbeafe;
}

.eip-sc-instruction p:last-child {
  margin-bottom: 0;
}

.eip-sc-why {
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: rgba(8, 15, 28, 0.5);
  border-radius: 8px;
  font-size: 12px;
  color: #dbeafe;
  border: 1px solid rgba(191, 219, 254, 0.16);
  border-left: 4px solid #3b82f6;
}

.eip-sc-why strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #f8fafc;
}

.eip-sc-why-body {
  display: block;
  min-height: 1.25em;
  white-space: pre-wrap;
}

.eip-sc-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(191, 219, 254, 0.16);
  background: rgba(8, 15, 28, 0.5);
  border-radius: 0 0 16px 16px;
}

.eip-sc-progress {
  font-size: 12px;
  color: #bfdbfe;
  margin-right: auto;
}

.eip-sc-footer .btn {
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
}

.eip-sc-footer .btn-outline-secondary {
  background: transparent;
  border-color: rgba(191, 219, 254, 0.16);
  color: #cbd5e1;
}

.eip-sc-footer .btn-outline-secondary:hover:not(:disabled) {
  background: rgba(191, 219, 254, 0.12);
  border-color: rgba(191, 219, 254, 0.22);
  color: #eff6ff;
}

.eip-sc-footer .btn-primary {
  background: #eff6ff;
  border-color: #eff6ff;
  color: #0f172a;
}

.eip-sc-footer .btn-primary:hover:not(:disabled) {
  background: #bfdbfe;
  border-color: #bfdbfe;
  color: #0f172a;
}

.eip-sc-footer .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#btn-scenario-coach,
#btn-scenario-coach:hover,
#btn-scenario-coach:focus {
  background: #ffc107;
  border-color: #ffc107;
  color: #212529;
  box-shadow: 0 10px 24px rgba(255, 193, 7, 0.22);
}

#btn-scenario-coach:hover:not(:disabled),
#btn-scenario-coach:focus:not(:disabled) {
  background: #ffca2c;
  border-color: #ffca2c;
  color: #212529;
}

#btn-scenario-coach:active:not(:disabled) {
  background: #ffb703;
  border-color: #ffb703;
}

.eip-sc-modal-content {
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 20px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.eip-sc-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.eip-sc-modal-card {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(191, 219, 254, 0.28);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.eip-sc-modal-card:hover,
.eip-sc-modal-card:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
  transform: translateY(-1px);
}

.eip-sc-modal-code {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.eip-sc-modal-tag {
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 0.25rem;
}

.eip-sc-modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.3rem;
}

.eip-sc-modal-summary {
  font-size: 0.875rem;
  color: #475569;
}

.eip-sc-highlight {
  outline: 3px solid #3b82f6 !important;
  outline-offset: 2px;
  border-radius: 8px;
  box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.5) !important;
  animation: eip-sc-pulse 2s infinite;
}

@keyframes eip-sc-pulse {
  0%, 100% {
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.3), 0 0 20px rgba(59, 130, 246, 0.5);
  }

  50% {
    box-shadow: 0 0 0 12px rgba(59, 130, 246, 0.1), 0 0 40px rgba(59, 130, 246, 0.7);
  }
}
