/* ---- Inspiration Library - Polished Minimalist Redesign ---- */

.inspiration-mode .tool-hero {
  display: none;
}

.inspiration-mode .tool-detail-head {
  display: none;
}

.inspiration-mode {
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
}

.insp-root {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.insp-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.insp-back-link:hover {
  background: #f1f5f9;
  color: #334155;
}

.insp-back-link:active {
  background: #e2e8f0;
  color: #334155;
}

.insp-back-link svg {
  width: 18px;
  height: 18px;
  color: #6366f1;
}

.insp-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.insp-form-card,
.insp-result-card,
.insp-history-panel {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 16px;
}

.insp-form-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.insp-form-header,
.insp-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.insp-form-header-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #ede9fe;
  color: #6366f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insp-form-header-icon svg {
  width: 16px;
  height: 16px;
}

.insp-form-header > div:last-child {
  flex: 1;
}

.insp-form-header h3,
.insp-panel-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}

.insp-form-header p {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.6;
  color: #64748b;
}

.insp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.insp-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.insp-textarea-wrap textarea {
  width: 100%;
  min-height: 128px;
  padding: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #334155;
  resize: vertical;
  transition: all 0.2s;
}

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

.insp-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.insp-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.insp-option strong {
  font-size: 0.8rem;
  font-weight: 700;
  color: inherit;
}

.insp-option span {
  font-size: 0.72rem;
  line-height: 1.5;
  color: inherit;
  opacity: 0.82;
}

.insp-option.is-active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.insp-action-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
}

.insp-secondary-btn,
.insp-btn-primary,
.insp-copy-btn,
.insp-card-btn {
  border: none;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.insp-secondary-btn {
  min-height: 44px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.insp-secondary-btn:hover {
  background: #f1f5f9;
  color: #334155;
}

.insp-secondary-btn.is-recording {
  background: #fee2e2;
  border-color: #fecaca;
  color: #b91c1c;
}

.insp-secondary-btn:disabled,
.insp-btn-primary:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.insp-btn-primary {
  min-height: 44px;
  background: #6366f1;
  color: #fff;
}

.insp-btn-primary:hover {
  opacity: 0.92;
}

.insp-form-tip {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.5;
  color: #94a3b8;
}

.insp-result-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.insp-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.insp-result-header.is-pending {
  background: #fffbeb;
  border-color: #fde68a;
}

.insp-result-header.is-failed {
  background: #fef2f2;
  border-color: #fecaca;
}

.insp-result-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.insp-result-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}

.insp-result-header.is-pending .insp-result-status-dot {
  background: #d97706;
}

.insp-result-header.is-failed .insp-result-status-dot {
  background: #dc2626;
}

.insp-result-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.insp-result-meta {
  margin-top: 2px;
  font-size: 0.72rem;
  color: #64748b;
}

.insp-result-summary {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #475569;
}

.insp-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.insp-meta-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.insp-meta-card span {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
}

.insp-meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.insp-block {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insp-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insp-block-head h4 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.insp-block-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insp-block-icon svg {
  width: 16px;
  height: 16px;
}

.insp-block-icon--idea {
  background: #fef3c7;
  color: #d97706;
}

.insp-block-icon--result {
  background: #e0f2fe;
  color: #0284c7;
}

.insp-block-content {
  font-size: 0.84rem;
  line-height: 1.72;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
}

.insp-block-content.is-error {
  color: #dc2626;
}

.insp-block-content.is-pending {
  color: #94a3b8;
}

.insp-copy-btn {
  margin-left: auto;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.insp-copy-btn:hover {
  background: #f1f5f9;
}

.insp-panel-tag {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
}

.insp-panel-count {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
}

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

.insp-history-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s;
}

.insp-history-card.is-active {
  border-color: #c7d2fe;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.insp-history-card.is-failed {
  border-color: #fecaca;
}

.insp-history-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.insp-history-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insp-history-icon svg {
  width: 16px;
  height: 16px;
}

.insp-history-icon--success {
  background: #e0f2fe;
  color: #0284c7;
}

.insp-history-icon--pending {
  background: #fef3c7;
  color: #d97706;
}

.insp-history-icon--failed {
  background: #fee2e2;
  color: #dc2626;
}

.insp-history-copy {
  flex: 1;
  min-width: 0;
}

.insp-history-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.insp-history-title-row strong {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
}

.insp-type-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.68rem;
  font-weight: 600;
  color: #64748b;
}

.insp-history-preview {
  margin: 8px 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #475569;
}

.insp-history-meta,
.insp-history-time {
  font-size: 0.72rem;
  color: #94a3b8;
}

.insp-history-meta {
  margin-top: 8px;
}

.insp-history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insp-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.insp-card-btn {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #64748b;
}

.insp-card-btn:hover {
  background: #f1f5f9;
}

.insp-card-btn.is-danger {
  border-color: #fecaca;
  color: #dc2626;
  background: #fff;
}

.insp-card-btn.is-danger:hover {
  background: #fef2f2;
}

.insp-empty {
  text-align: center;
  padding: 24px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  font-size: 0.82rem;
  color: #94a3b8;
}

.insp-overlay,
.insp-rec-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.insp-overlay.hidden,
.insp-rec-overlay.hidden {
  display: none;
}

.insp-overlay {
  background: rgba(255, 255, 255, 0.92);
}

.insp-overlay-content,
.insp-rec-content {
  text-align: center;
}

.insp-overlay-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 999px;
  animation: insp-spin 0.8s linear infinite;
}

.insp-overlay-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
}

.insp-overlay-sub {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #94a3b8;
}

.insp-rec-overlay {
  background: rgba(15, 23, 42, 0.88);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.insp-rec-content {
  color: #fff;
}

.insp-rec-pulse {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: insp-rec-pulse-anim 1.2s ease-in-out infinite;
  transition: all 0.2s;
}

.insp-rec-core {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #fff;
  transition: all 0.2s;
}

.insp-rec-label {
  font-size: 1.08rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.insp-rec-timer {
  font-size: 2rem;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.insp-rec-hint {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.65);
}

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

@keyframes insp-rec-pulse-anim {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.14);
    opacity: 0.72;
  }
}

@media (max-width: 640px) {
  .insp-option-grid,
  .insp-meta-grid {
    grid-template-columns: 1fr;
  }

  .insp-action-row {
    grid-template-columns: 1fr;
  }

  .insp-result-header,
  .insp-history-footer,
  .insp-panel-head {
    flex-direction: column;
    align-items: stretch;
  }

  .insp-copy-btn,
  .insp-history-actions {
    width: 100%;
  }

  .insp-history-actions {
    justify-content: space-between;
  }

  .insp-card-btn {
    flex: 1;
  }
}
