@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Montserrat:wght@400;600&family=Poppins:wght@400;500;600&display=swap");

:root {
  --white: #ffffff;
  --canvas: #f6f6f7;
  --ink: #36373a;
  --ink-soft: #4b4c50;
  --ink-muted: #6b6c70;
  --line: #e4e5e7;
  --brand: #d8282e;
  --brand-dark: #b51f24;
  --warning: #fdecec;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.stripe {
  height: 4px;
  background: var(--brand);
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  color: var(--ink);
  font-family: Montserrat, Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark:hover { color: var(--brand); }

.top nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.top a {
  color: var(--ink);
  text-decoration: none;
}

.top a:hover { color: var(--brand); }

.who {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

main {
  max-width: 46rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

h1, h2 {
  margin: 0 0 0.6rem;
  color: var(--ink);
  font-family: Montserrat, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.8rem; }
h2 { font-size: 1.25rem; }

.lead, .note {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.note code, .placeholders code {
  background: var(--canvas);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
  color: var(--ink);
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(54, 55, 58, 0.06);
  padding: 1.25rem 1.35rem 1.5rem;
}

.tablist {
  display: flex;
  gap: 0.25rem;
  margin: 0 0 0;
  border-bottom: 1px solid var(--line);
}

.tablist button {
  margin: 0;
  padding: 0.75rem 1rem 0.65rem;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  cursor: pointer;
}

.tablist button:hover { color: var(--brand); }

.tablist button[aria-selected="true"] {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.tablist button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(216, 40, 46, 0.35);
  outline-offset: 2px;
}

.panel { margin-top: 1rem; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 14px 25px;
  font-family: Poppins, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  border: 0;
  background: var(--brand);
  color: var(--white);
}

.btn-primary:hover { background: var(--brand-dark); color: var(--white); }

.btn-secondary {
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.btn-secondary:hover { background: var(--canvas); color: var(--ink); }

.btn-header {
  padding: 8px 16px;
  font-size: 15px;
}

label {
  display: block;
  margin: 0.9rem 0 0.35rem;
  color: var(--ink);
  font-weight: 600;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.9rem;
  font-weight: 400;
}

.check input { width: 1rem; height: 1rem; accent-color: var(--brand); }

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

textarea { min-height: 16rem; resize: vertical; }

.smart-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
  padding: 0.4rem 0.7rem;
  font-family: Poppins, Arial, sans-serif;
  font-size: 15px;
  cursor: grab;
}

.chip:hover { color: var(--brand); background: var(--white); }

.chip:active { cursor: grabbing; }

.chip-path {
  color: var(--ink-muted);
  font-family: Inter, Arial, sans-serif;
  font-size: 13px;
}

textarea.drop-over,
input.drop-over,
.template-editor.drop-over {
  border-color: var(--brand);
  outline: 2px solid rgba(216, 40, 46, 0.35);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

#font-name { font-family: Inter, Arial, sans-serif; }

.editor-tool,
.editor-toolbar select {
  width: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  padding: 0.35rem 0.7rem;
  font-family: Poppins, Arial, sans-serif;
  font-size: 14px;
  cursor: pointer;
}

.editor-tool:hover,
.editor-toolbar select:hover { background: var(--canvas); }

.color-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-weight: 400;
  color: var(--ink-soft);
}

.color-label input { width: 2rem; height: 2rem; padding: 0; border: 0; background: transparent; }

.template-editor {
  min-height: 16rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.template-editor font[face*="Inter"],
#font-name option[value="Inter"] { font-family: Inter, Arial, sans-serif; }

.template-editor font[face*="Montserrat"],
#font-name option[value="Montserrat"] { font-family: Montserrat, Arial, sans-serif; }

.template-editor font[face*="Poppins"],
#font-name option[value="Poppins"] { font-family: Poppins, Arial, sans-serif; }

.template-editor:focus {
  outline: 2px solid rgba(216, 40, 46, 0.35);
  outline-offset: 2px;
}

.template-editor p { margin: 0 0 0.75rem; }

.smart-token {
  display: inline-block;
  margin: 0 0.1rem;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--brand);
  font-weight: 600;
  user-select: none;
}

.template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.4rem;
  padding: 0;
  list-style: none;
}

.template-list button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  font-family: Poppins, Arial, sans-serif;
  font-size: 15px;
  cursor: pointer;
}

.template-list button:hover,
.template-list button[aria-current="true"] {
  background: var(--canvas);
  color: var(--brand);
}

.preview-frame {
  width: 100%;
  min-height: 22rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.preview {
  margin: 0;
  padding: 1rem;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--ink);
  white-space: pre-wrap;
  font-family: Inter, Arial, sans-serif;
  font-size: 16px;
}

.banner {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: var(--warning);
  color: var(--brand);
}

.facts {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  color: var(--ink-soft);
}

.facts code {
  background: var(--canvas);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
  color: var(--ink);
}

.links { margin-top: 1.25rem; color: var(--ink-soft); }
.links a { color: var(--ink); }
.links a:hover { color: var(--brand); }
