/* AI Summary Widget – Dark Tool-First Theme */

:root {
  --bg: #0a0a0a;
  --bg-elevated: #141414;
  --bg-card: #1a1a1a;
  --border: #2a2a2a;
  --border-hover: #3a3a3a;
  --text: #fafafa;
  --text-muted: #a1a1a1;
  --text-dim: #666;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --accent-muted: rgba(245, 158, 11, 0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
}

.logo-mark {
  color: var(--accent);
  font-size: 1.25rem;
}

.logo-text {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  gap: 1.5rem;
}

.header-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

.header-link:hover {
  color: var(--text);
}

/* Main */
main {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Generator Section */
.generator {
  padding: 2.5rem 0 3rem;
}

.generator-intro {
  text-align: center;
  margin-bottom: 2rem;
}

.generator-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

.generator-intro p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Stack Layout */
.generator-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Preview */
.preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.preview-label {
  padding: 0.625rem 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}

.preview-area {
  padding: 2rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: linear-gradient(145deg, #0f0f0f 0%, #1a1a1a 100%);
}

/* Controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.control-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 0.6rem;
  font-weight: 700;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  cursor: help;
  text-transform: none;
  letter-spacing: 0;
}

/* Service Selector */
.service-selector {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.service-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, background 0.15s ease;
  touch-action: manipulation;
}

.service-btn svg {
  width: 22px;
  height: 22px;
  fill: var(--text-muted);
  transition: fill 0.15s;
}

.service-btn:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.service-btn:hover svg {
  fill: var(--text);
}

.service-btn.active {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.service-btn.active svg {
  fill: var(--accent);
}

.service-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Pill Group */
.pill-group {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.pill {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  touch-action: manipulation;
}

.pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.pill:hover {
  color: var(--text);
}

.pill.active {
  background: var(--accent);
  color: #000;
}

/* Pill Group Wrap Variant (for presets) */
.pill-group--wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.375rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

@media (max-width: 480px) {
  .pill-group--wrap {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .pill-group {
    flex-wrap: wrap;
    justify-content: center;
  }
}

.pill-group--wrap .pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.5rem;
  font-size: 0.6875rem;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
}

.pill-group--wrap .pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-elevated);
}

.pill-group--wrap .pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}

.pill-icon {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.6875rem;
  opacity: 0.7;
  margin-right: 0.1875rem;
  font-weight: normal;
}

.pill.active .pill-icon {
  opacity: 1;
}

/* Widget Helper in FAQ */
.faq-widget-helper {
  margin: 0.75rem 0;
  padding: 1rem;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  display: flex;
  justify-content: center;
}

/* Form Elements */
.input,
.textarea {
  font-family: var(--font-body);
  font-size: 0.875rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.textarea {
  resize: vertical;
  min-height: 60px;
}

.hint {
  font-size: 0.7rem;
  color: var(--text-dim);
}


/* Code Output */
.code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
}

.code-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.copy-btn {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  touch-action: manipulation;
}

.copy-btn:hover {
  background: var(--accent-hover);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.code-pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text-muted);
  background: #0d0d0d;
  max-height: 180px;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

@media (max-width: 600px) {
  .features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.feature {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  text-align: center;
}

.feature strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.25rem;
}

/* FAQ */
.faq {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
}

.faq-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 1.25rem;
  text-align: center;
  text-wrap: balance;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:first-of-type {
  border-top: 1px solid var(--border);
}

.faq-item summary {
  padding: 0.875rem 0;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9375rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.125rem;
  color: var(--text-dim);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item p {
  padding: 0 0 0.875rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.faq-item p strong {
  color: var(--text);
}

.faq-item code {
  background: var(--bg-card);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.8125rem;
}

.faq-list {
  margin: 0 0 0.875rem 1.25rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.8;
}

.faq-list li {
  margin-bottom: 0.25rem;
}

.faq-list strong {
  color: var(--text);
}

/* Share Section */
.share-section {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(236, 72, 153, 0.08) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  text-align: center;
}

.share-text {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: 0.875rem;
}

.share-buttons {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  text-decoration: none;
  outline: none;
  touch-action: manipulation;
}

.share-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.share-btn:hover {
  border-color: var(--border-hover);
  color: var(--text);
  transform: scale(1.1);
}

.share-btn--native:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Footer */
.footer {
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.footer p {
  font-size: 0.8125rem;
  color: var(--text-dim);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus-visible {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 1000;
}
