/* ==========================================================================
   Prompt Generator — style.css
   oohfixer.com
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens
   -------------------------------------------------------------------------- */

:root {
  --bg-primary:     #000000;
  --bg-surface:     #0a0a0a;
  --bg-elevated:    #111111;
  --text-primary:   #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-muted:     rgba(255, 255, 255, 0.35);
  --accent:         #60A5FA;
  --accent-glow:    rgba(96, 165, 250, 0.2);
  --accent-border:  rgba(96, 165, 250, 0.4);
  --border:         rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] {
  --bg-primary:     #ffffff;
  --bg-surface:     #f8f9fa;
  --bg-elevated:    #f0f2f5;
  --text-primary:   #0f172a;
  --text-secondary: rgba(15, 23, 42, 0.65);
  --text-muted:     rgba(15, 23, 42, 0.4);
  --accent:         #2563EB;
  --accent-glow:    rgba(37, 99, 235, 0.12);
  --accent-border:  rgba(37, 99, 235, 0.35);
  --border:         rgba(15, 23, 42, 0.1);
}


/* --------------------------------------------------------------------------
   2. Base Reset
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}


/* --------------------------------------------------------------------------
   3. Header
   -------------------------------------------------------------------------- */

#pg-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.pg-site-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.pg-site-logo:hover {
  color: var(--text-secondary);
}

#pg-theme-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.2s ease;
  line-height: 1;
}

#pg-theme-toggle:hover {
  color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   4. Main Tool Section
   -------------------------------------------------------------------------- */

#pg-tool {
  min-height: calc(100vh - 50px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 80px;
}

#pg-app {
  width: 100%;
  max-width: 720px;
}


/* --------------------------------------------------------------------------
   5. State Visibility Helpers
   Initial visibility is controlled by inline style="display:none;" in the HTML.
   JS showState() clears the inline style to reveal a state — no CSS override needed.
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   6. Intro State
   -------------------------------------------------------------------------- */

#pg-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.intro-tagline {
  margin-top: 32px;
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
  opacity: 0;
  animation: introTaglineFade 1s ease-in-out 0.5s forwards;
}

@keyframes introTaglineFade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* --------------------------------------------------------------------------
   7. 3D Cube — JS-driven, matches contact section pattern
   -------------------------------------------------------------------------- */

.cube-wrap {
  perspective: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin: 0 auto;
}

.pg-cube-body {
  width: 60px;
  height: 60px;
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
}

.pg-cube-face {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 1px solid var(--accent-border);
  background: transparent;
  box-shadow: 0 0 15px var(--accent-glow);
}

.pg-cube-face.front  { transform: rotateY(0deg)    translateZ(30px); }
.pg-cube-face.back   { transform: rotateY(180deg)  translateZ(30px); }
.pg-cube-face.left   { transform: rotateY(-90deg)  translateZ(30px); }
.pg-cube-face.right  { transform: rotateY(90deg)   translateZ(30px); }
.pg-cube-face.top    { transform: rotateX(90deg)   translateZ(30px); }
.pg-cube-face.bottom { transform: rotateX(-90deg)  translateZ(30px); }


/* --------------------------------------------------------------------------
   8. Mode Select State
   -------------------------------------------------------------------------- */

.pg-h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 32px;
  line-height: 1.3;
}

.pg-mode-cards {
  display: flex;
  flex-direction: row;
  gap: 24px;
  margin-bottom: 24px;
}

.pg-mode-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pg-mode-card:hover {
  border-color: var(--accent-border);
  box-shadow: 0 0 20px var(--accent-glow);
}

.pg-mode-label {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}

.pg-mode-tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pg-mode-note {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  margin-top: auto;
}

.pg-mode-footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}


/* --------------------------------------------------------------------------
   9. Chat State
   -------------------------------------------------------------------------- */

/* Container */
#pg-chat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
  min-height: 400px;
}

/* Header row */
.pg-chat-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.pg-chat-mode-label {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#pg-chat-start-over {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.2s ease;
}

#pg-chat-start-over:hover {
  color: var(--accent);
}

/* Message log */
#pg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#pg-chat-messages::-webkit-scrollbar {
  width: 4px;
}

#pg-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#pg-chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
}

/* Message rows */
.pg-chat-msg {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
}

.pg-chat-msg--bot {
  align-self: flex-start;
  max-width: 85%;
}

.pg-chat-msg--user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 85%;
}

/* Avatar (perspective set here; JS inserts cube body/faces via buildSpinCube) */
.pg-chat-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  perspective: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* Scale cube faces down to fit 32px avatar context */
.pg-chat-avatar .pg-cube-body {
  width: 20px;
  height: 20px;
}

.pg-chat-avatar .pg-cube-face {
  width: 20px;
  height: 20px;
}

.pg-chat-avatar .pg-cube-face.front  { transform: rotateY(0deg)    translateZ(10px); }
.pg-chat-avatar .pg-cube-face.back   { transform: rotateY(180deg)  translateZ(10px); }
.pg-chat-avatar .pg-cube-face.left   { transform: rotateY(-90deg)  translateZ(10px); }
.pg-chat-avatar .pg-cube-face.right  { transform: rotateY(90deg)   translateZ(10px); }
.pg-chat-avatar .pg-cube-face.top    { transform: rotateX(90deg)   translateZ(10px); }
.pg-chat-avatar .pg-cube-face.bottom { transform: rotateX(-90deg)  translateZ(10px); }

/* Message bubbles */
.pg-chat-bubble {
  padding: 12px 16px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  border-radius: 2px;
  word-break: break-word;
}

.pg-chat-msg--bot .pg-chat-bubble {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.pg-chat-msg--user .pg-chat-bubble {
  background: var(--bg-elevated);
  border: 1px solid var(--accent-border);
  color: var(--text-primary);
}

/* Typing indicator */
.pg-chat-bubble--typing {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
}

.pg-typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: pgTypingPulse 1.2s ease-in-out infinite;
}

.pg-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.pg-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pgTypingPulse {
  0%, 60%, 100% { opacity: 0.2; transform: scale(0.85); }
  30%            { opacity: 1;   transform: scale(1); }
}

/* Input area */
.pg-chat-input-area {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

#pg-chat-length-wrap {
  margin-bottom: 12px;
}

.pg-chat-input-row {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
}

#pg-chat-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border-radius: 2px;
}

#pg-chat-send {
  flex-shrink: 0;
}

.pg-chat-disclaimer {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
}


.pg-length-toggle {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pg-length-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Pill toggle groups — shared by .pg-length-options and .pg-pill-options */
.pg-length-options,
.pg-pill-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pg-length-options label,
.pg-pill-options label {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  user-select: none;
}

.pg-length-options label input,
.pg-pill-options label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pg-length-options label:hover,
.pg-pill-options label:hover {
  border-color: var(--accent-border);
  color: var(--text-secondary);
}

.pg-length-options label:has(input:checked),
.pg-pill-options label:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}


/* --------------------------------------------------------------------------
   10. Form State
   -------------------------------------------------------------------------- */

.pg-form-back-row {
  margin-bottom: 32px;
}

#pg-form-wrap {
  overflow: visible;
}

.pg-form-section {
  margin-bottom: 32px;
}

.pg-form-section-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}

.pg-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.pg-field-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.pg-field-hint {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.pg-required {
  color: var(--accent);
  margin-left: 2px;
}

.pg-optional {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
  margin-left: 4px;
}

/* Radio and checkbox groups */
.pg-radio-group,
.pg-checkbox-group {
  border: none;
  padding: 0;
  margin: 0;
}

/* Form error */
.pg-form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* Submit button */
.pg-submit-btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
}


/* --------------------------------------------------------------------------
   11. Form Inputs (shared across chat and form states)
   -------------------------------------------------------------------------- */

input[type="text"],
input[type="email"],
select,
textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* Select: remove native arrow, add custom SVG arrow */
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

:root[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(15,23,42,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Invalid field states — only show after user has touched the field */
input:invalid.pg-touched,
select:invalid.pg-touched,
textarea:invalid.pg-touched {
  border-color: #ef4444;
}


/* --------------------------------------------------------------------------
   12. Generating State
   -------------------------------------------------------------------------- */

#pg-generating {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 32px;
}

#pg-gen-step,
.pg-gen-step {
  color: var(--text-secondary);
  font-size: 1rem;
  transition: opacity 0.3s ease;
}


/* --------------------------------------------------------------------------
   13. Output Panel
   -------------------------------------------------------------------------- */

.pg-output-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 16px;
  gap: 12px;
}

.pg-output-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.pg-output-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

#pg-prompt-display,
.pg-prompt-text {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  min-height: 200px;
  max-height: 60vh;
  overflow-y: auto;
}


/* --------------------------------------------------------------------------
   14. Email Gate
   -------------------------------------------------------------------------- */

#pg-email-gate {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

#pg-email-gate h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 8px;
}

#pg-email-gate p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.pg-email-input-row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}

.pg-email-input-row input[type="email"] {
  flex: 1;
}

.pg-email-input-row button {
  flex-shrink: 0;
  white-space: nowrap;
}

#pg-email-error,
.pg-inline-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 6px;
  display: block;
}

.pg-email-note {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 12px;
  line-height: 1.4;
}


/* --------------------------------------------------------------------------
   15. CTA Card
   -------------------------------------------------------------------------- */

#pg-cta-card,
.pg-cta-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

#pg-cta-card h3,
.pg-cta-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 8px;
}

#pg-cta-card p,
.pg-cta-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

#pg-cta-card p:last-child,
.pg-cta-card p:last-child {
  margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   16. Base Card
   -------------------------------------------------------------------------- */

.pg-card {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}


/* --------------------------------------------------------------------------
   17. Edit States
   -------------------------------------------------------------------------- */

#pg-edit-chat,
#pg-edit-form {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}

#pg-edit-chat h3,
#pg-edit-form h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 0;
  margin-bottom: 16px;
}

.pg-muted-text {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Q&A rows */
.pg-qa-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.pg-qa-row:last-child {
  border-bottom: none;
}

.pg-qa-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.pg-qa-question {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pg-qa-answer {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.pg-qa-edit-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.75rem;
  transition: color 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pg-qa-edit-btn:hover {
  color: var(--accent);
}

.pg-qa-edit-textarea {
  width: 100%;
  margin-top: 4px;
}


/* --------------------------------------------------------------------------
   18. Error State
   -------------------------------------------------------------------------- */

.pg-error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  text-align: center;
  padding: 40px;
}

.pg-error-message {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 1rem;
  line-height: 1.6;
}


/* --------------------------------------------------------------------------
   19. Buttons
   -------------------------------------------------------------------------- */

.btn-primary {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(to right, var(--accent) 50%, transparent 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 0;
  padding: 10px 24px;
  font-size: 0.8rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-position 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
  background-position: 0 0;
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 10px 24px;
  font-size: 0.8rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: none;
  border-radius: 0;
  padding: 10px 20px;
  font-size: 0.8rem;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}


/* --------------------------------------------------------------------------
   20. Section Headings (inside states and cards)
   -------------------------------------------------------------------------- */

#pg-output h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.pg-card h3,
#pg-edit-chat h3,
#pg-edit-form h3,
#pg-email-gate h3,
#pg-cta-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0;
}


/* --------------------------------------------------------------------------
   21. Explainer Section
   -------------------------------------------------------------------------- */

#pg-explainer {
  padding: 80px 24px;
  max-width: 720px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(30px);
}

.pg-explainer-inner {
  max-width: 680px;
  margin: 0 auto;
}

#pg-explainer h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  margin-top: 48px;
}

#pg-explainer h2:first-child {
  margin-top: 0;
}

#pg-explainer p {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
  font-size: 1rem;
}

#pg-explainer p:last-child {
  margin-bottom: 0;
}

#pg-explainer a {
  color: var(--accent);
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

#pg-explainer a:hover {
  opacity: 0.8;
}

#pg-explainer ul,
#pg-explainer ol {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
  padding-left: 24px;
}

#pg-explainer li {
  margin-bottom: 6px;
}


/* --------------------------------------------------------------------------
   22. Footer
   -------------------------------------------------------------------------- */

#pg-footer {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-top: 1px solid var(--border);
}

.pg-footer-link {
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pg-footer-link:hover {
  color: var(--text-secondary);
}

.pg-footer-credit {
  color: var(--text-muted);
  font-size: 13px;
}


/* --------------------------------------------------------------------------
   23. Scrollbar Styling (Webkit)
   -------------------------------------------------------------------------- */

#pg-prompt-display::-webkit-scrollbar,
.pg-prompt-text::-webkit-scrollbar {
  width: 6px;
}

#pg-prompt-display::-webkit-scrollbar-track,
.pg-prompt-text::-webkit-scrollbar-track {
  background: transparent;
}

#pg-prompt-display::-webkit-scrollbar-thumb,
.pg-prompt-text::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

#pg-prompt-display::-webkit-scrollbar-thumb:hover,
.pg-prompt-text::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}


/* --------------------------------------------------------------------------
   24. Responsive — 640px Breakpoint
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  /* Mode select */
  .pg-mode-cards {
    flex-direction: column;
  }

  .pg-h1 {
    font-size: 1.4rem;
  }

  /* Tool section */
  #pg-tool {
    padding: 40px 16px 60px;
  }

  /* Output panel */
  .pg-output-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .pg-output-actions {
    width: 100%;
  }

  .pg-output-actions button {
    flex: 1;
  }

  /* Email gate */
  .pg-email-input-row {
    flex-direction: column;
  }

  .pg-email-input-row input[type="email"],
  .pg-email-input-row button {
    width: 100%;
  }

  /* Chat interface */
  .pg-chat-input-row {
    gap: 8px;
  }

  #pg-chat-send {
    padding: 10px 16px;
  }

  /* Header */
  #pg-header {
    padding: 0 16px;
  }

  /* Footer */
  #pg-footer {
    padding: 0 16px;
  }

  /* Length toggle */
  .pg-length-toggle {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Explainer */
  #pg-explainer {
    padding: 60px 16px;
  }

  /* Cards in edit state */
  #pg-edit-chat,
  #pg-edit-form,
  .pg-card,
  #pg-email-gate,
  #pg-cta-card {
    padding: 16px;
  }
}
