:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-alt: #F5F3FF;
  --text: #1E1B2E;
  --text-secondary: #5F5A78;
  --text-muted: #8B86A3;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-light: #EEF2FF;
  --border: #E2DFEA;
  --border-light: #EDEAF3;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --role-1: #4F46E5;
  --role-2: #0891B2;
  --role-3: #D97706;
  --role-4: #059669;
  --role-5: #DC2626;
  --role-6: #7C3AED;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
}
.logo:hover { text-decoration: none; }
.main-nav {
  display: flex;
  gap: 24px;
}
.main-nav a {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}
.main-nav a:hover { color: var(--primary); }

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 64px 24px 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero h1 {
  font-size: 40px;
  line-height: 1.2;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}
.hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.6;
}
.role-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.role-chip {
  padding: 12px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: white;
}
.rc1 { background: var(--role-1); }
.rc2 { background: var(--role-2); }
.rc3 { background: var(--role-3); }
.rc4 { background: var(--role-4); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  gap: 6px;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-hover); text-decoration: none; color: white; }
.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-large { padding: 14px 28px; font-size: 16px; width: 100%; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-alt); color: var(--text); }
.btn-preset {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text-secondary);
  font-size: 13px;
}
.btn-preset:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* Planner Section */
.planner-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 64px;
}
.planner-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 32px;
  align-items: start;
}
.controls-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  position: sticky;
  top: 72px;
  box-shadow: var(--shadow);
}
.controls-panel h2 {
  font-size: 20px;
  margin-bottom: 20px;
}
.control-group {
  margin-bottom: 20px;
}
.control-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.member-list, .role-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.member-row, .role-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.member-row input, .role-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
}
.member-row input:focus, .role-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.remove-btn:hover { background: #FEE2E2; color: #DC2626; }
#session-count {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--bg);
}
#session-count:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.action-row { margin-top: 24px; }
.save-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.save-row .btn { flex: 1; min-width: 80px; }

/* Output Panel */
.output-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 400px;
  box-shadow: var(--shadow);
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 16px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; font-size: 18px; }
.hidden { display: none !important; }
.schedule-header {
  margin-bottom: 24px;
}
.schedule-header h2 { font-size: 22px; margin-bottom: 4px; }
.schedule-meta { font-size: 14px; color: var(--text-muted); }
.schedule-wrapper {
  overflow-x: auto;
  margin-bottom: 24px;
}
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.schedule-table th {
  background: var(--surface-alt);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.schedule-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.schedule-table tr:hover td { background: var(--surface-alt); }
.role-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}
.role-descriptions {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}
.role-desc-card {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  background: var(--surface-alt);
  font-size: 13px;
}
.role-desc-card h4 { font-size: 14px; margin-bottom: 4px; }
.role-desc-card p { color: var(--text-secondary); }

/* Info Sections */
.info-section {
  padding: 64px 24px;
}
.info-section.alt-bg { background: var(--surface-alt); }
.section-inner {
  max-width: 1200px;
  margin: 0 auto;
}
.info-section h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.step-card h3 { font-size: 16px; margin-bottom: 8px; }
.step-card p { font-size: 14px; color: var(--text-secondary); }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.scenario-card h3 { font-size: 16px; margin-bottom: 12px; color: var(--primary); }
.scenario-card p { font-size: 14px; color: var(--text-secondary); line-height: 1.7; }

.tips-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.tips-col h3 { font-size: 18px; margin-bottom: 16px; }
.tips-col ul { list-style: none; }
.tips-col li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.6;
}
.tips-col li:last-child { border-bottom: none; }

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.footer-inner p { margin-bottom: 8px; }
.footer-links a { color: var(--text-secondary); }
.footer-meta { font-size: 12px; }

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Print */
@media print {
  .site-header, .site-footer, .controls-panel, .btn, .save-row, .action-row { display: none !important; }
  .planner-layout { display: block; }
  .output-panel { border: none; box-shadow: none; padding: 0; }
  .schedule-table { font-size: 12px; }
  body { background: white; }
}

/* Responsive */
@media (max-width: 1024px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding: 48px 24px 32px; }
  .hero h1 { font-size: 32px; }
  .role-preview { justify-content: center; }
  .planner-layout { grid-template-columns: 1fr; }
  .controls-panel { position: static; }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-grid { grid-template-columns: 1fr; }
  .tips-layout { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .main-nav { gap: 12px; }
  .main-nav a { font-size: 12px; }
  .hero h1 { font-size: 26px; }
  .hero-sub { font-size: 16px; }
  .steps-grid { grid-template-columns: 1fr; }
  .info-section { padding: 48px 16px; }
  .info-section h2 { font-size: 22px; }
  .output-panel { padding: 20px; }
  .save-row { flex-direction: column; }
  .save-row .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;
}
