:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --text: #1c2333;
  --muted: #5a6478;
  --border: #d9dee8;
  --primary: #2f5bd0;
  --primary-dark: #2245a6;
  --matched: #1f7a4d;
  --matched-bg: #e3f4ea;
  --missing: #b1432b;
  --missing-bg: #fbe7e1;
  --transfer: #7a5c1f;
  --transfer-bg: #f8efd9;
  --shadow: 0 1px 2px rgba(20, 30, 60, 0.04), 0 4px 16px rgba(20, 30, 60, 0.06);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
}

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

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}
.brand-text { font-size: 18px; }
.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }
.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.site-nav a:hover { color: var(--primary); }

.hero {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
  padding: 48px 0 24px;
  align-items: start;
}
.hero h1 {
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 12px;
}
.lede { color: var(--muted); font-size: 17px; margin: 0 0 18px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.meta-note { color: var(--muted); font-size: 13px; margin: 0; }
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.hero-card h2 { margin: 0 0 10px; font-size: 18px; }
.check-list { margin: 0; padding-left: 20px; color: var(--muted); }
.check-list li { margin-bottom: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  text-decoration: underline;
}

.workspace {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.workspace-head h2 { margin: 0 0 6px; font-size: 22px; }
.workspace-head p { color: var(--muted); margin: 0 0 18px; }

.panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.panel {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}
.panel-head label { font-weight: 600; font-size: 14px; }
.panel-actions { display: flex; gap: 10px; }
.text-input {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  min-height: 220px;
}
.text-input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.panel-foot { text-align: right; margin-top: 6px; }
.count { font-size: 12px; color: var(--muted); }

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
}

.results { margin-top: 8px; }
.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.score-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.score-label { font-size: 13px; color: var(--muted); }
.score-value { font-size: 38px; font-weight: 700; margin: 4px 0; }
.score-bar {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
.score-bar span {
  display: block;
  height: 100%;
  background: var(--primary);
  width: 0;
  transition: width 0.3s ease;
}
.score-note { font-size: 13px; color: var(--muted); margin: 0; }
.score-legend { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot-matched { background: var(--matched); }
.dot-missing { background: var(--missing); }
.dot-transfer { background: var(--transfer); }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.result-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.result-block h3 { margin: 0 0 4px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.result-block .muted { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.badge {
  background: var(--matched-bg);
  color: var(--matched);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-warn { background: var(--missing-bg); color: var(--missing); }
.badge-info { background: var(--transfer-bg); color: var(--transfer); }

.term-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.term-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.term-list li.matched { border-left: 3px solid var(--matched); }
.term-list li.missing { border-left: 3px solid var(--missing); }
.term-list li.transfer { border-left: 3px solid var(--transfer); }
.term-list li .alt { color: var(--muted); font-size: 12px; }

.summary-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.summary-block h3 { margin: 0 0 8px; font-size: 16px; }
.summary-output {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
}

.empty-state {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.empty-state h3 { margin: 0 0 6px; color: var(--text); }

.example, .how, .tips {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}
.example h2, .how h2, .tips h2 { margin-top: 0; }
.example-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.example-col h3 { margin: 0 0 6px; font-size: 15px; }
.example-text {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
  margin: 0;
}
.example-result ul { margin: 0; padding-left: 20px; }
.example-result li { margin-bottom: 4px; }

.steps { margin: 0; padding-left: 22px; }
.steps li { margin-bottom: 6px; }

.tip-list { margin: 0 0 12px; padding-left: 20px; }
.tip-list li { margin-bottom: 8px; }
.note {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
}
.note summary { cursor: pointer; font-weight: 600; }
.note p { margin: 8px 0 0; color: var(--muted); }

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 32px;
  padding: 24px 0;
}
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.footer-brand { font-weight: 700; margin: 0 0 4px; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--primary); }
.small { font-size: 12px; }
.muted { color: var(--muted); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .panels { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .score-row { grid-template-columns: 1fr; }
  .example-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
  .hero h1 { font-size: 28px; }
}

@media (max-width: 480px) {
  .controls { flex-direction: column; }
  .btn { width: 100%; }
  .hero-actions { flex-direction: column; }
  .hero .btn { width: 100%; }
}



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