/* Reset + base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --color-bg: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-text: #1E293B;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-primary: #4F46E5;
  --color-primary-hover: #4338CA;
  --color-primary-light: #EEF2FF;
  --color-success: #16A34A;
  --color-success-light: #F0FDF4;
  --color-fail: #DC2626;
  --color-fail-light: #FEF2F2;
  --color-warning: #D97706;
  --color-warning-light: #FFFBEB;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.06);
  --font: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1120px;
  --container-pad: 1.5rem;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 100;
}
.skip-link:focus { top: 0; }

/* Header */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-icon { flex-shrink: 0; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.875rem;
}
.site-nav a { color: var(--color-text-muted); }
.site-nav a:hover { color: var(--color-text); }
.nav-ecosystem {
  background: var(--color-primary-light);
  color: var(--color-primary) !important;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-weight: 500;
}

/* Sections */
.section { padding: 3rem 0; }
.section + .section { border-top: 1px solid var(--color-border); }

/* Intro */
.intro h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.intro-text {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 640px;
}

/* Workspace */
.workspace h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

.field { margin-bottom: 1.25rem; }
.field-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.375rem;
}
.field-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  background: var(--color-surface);
  color: var(--color-text);
}
.field-input:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.field-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: var(--font);
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-secondary {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
}
.btn-secondary:hover { background: var(--color-bg); }
.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
  padding: 0.375rem 0.625rem;
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-bg); }
.btn-preset {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: transparent;
  font-size: 0.8rem;
}
.btn-preset:hover { background: #C7D2FE; }

.preset-grid {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Score card */
.score-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.score-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}
.score-label { font-weight: 600; font-size: 0.875rem; }
.score-value { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); }
.score-bar {
  height: 8px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.score-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.score-note { font-size: 0.8rem; color: var(--color-text-muted); }

/* Checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: 0.85rem;
}
.checklist-item.pass {
  border-color: var(--color-success);
  background: var(--color-success-light);
}
.checklist-item.fail {
  border-color: var(--color-fail);
  background: var(--color-fail-light);
}
.checklist-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}
.checklist-text { flex: 1; }

.result-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Guide */
.guide h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.guide-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.guide-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.guide-card p { font-size: 0.875rem; color: var(--color-text-muted); }

.guide-notes h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}
.guide-notes h3:first-child { margin-top: 0; }
.guide-notes ul {
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}
.guide-notes li { margin-bottom: 0.25rem; }
.guide-notes p { font-size: 0.9rem; color: var(--color-text-muted); }

/* Examples */
.examples h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.example-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.example-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.example-card h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.example-email {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 0.75rem;
  overflow-x: auto;
}
.example-card p { font-size: 0.875rem; color: var(--color-text-muted); }

/* FAQs */
.faqs h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
.faq-list { display: flex; flex-direction: column; gap: 1rem; }
.faq-item dt {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}
.faq-item dd {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding-left: 0;
}

/* Footer */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: 2rem;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.footer-brand { display: flex; flex-direction: column; gap: 0.25rem; }
.footer-name { font-weight: 700; font-size: 0.95rem; }
.footer-note { font-size: 0.8rem; color: var(--color-text-muted); }
.footer-links { display: flex; gap: 1rem; font-size: 0.85rem; flex-wrap: wrap; }
.footer-legal { font-size: 0.75rem; color: var(--color-text-muted); }

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--color-text);
  color: #fff;
  padding: 0.625rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  box-shadow: var(--shadow-md);
  z-index: 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .example-grid { grid-template-columns: 1fr; }
  .header-inner { height: auto; padding: 0.75rem 0; flex-wrap: wrap; }
  .site-nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 0.75rem; }
  .section { padding: 2rem 0; }
}

@media print {
  .site-header, .site-footer, .field-actions, .result-actions, .preset-grid, .btn { display: none !important; }
  .section { border: none; padding: 0; }
  body { background: #fff; }
  .score-card, .checklist-item, .example-card { box-shadow: none; border: 1px solid #ccc; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
