:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #fbf8f2;
  --ink: #1c2430;
  --ink-soft: #4a5568;
  --muted: #8a94a6;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --accent-dark: #92400e;
  --border: #e2dccc;
  --border-strong: #c9bfa7;
  --success: #047857;
  --success-soft: #d1fae5;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --shadow-sm: 0 1px 2px rgba(28, 36, 48, 0.06);
  --shadow-md: 0 6px 20px rgba(28, 36, 48, 0.08);
  --radius: 14px;
  --radius-sm: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
}
h1 { font-size: 2.2rem; font-weight: 700; }
h2 { font-size: 1.6rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 10px;
}

.brand-text strong {
  display: block;
  font-size: 1.05rem;
  color: var(--ink);
}

.tagline {
  font-size: 0.85rem;
  color: var(--muted);
}

.topnav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.topnav a {
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.topnav a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

section {
  margin-bottom: 56px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

.hero-text h1 {
  font-size: 2.6rem;
  margin-bottom: 16px;
}

.hero-text p {
  font-size: 1.1rem;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.micro {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  background: transparent;
  color: var(--ink);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn.ghost {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.copy-btn {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
}

.copy-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.copy-btn.copied {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success);
}

.one-liner {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.panel h2 {
  margin-bottom: 4px;
}

.panel-intro {
  color: var(--muted);
  margin-bottom: 20px;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.scenario {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

.scenario:hover {
  border-color: var(--accent);
}

.scenario.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.scenario-icon {
  font-size: 1.3rem;
}

.scenario strong {
  font-size: 0.9rem;
  color: var(--ink);
}

.scenario-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field select {
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.field input:invalid:not(:placeholder-shown) {
  border-color: var(--danger);
}

.actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.attendant-box {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.attendant-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.attendant-head h3 {
  margin: 0;
  font-size: 0.95rem;
}

.output-panel {
  display: flex;
  flex-direction: column;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result {
  padding: 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.result-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}

.result-head h3 {
  margin: 0;
  flex: 1;
  font-size: 1rem;
}

.script {
  font-size: 1rem;
  color: var(--ink);
  margin: 0 0 8px;
  padding: 12px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
}

.why {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.print-area {
  margin-top: 24px;
  padding: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.print-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.9rem;
}

.print-line {
  margin: 0 0 8px;
  color: var(--ink);
}

.print-signoff {
  margin-top: 16px;
  font-style: italic;
  color: var(--ink-soft);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
}

.section-intro {
  max-width: 640px;
  margin-bottom: 24px;
}

.scenario-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.scenario-cards article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.scenario-cards h3 {
  margin-bottom: 8px;
}

.script-example {
  padding: 12px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 0.95rem;
  color: var(--ink);
}

.mistake-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mistake-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.mistake-list strong {
  display: block;
  color: var(--danger);
  margin-bottom: 4px;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.policy-grid article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px;
}

.faq dl {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
}

.faq dt {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}

.faq dd {
  margin: 0;
  padding-left: 16px;
  border-left: 3px solid var(--accent-soft);
}

.history-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.history-list .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.history-list .load-btn {
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink-soft);
  cursor: pointer;
}

.empty-history {
  color: var(--muted);
  text-align: center;
  padding: 20px;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-text h1 {
    font-size: 2rem;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .scenario-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .scenario-cards,
  .policy-grid {
    grid-template-columns: 1fr;
  }
  .fields {
    grid-template-columns: 1fr;
  }
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .scenario-grid {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
  }
  .actions {
    flex-direction: column;
  }
  main {
    padding: 20px 16px 48px;
  }
}



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