/* ToneGuard Styles */
:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --text: #212529;
  --text-secondary: #6c757d;
  --primary: #2c6e49;
  --primary-light: #e8f5e9;
  --accent: #e76f51;
  --accent-light: #fdf0ed;
  --border: #dee2e6;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--primary);
}

/* Hero */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero h1 {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto;
}

/* Checker Area */
.checker-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  margin-bottom: 3rem;
  align-items: start;
}

.checker-main {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.mode-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.mode-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.btn {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.btn:hover {
  background: #f1f3f5;
  border-color: #adb5bd;
}

.btn-outline {
  background: transparent;
}

.editor-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.email-editor {
  width: 100%;
  min-height: 250px;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}

.email-editor:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(44, 110, 73, 0.1);
}

.highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  pointer-events: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: transparent;
  overflow: hidden;
}

.highlight-layer mark {
  background: var(--accent-light);
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  cursor: pointer;
  pointer-events: auto;
  position: relative;
}

.highlight-layer mark:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Score Bar */
.score-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.score-label {
  font-weight: 600;
  color: var(--text-secondary);
}

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 3rem;
  text-align: center;
}

.score-meter {
  flex: 1;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  min-width: 100px;
}

.score-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.score-comment {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
  width: 100%;
}

/* Sidebar */
.checker-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-card {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.sidebar-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.example-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.example-before {
  color: var(--accent);
  font-style: italic;
}

.example-arrow {
  color: var(--text-secondary);
  font-size: 0.8rem;
  align-self: flex-start;
}

.example-after {
  color: var(--primary);
}

.sidebar-card ul {
  list-style: disc;
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sidebar-card li {
  margin-bottom: 0.4rem;
}

/* Support Content */
.support-content {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

.support-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 1rem;
}

.support-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

.support-content p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.support-content ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.support-content li {
  margin-bottom: 0.5rem;
}

.support-content blockquote {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: var(--text);
}

/* Ad slot */
.ad-slot {
  text-align: center;
  margin: 2rem 0;
  min-height: 120px;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  margin-top: auto;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

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

.version {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
  .checker-area {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 1.8rem;
  }

  .support-content {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }

  .toolbar {
    gap: 0.5rem;
  }

  .score-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}



/* 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;
}
