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

body {
  background: #f3f4f6;
  color: #111827;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.ad-banner-top {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 15px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

.nav {
  margin-bottom: 24px;
}

.nav a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.nav a:hover {
  color: #111827;
}

.header {
  margin-bottom: 28px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e5f2ff;
  color: #1d4ed8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.logo-wordmark {
  font-weight: 700;
  letter-spacing: -0.06em;
}

.header h1 {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.subtitle {
  color: #4b5563;
  font-size: 0.95rem;
  max-width: 560px;
}

/* Two-column layout */
.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
  align-items: start;
}

@media (max-width: 700px) {
  .layout { grid-template-columns: 1fr; }
}

/* Left column */
.tool-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

/* Right column */
.preview-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 18px;
  color: #111827;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #374151;
}

select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
  background: #ffffff;
  color: #111827;
}

select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Type toggle */
.type-toggle {
  display: flex;
  background: #f3f4f6;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 18px;
}

.type-btn {
  flex: 1;
  padding: 7px;
  background: none;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.type-btn.active {
  background: #fff;
  color: #111827;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Angle row */
.angle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.angle-display {
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  min-width: 40px;
  text-align: right;
}

.angle-slider {
  flex: 1;
  accent-color: #1d4ed8;
  cursor: pointer;
}

/* Direction presets */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}

.dir-btn {
  padding: 6px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  line-height: 1.4;
}

.dir-btn:hover,
.dir-btn.active {
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Color stops */
.stops-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.stop-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

input[type="color"].stop-swatch {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  padding: 2px;
  cursor: pointer;
  flex-shrink: 0;
}

.stop-hex {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.82rem;
  color: #111827;
  background: #fff;
}

.stop-hex:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.stop-pos-slider {
  flex: 1;
  accent-color: #1d4ed8;
  cursor: pointer;
}

.stop-pos-display {
  font-size: 0.78rem;
  color: #6b7280;
  min-width: 36px;
  text-align: right;
}

.stop-remove {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 1rem;
  transition: color 0.15s;
  line-height: 1;
}

.stop-remove:hover:not(:disabled) {
  color: #ef4444;
}

.stop-remove:disabled {
  opacity: 0.3;
  cursor: default;
}

/* Add stop button */
.btn-add-stop {
  width: 100%;
  padding: 8px;
  background: none;
  border: 2px dashed #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 14px;
}

.btn-add-stop:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #f0f4ff;
}

/* Reset button */
.btn-reset {
  width: 100%;
  padding: 8px 16px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-reset:hover {
  background: #f3f4f6;
  color: #374151;
  border-color: #d1d5db;
}

/* Preview */
.gradient-preview {
  width: 100%;
  height: 200px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  margin-bottom: 16px;
  transition: background 0.2s;
}

/* CSS output */
.section-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
  margin-bottom: 8px;
}

.css-output {
  background: #1e293b;
  color: #7dd3fc;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 10px;
  line-height: 1.6;
}

.btn-copy {
  padding: 8px 20px;
  background: #1d4ed8;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.16s ease;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.25);
}

.btn-copy:hover {
  background: #1e40af;
  box-shadow: 0 6px 18px rgba(29, 78, 216, 0.35);
  transform: translateY(-1px);
}

.btn-copy.copied {
  background: #15803d;
  box-shadow: 0 4px 14px rgba(21, 128, 61, 0.3);
}

/* Preset swatches */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.preset-swatch {
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
}

.preset-swatch:hover {
  transform: scale(1.05);
  border-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* FAQ accordion */
.faq {
  margin-top: 40px;
}

.faq-title {
  font-size: 1rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 14px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.faq-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.faq-question {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-question::after {
  content: '+';
  font-size: 1.1rem;
  color: #9ca3af;
  flex-shrink: 0;
  line-height: 1;
}

details[open] > .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 12px 16px 14px;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.65;
  border-top: 1px solid #f3f4f6;
}

.faq-answer code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-family: 'Courier New', monospace;
}

/* Related tools */
.related-tools {
  margin-top: 32px;
}

.related-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.related-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.1);
  transform: translateY(-1px);
}

.related-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1d4ed8;
}

.related-desc {
  font-size: 0.82rem;
  color: #6b7280;
}

/* Bottom ad + footer */
.ad-banner-bottom {
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  padding: 20px;
  text-align: center;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 32px;
}

.footer {
  margin-top: 12px;
  text-align: center;
  font-size: 0.78rem;
  color: #9ca3af;
  padding-bottom: 20px;
}

@media (max-width: 640px) {
  .page { padding: 24px 16px; }
  .header h1 { font-size: 1.6rem; }
  .related-grid { grid-template-columns: 1fr; }
  .presets-grid { grid-template-columns: repeat(4, 1fr); }
}
