/* ── Prompt Polisher ──
   Accent: Hot Pink #EC4899
   Namespace: .polisher-*
*/

.polisher-page {
  --tool-accent: #EC4899;
  --tool-accent-dim: rgba(255, 107, 107, 0.15);
  --tool-accent-glow: rgba(255, 107, 107, 0.25);
}

/* ── Glass Pill Tabs ── */
.polisher-tabs {
  display: flex; gap: 0.5rem; padding: 0.35rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; margin-bottom: 1.5rem;
}
.polisher-tab {
  background: none; border: 1px solid transparent;
  color: rgba(255,255,255,0.5); font-size: 0.85rem; font-weight: 600;
  padding: 0.6rem 1.1rem; cursor: pointer; border-radius: 14px;
  transition: all 0.2s ease; flex: 1; text-align: center; white-space: nowrap;
}
.polisher-tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.polisher-tab.active {
  color: #000; background: #EC4899; border-color: #EC4899;
  box-shadow: 0 2px 8px rgba(236,72,153, 0.3);
}
.polisher-panel { display: none; }
.polisher-panel.active { display: block; }

/* ── Container ── */
.polisher-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ── Hero Steps (1-2-3 flow in hero area) ── */
.polisher-hero-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 700px;
  margin: 0 auto 1.5rem;
  padding: 1rem 1.5rem;
  background: rgba(236, 72, 153, 0.08);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: var(--glass-radius-card, 16px);
}
.polisher-hero-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.2rem;
  flex: 1;
}
.polisher-hero-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #EC4899;
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  font-family: var(--font-heading);
  margin-bottom: 0.15rem;
}
.polisher-hero-step strong {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: #fff;
}
.polisher-hero-desc {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}
.polisher-hero-arrow {
  color: rgba(236, 72, 153, 0.5);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}
@media (max-width: 520px) {
  .polisher-hero-steps { flex-direction: column; gap: 0.5rem; padding: 0.8rem 1rem; }
  .polisher-hero-arrow { transform: rotate(90deg); font-size: 0.9rem; }
}

/* ── Input Section ── */
.polisher-input-section {
  margin-bottom: 2rem;
}
.polisher-input-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.polisher-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.polisher-char-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.polisher-textarea {
  width: 100%;
  min-height: 140px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.polisher-textarea:focus {
  outline: none;
  border-color: var(--tool-accent);
  box-shadow: 0 0 0 3px var(--tool-accent-dim);
}
.polisher-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Action Buttons ── */
.polisher-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.polisher-shortcut-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 0.4rem;
}
.polisher-shortcut-hint kbd {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  font-family: var(--font-heading);
  font-size: 0.68rem;
}
.polisher-btn-primary {
  padding: 0.7rem 1.5rem;
  background: var(--tool-accent);
  color: #0a0a1a;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}
.polisher-btn-primary:hover:not(:disabled) {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px var(--tool-accent-glow);
}
.polisher-btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.polisher-btn-secondary {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
}
.polisher-btn-secondary:hover {
  border-color: var(--tool-accent);
  color: var(--tool-accent);
}

/* ── Platform Selector ── */
.polisher-platform-select {
  padding: 0.5rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s;
}
.polisher-platform-select:focus {
  border-color: var(--tool-accent);
  outline: none;
}
.polisher-platform-select option {
  background: #1e1e30;
  color: var(--text-primary);
}

/* ── View Toggle (Polished / Before-After) ── */
.polisher-view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.polisher-toggle-btn {
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.polisher-toggle-btn.active {
  background: var(--tool-accent);
  color: #0a0a1a;
}
.polisher-toggle-btn:hover:not(.active) {
  color: var(--text-primary);
}

/* ── Compare View ── */
.polisher-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.polisher-compare-col {
  padding: 1rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.polisher-compare-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.6rem;
  color: var(--text-muted);
}
.polisher-compare-text {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.polisher-compare-after {
  color: #22c55e;
}

/* ── Examples Dropdown ── */
.polisher-examples-wrap {
  position: relative;
}
.polisher-examples-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: #1e1e30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  z-index: 20;
  min-width: 220px;
  overflow: hidden;
}
.polisher-examples-menu button {
  display: block;
  width: 100%;
  padding: 0.6rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
.polisher-examples-menu button:hover {
  background: var(--tool-accent-dim);
  color: var(--tool-accent);
}

/* ── Results Section ── */
.polisher-results {
  animation: polisher-fade-in 0.4s ease;
}
@keyframes polisher-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Score Dashboard ── */
.polisher-score-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.polisher-score-header {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.polisher-score-ring {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.polisher-score-number {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 2.8rem;
  line-height: 1;
  transition: color 0.3s;
}
.polisher-score-max {
  font-size: 1.1rem;
  color: var(--text-muted);
  font-weight: 600;
}
.polisher-score-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.polisher-score-label {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
}
.polisher-score-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── Pillar Bars ── */
.polisher-pillars {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.polisher-pillar {
  display: grid;
  grid-template-columns: 90px 1fr 50px;
  align-items: center;
  gap: 0.8rem;
}
.polisher-pillar-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.polisher-pillar-name .polisher-craft-icon {
  margin-right: 0.3rem;
}
.polisher-pillar-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}
.polisher-pillar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease, background 0.3s;
}
.polisher-pillar-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
  text-align: right;
}

/* Score colours */
.polisher-score-low { color: #ef4444; }
.polisher-score-med { color: #f59e0b; }
.polisher-score-good { color: #22c55e; }
.polisher-score-great { color: #3b82f6; }
.polisher-fill-low { background: #ef4444; }
.polisher-fill-med { background: #f59e0b; }
.polisher-fill-good { background: #22c55e; }
.polisher-fill-great { background: #3b82f6; }

/* ── Tips Section ── */
.polisher-tips-section {
  margin-bottom: 1.5rem;
}
.polisher-section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.8rem;
}
.polisher-tips {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.polisher-tip {
  display: flex;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  border-left: 3px solid var(--tool-accent);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.polisher-tip-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 0.05rem;
}
.polisher-tip strong {
  color: var(--text-primary);
  display: inline-block;
  margin-bottom: 0.15rem;
}
.polisher-no-tips {
  padding: 1rem;
  text-align: center;
  color: #22c55e;
  font-weight: 600;
  font-family: var(--font-heading);
}

/* ── Output Section ── */
.polisher-output-section {
  margin-bottom: 2rem;
  background: rgba(255, 107, 107, 0.04);
  border: 2px solid rgba(255, 107, 107, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.polisher-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}
.polisher-output-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.polisher-output-actions {
  display: flex;
  gap: 0.5rem;
}
.polisher-output {
  padding: 1.2rem;
  background: rgba(255, 107, 107, 0.06);
  border: 1px solid rgba(255, 107, 107, 0.2);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.polisher-output .polisher-added {
  background: rgba(34, 197, 94, 0.15);
  border-radius: 3px;
  padding: 0 2px;
}

/* ── CRAFTS Framework Cards ── */
.polisher-about {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 2.5rem;
  margin-top: 1rem;
  text-align: center;
}
.polisher-about h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--tool-accent);
  margin-bottom: 0.5rem;
}
.polisher-about > p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 1.5rem;
}
.polisher-crafts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  text-align: left;
}
.polisher-craft-card {
  padding: 1rem 1.2rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
}
.polisher-craft-card .polisher-craft-letter {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: var(--tool-accent);
  color: #0a0a1a;
  border-radius: 6px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.polisher-craft-card strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.polisher-craft-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* ── History Section ── */
.polisher-history {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.polisher-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}
.polisher-history-item:hover {
  background: var(--tool-accent-dim);
}
.polisher-history-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80%;
}
.polisher-history-score {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.78rem;
}

/* ── How It Works (pre-analysis) ── */
.polisher-how-it-works {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem 0;
  margin-bottom: 1rem;
}
.polisher-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.polisher-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--tool-accent-dim);
  color: var(--tool-accent);
  border-radius: 50%;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ── Output footer ── */
.polisher-output-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.8rem;
}

/* ── Score delta badge ── */
.polisher-score-delta {
  margin-top: 0.8rem;
  text-align: center;
}
.polisher-delta-badge {
  display: inline-block;
  padding: 0.5rem 1.2rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.polisher-delta-up {
  color: #22c55e;
  font-weight: 700;
  margin-left: 0.3rem;
}

/* ── Related Prompts ── */
.polisher-related-section {
  margin-bottom: 1.5rem;
}
.polisher-related-list {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.polisher-related-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: var(--radius);
  color: #A78BFA;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.polisher-related-item:hover {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.4);
  transform: translateY(-1px);
}
.polisher-related-arrow {
  opacity: 0.5;
  transition: opacity 0.2s;
}
.polisher-related-item:hover .polisher-related-arrow {
  opacity: 1;
}

/* ── Added text legend ── */
.polisher-added-legend {
  color: #22c55e;
  font-weight: 600;
}

/* ── Diff highlighting in output ── */
.polisher-output .polisher-added {
  color: #22c55e;
}

/* ── Bigger copy button ── */
.polisher-btn-copy {
  padding: 0.55rem 1.2rem;
  background: var(--tool-accent);
  color: #0a0a1a;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 44px;
}

/* ── Nav accent ── */
.page-polisher .site-nav {
  --nav-accent: rgba(255, 107, 107, 0.35);
}

/* ── Focus visible ── */
.polisher-page :focus-visible {
  outline: 2px solid var(--tool-accent);
  outline-offset: 2px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .polisher-results { animation: none; }
  .polisher-pillar-fill { transition: none; }
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .polisher-container { padding: 0 1rem 3rem; }
  .polisher-score-header { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .polisher-score-number { font-size: 2.2rem; }
  .polisher-pillar { grid-template-columns: 80px 1fr 45px; gap: 0.5rem; }
  .polisher-crafts-grid { grid-template-columns: 1fr 1fr; }
  .polisher-output-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .polisher-how-it-works { flex-direction: column; gap: 0.6rem; padding: 1.5rem 0; }
  .polisher-shortcut-hint { display: none; }
  .polisher-compare { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .polisher-crafts-grid { grid-template-columns: 1fr; }
  .polisher-actions { flex-direction: column; align-items: stretch; }
  .polisher-actions .polisher-btn-primary { text-align: center; }
}

/* ══ Prompt Toolkit Cross-Links ══ */
.polisher-ecosystem { text-align: center; padding: 2rem 0; max-width: 700px; margin: 0 auto; }
.polisher-ecosystem h2 { color: #e6edf3; margin-bottom: 1rem; font-size: 1.2rem; }
.polisher-eco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.polisher-eco-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 1.25rem 1rem;
  text-decoration: none;
  color: #e6edf3;
  transition: all 0.2s;
  text-align: center;
}
.polisher-eco-card:hover { border-color: #EC4899; }
.polisher-eco-card.polisher-eco-active { border-color: #EC4899; background: rgba(236, 72, 153, 0.1); }
.polisher-eco-card span { font-size: 1.5rem; display: block; margin-bottom: 0.5rem; }
.polisher-eco-card strong { display: block; margin-bottom: 0.25rem; }
.polisher-eco-card p { font-size: 0.8rem; color: rgba(255,255,255,0.6); margin: 0; }
@media (max-width: 480px) { .polisher-eco-grid { grid-template-columns: 1fr; } }
