:root {
  --insp-panel-width: 420px;
  --insp-bg: rgba(12, 12, 13, 0.92);
  --insp-border: rgba(255, 255, 255, 0.1);
  --insp-muted: #8d8d8d;
}

.insp-trigger-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(20, 20, 20, 0.86);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 200;
  transition: all 0.2s ease;
}

.insp-trigger-btn:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(26, 26, 28, 0.96);
}

#btn-inspirations {
  border-radius: 999px;
}

/* Eyedropper active — keep the existing button surface, tint the icon only */
#btn-inspirations.insp-eyedropper-active {
  color: #5b9cf5 !important;
}

.insp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  display: none;
}

.insp-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.insp-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(var(--insp-panel-width), 92vw);
  height: 100vh;
  background: var(--insp-bg);
  border-left: 1px solid var(--insp-border);
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s linear 0.32s;
  z-index: 1900;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  contain: layout paint;
  will-change: transform;
}

.insp-panel.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(14px);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0s linear 0s;
}

/* ── Inspiration panel tabs: lean flat style with underline ── */
.insp-tabs {
  margin: 0;
  padding: 0 8px;
  gap: 0;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--insp-border);
  /* Override startup-tabs inherited styles */
  margin-bottom: 0 !important;
  margin-top: 0 !important;
}

/* Strip the angled 3D tab effect from startup-tab when inside insp-tabs */
.insp-tab.startup-tab::before {
  display: none !important;
}

.insp-tab.startup-tab {
  position: relative;
  padding: 10px 14px;
  background: transparent !important;
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  z-index: 1;
  width: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  outline: none;
}

.insp-tab.startup-tab:hover {
  color: var(--text-secondary);
  background: transparent !important;
}

.insp-tab.startup-tab.active {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.7) !important;
  background: transparent !important;
  z-index: 3;
}

.insp-tab.startup-tab i {
  font-size: 11px;
  opacity: 0.8;
}

.insp-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: color 0.15s, background 0.15s;
}

.insp-close-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.07);
}

.insp-tab-panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 10px 14px 14px;
}

.insp-tab-panel.active {
  display: flex;
}

.insp-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  margin-bottom: 12px;
}

#insp-search {
  min-width: 0;
  width: 100%;
  height: 30px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-primary);
  padding: 0 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

#insp-search::placeholder {
  color: var(--text-muted);
}

#insp-search:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

.insp-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  font-size: 13px;
}

.insp-icon-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.insp-icon-btn.active {
  color: #5b9cf5;
  background: rgba(64, 128, 255, 0.12);
  border: 1px solid rgba(64, 128, 255, 0.35);
}

.insp-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding-right: 2px;
}

.insp-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--insp-border);
  border-radius: 4px;
  overflow: hidden;
}

.insp-card.selected {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.insp-frame-wrap {
  position: relative;
  height: 120px;
  background: #fff;
  overflow: hidden;
}

.insp-frame {
  /* Render at full desktop width, then scale down to fit the card */
  width: 1280px;
  height: 800px;
  border: none;
  pointer-events: none;
  transform-origin: top left;
  /* Scale will be set dynamically via JS, but provide a sensible CSS fallback */
  transform: scale(calc(100% / 1280));
}

.insp-ripple-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.insp-card-hit {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
}

body.insp-eyedropper .insp-card-hit {
  display: block;
}

.insp-card-meta {
  padding: 8px;
  display: flex;
  justify-content: center;
}

.insp-alias-pill {
  font-size: 10px;
  color: var(--insp-muted);
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 3px 8px;
  user-select: none;
}

.insp-empty,
.insp-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--insp-muted);
  text-align: center;
}

.insp-empty i,
.insp-placeholder i {
  font-size: 22px;
  opacity: 0.6;
}

.insp-empty small {
  max-width: 220px;
  line-height: 1.4;
}

.insp-form-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(3px);
}

.insp-form-overlay.visible {
  display: flex;
}

.insp-form-modal {
  width: min(420px, 92vw);
  padding: 20px;
  border-radius: 6px;
  border: 1px solid var(--insp-border);
  background: rgba(20, 20, 22, 0.94);
}

.insp-form-modal h3 {
  margin-bottom: 12px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insp-form-modal label {
  font-size: 11px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 6px;
}

.insp-form-modal input[type="text"] {
  width: 100%;
  margin-bottom: 12px;
  border: 1px solid var(--insp-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.38);
  color: var(--text-primary);
  padding: 8px 10px;
  font-size: 12px;
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.15s;
}

.insp-form-modal input[type="text"]:focus {
  border-color: rgba(255, 255, 255, 0.25);
}

/* ── Custom Upload Card ── */
.insp-upload-card {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.insp-upload-card.error-flash {
  border-color: rgba(255, 90, 90, 0.6) !important;
  animation: uploadErrorFlash 0.3s ease;
}

@keyframes uploadErrorFlash {
  0%, 100% { border-color: rgba(255, 90, 90, 0.6); }
  50% { border-color: rgba(255, 90, 90, 0.9); }
}

.insp-upload-idle {
  padding: 16px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.insp-upload-idle:hover {
  background: rgba(255, 255, 255, 0.025);
}

.insp-upload-idle-icon {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.insp-upload-idle-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insp-upload-idle-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.insp-upload-idle-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.insp-upload-picked {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.insp-upload-file-icon {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  flex-shrink: 0;
}

.insp-upload-filename {
  flex: 1;
  font-size: 12px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.insp-upload-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  margin-left: auto;
}

.insp-upload-action {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s, color 0.15s;
}

.insp-upload-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.insp-upload-action.danger:hover {
  background: rgba(255, 80, 80, 0.12);
  color: #ff8080;
}

.insp-hide {
  display: none !important;
}

.insp-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── Gentle multi-ring ripple effect ── */
.insp-ripple-container {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.insp-ripple-ring {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  border: 1.5px solid transparent;
  transform: translate(-50%, -50%) scale(0.3);
  opacity: 1;
  animation: inspRippleWave 0.85s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
  pointer-events: none;
}

@keyframes inspRippleWave {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0.9; }
  50%  { opacity: 0.5; }
  100% { transform: translate(-50%, -50%) scale(var(--ripple-scale, 8)); opacity: 0; }
}

#insp-preview-drop {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
}

body.insp-eyedropper-loaded #insp-preview-drop:hover {
  background: rgba(255, 255, 255, 0.05);
  outline: 1px dashed rgba(255, 255, 255, 0.3);
  outline-offset: -1px;
}

body.insp-eyedropper-loaded #insp-preview-drop {
  display: block;
  cursor: url('eyedropper-filled.svg') 1 16, copy;
}

body.insp-eyedropper,
body.insp-eyedropper * {
  cursor: url('eyedropper-filled.svg') 1 16, copy !important;
}

body.insp-eyedropper #insp-panel,
body.insp-eyedropper #insp-panel * {
  cursor: url('eyedropper-filled.svg') 1 16, copy !important;
}

.insp-mention-popover {
  position: fixed;
  z-index: 3200;
  min-width: 220px;
  max-width: 320px;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(17, 17, 18, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
  padding: 6px;
}

.insp-mention-popover.hidden {
  display: none;
}

.insp-mention-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 2px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.insp-mention-item:hover,
.insp-mention-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.insp-mention-item .alias {
  font-size: 12px;
  font-weight: 500;
}

.insp-mention-item .meta {
  font-size: 10px;
  color: var(--insp-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}
