:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #e5e7eb;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #dc2626;
  --ok: #16a34a;
  --warn: #d97706;
  --flash-ok-bg: #f0fdf4;
  --flash-error-bg: #fef2f2;
  --flash-warn-bg: #fffbeb;
  --hint-bg: #ffffff;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", "Menlo", monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.55 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { color: var(--accent-hover); text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 72px; }
.top {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 14px 20px;
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  flex-wrap: wrap;
}
.top .brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.top .brand:hover { color: var(--accent); text-decoration: none; }
.nav-groups {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.nav-group {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9aa3af;
}
.top nav a, .nav-groups a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.top nav a:hover, .nav-groups a:hover,
.nav-groups a.active {
  color: var(--accent);
  text-decoration: none;
}
.nav-home { font-weight: 700 !important; }
.top .who {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.journey-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 900px) {
  .journey-grid { grid-template-columns: 1fr; }
}
.journey-card h2 { margin-bottom: 6px; }
.journey-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.journey-step {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.journey-card.status-done { border-color: #bbf7d0; }
.journey-card.status-doing { border-color: #fdba74; }
.campaign-preview {
  max-width: 520px;
  margin: 10px 0 14px;
  padding: 12px 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
}
.campaign-preview strong:first-child {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
}
.campaign-preview-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.campaign-preview-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.campaign-preview-list li:first-child { border-top: 0; padding-top: 0; }
.campaign-preview-list li > span:first-child {
  min-width: 120px;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
}
h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 0 0 10px;
  color: var(--text);
}
h2 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--text);
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.hint { display: inline-flex; }
button.hint-i,
.hint-i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
.hint-i:hover,
.hint.open .hint-i,
.hint:focus-within .hint-i {
  background: var(--accent);
  color: #fff;
}
.hint-pop {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 4px);
  z-index: 30;
  width: min(320px, 100%);
  max-width: calc(100vw - 40px);
  padding: 12px;
  background: var(--hint-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
}
.hint:hover .hint-pop,
.hint:focus-within .hint-pop,
.hint.open .hint-pop {
  display: block;
}
.hint-pop strong {
  display: block;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin: 10px 0 4px;
}
.hint-pop strong:first-child { margin-top: 0; }
.hint-pop p { margin: 0; color: var(--text); }
.hint-pop a { font-weight: 600; }
.help-steps { margin: 8px 0 0; padding-left: 20px; font-size: 14px; }
.help-steps li { margin-bottom: 8px; }
.action-help { position: relative; display: flex; align-items: flex-start; gap: 8px; margin: 0 0 8px; }
.card > form + form {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
input, select, textarea {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.4;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
textarea { min-height: 96px; font-family: inherit; }
textarea.template-body {
  max-width: none;
  width: 100%;
  min-height: 280px;
  font-size: 15px;
  line-height: 1.55;
  resize: vertical;
}
button, .btn {
  display: inline-block;
  margin-top: 12px;
  padding: 9px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
}
button:hover, .btn:hover {
  background: var(--accent-hover);
  text-decoration: none;
}
.btn.secondary {
  background: #eef2f7;
  color: var(--text);
}
.btn.secondary:hover { background: #e2e8f0; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #b91c1c; }
.flash {
  background: var(--flash-ok-bg);
  border: 1px solid #bbf7d0;
  color: #14532d;
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  word-break: break-word;
  font-size: 15px;
  line-height: 1.5;
}
.flash ul { margin: 8px 0 0; padding-left: 20px; }
.flash-error {
  background: var(--flash-error-bg);
  border-color: #fecaca;
  color: #7f1d1d;
}
.flash-warn {
  background: var(--flash-warn-bg);
  border-color: #fde68a;
  color: #78350f;
}
.example-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin-bottom: 4px;
}
.example-fields .example-row label {
  margin: 0;
}
.example-fields .example-empty {
  margin: 0;
  font-size: 13px;
}
.token-status {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.45;
  max-width: 520px;
}
.token-ok {
  background: var(--flash-ok-bg);
  border: 1px solid #bbf7d0;
  color: #14532d;
}
.token-missing {
  background: var(--flash-error-bg);
  border: 1px solid #fecaca;
  color: #7f1d1d;
}
.token-replace {
  margin: 8px 0 4px;
  max-width: 520px;
}
.token-replace summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}
.token-replace[open] summary {
  margin-bottom: 4px;
}
.setup-hero {
  margin-bottom: 16px;
}
.setup-hero-ok {
  background: var(--flash-ok-bg);
  border-color: #bbf7d0;
}
.setup-next {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.setup-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}
.setup-step {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.setup-step > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
}
.setup-step > summary::-webkit-details-marker { display: none; }
.setup-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #eef2f7;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.setup-main { flex: 1; min-width: 0; }
.setup-title {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.setup-summary {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.setup-tags {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  flex-shrink: 0;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-req {
  background: #eef2f7;
  color: var(--muted);
}
.badge-done {
  background: #dcfce7;
  color: #166534;
}
.badge-todo {
  background: #ffedd5;
  color: #9a3412;
}
.badge-blocked {
  background: #f3f4f6;
  color: #6b7280;
}
.setup-step.status-todo {
  border-color: #fdba74;
}
.setup-step.status-done .setup-num {
  background: #dcfce7;
  color: #166534;
}
.setup-body {
  padding: 0 16px 16px 56px;
  border-top: 1px solid var(--line);
  margin-top: -1px;
  padding-top: 14px;
}
@media (max-width: 640px) {
  .setup-step > summary { flex-wrap: wrap; }
  .setup-tags { flex-direction: row; width: 100%; justify-content: flex-start; padding-left: 40px; }
  .setup-body { padding-left: 16px; }
}
.warn { color: var(--warn); }
.muted { color: var(--muted); line-height: 1.55; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.error { color: var(--danger); font-weight: 600; }
.login { max-width: 360px; margin: 12vh auto; }
code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: #111827;
}
p { margin: 0 0 12px; }
