:root {
  --ink: #101936;
  --muted: #5d6b86;
  --soft: #f6f9fc;
  --line: #d9e1ec;
  --line-strong: #c8d2df;
  --green: #0ba45a;
  --green-dark: #078945;
  --green-soft: #eaf8f0;
  --blue: #1769e8;
  --blue-soft: #eef6ff;
  --shadow: 0 18px 45px rgba(21, 36, 68, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: #fbfdff;
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 28px;
  min-height: 60px;
  padding: 10px 26px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #22304d;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
}

.brand strong,
.brand-icon {
  color: var(--green);
}

.brand-icon {
  font-size: 28px;
  line-height: 1;
}

.button-icon,
.tab-icon,
.section-icon,
.notice-icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 48px;
  color: #14213d;
  font-weight: 700;
}

.main-nav a {
  padding: 10px 0;
}

.main-nav a:hover,
.text-button:hover,
.guide-link:hover {
  color: var(--green-dark);
}

.header-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #12aa61, #078d46);
  color: white;
  font-weight: 800;
  box-shadow: 0 10px 18px rgba(11, 164, 90, 0.24);
  cursor: pointer;
}

.page-shell {
  max-width: 1388px;
  margin: 0 auto;
  padding: 36px 26px 56px;
}

.hero {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0 0 36px;
}

.quote-mark {
  display: grid;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 30px;
}

.hero h1 {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: clamp(40px, 4vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero > div:last-child {
  min-width: 0;
}

.hero p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 20px;
}

.hero strong {
  color: var(--green);
}

.generator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 1.04fr);
  gap: 18px;
}

.generator-grid > *,
.support-grid > *,
.field-row > *,
.field-row.is-split > *,
.result-heading > *,
.in-text-heading > * {
  min-width: 0;
}

.generator-panel,
.result-panel,
.examples-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.generator-panel,
.result-panel {
  padding: 22px 18px 16px;
}

.panel-step {
  margin: 0 0 12px 2px;
  font-weight: 800;
}

.source-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
}

.source-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--line-strong);
  background: #fff;
  color: #34415a;
  font-weight: 800;
  cursor: pointer;
  min-width: 0;
}

.source-tab:last-child {
  border-right: 0;
}

.source-tab.is-active {
  background: #f1fbf6;
  color: var(--green-dark);
  outline: 2px solid var(--green);
  outline-offset: -2px;
}

.field-list {
  display: grid;
  gap: 15px;
}

.field-row {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.field-row.is-split {
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.field-group label,
.split-field label {
  display: block;
  margin-bottom: 6px;
  color: #17213b;
  font-weight: 700;
}

.field-row > label {
  padding-top: 11px;
  color: #17213b;
  font-weight: 700;
}

.optional {
  color: var(--muted);
  font-weight: 500;
}

.field-group input,
.split-field input {
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: #15213a;
  background: #fff;
  outline: 0;
}

.field-group input:focus,
.split-field input:focus {
  border-color: #68a5ff;
  box-shadow: 0 0 0 3px rgba(23, 105, 232, 0.12);
}

.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.25;
}

.generate-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  margin-top: 21px;
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, #13ad62, #078d46);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 0 14px 22px rgba(11, 164, 90, 0.24);
  cursor: pointer;
}

.generate-button:hover,
.header-action:hover {
  filter: brightness(1.03);
}

.result-heading,
.in-text-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.result-heading h2,
.in-text-heading h3,
.section-heading h2,
.examples-panel h2 {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.2;
}

.result-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  color: #075ee8;
  font-weight: 800;
  cursor: pointer;
}

.citation-output {
  min-height: 178px;
  margin-top: 24px;
  padding: 24px 18px;
  border: 1px solid #8cdab5;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f7fffb, #f2fbff);
  color: #101936;
  font-size: 19px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.citation-output p {
  margin: 0;
  padding-left: 34px;
  text-indent: -34px;
  overflow-wrap: anywhere;
}

.divider {
  height: 1px;
  margin: 24px 0 22px;
  background: var(--line);
}

.in-text-output {
  min-height: 74px;
  margin-top: 12px;
  padding: 20px 18px;
  border: 1px solid #73afff;
  border-radius: var(--radius);
  background: var(--blue-soft);
  font-size: 19px;
  overflow-wrap: anywhere;
}

.notice {
  display: flex;
  gap: 12px;
  margin-top: 42px;
  padding: 18px 14px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbff, #fff);
  color: var(--muted);
}

.notice-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #0b64ce;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  color: #0b64ce;
  margin-top: 3px;
}

.notice-icon {
  color: #fff;
}

.notice p {
  margin: 0 0 5px;
}

.notice a {
  color: var(--blue);
  font-weight: 800;
}

.support-grid {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.guide-panel,
.faq-panel {
  padding: 4px 18px 8px;
}

.faq-panel {
  border-left: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.section-heading > .section-icon {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--green);
  font-size: 22px;
}

.steps {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: guide-step;
}

.steps li {
  position: relative;
  min-height: 28px;
  padding-left: 40px;
  color: #41506c;
  line-height: 1.4;
  counter-increment: guide-step;
}

.steps li::before {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  content: counter(guide-step);
  font-size: 13px;
  font-weight: 800;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  color: var(--blue);
  font-weight: 800;
}

.faq-list {
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.faq-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: #1d2943;
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 160ms ease;
}

.faq-answer {
  display: none;
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
}

.faq-answer.is-open {
  display: block;
}

.examples-panel {
  margin-top: 24px;
  padding: 22px 24px;
}

.example-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.example-row span {
  color: var(--green-dark);
  font-weight: 800;
}

.example-row p {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  padding: 12px 16px;
  border-radius: 6px;
  background: #10213e;
  color: #fff;
  font-weight: 800;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1000px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .main-nav {
    display: none;
  }

  .generator-grid,
  .support-grid {
    grid-template-columns: 1fr;
  }

  .faq-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-top: 20px;
  }
}

@media (max-width: 680px) {
  .site-header {
    padding: 10px 16px;
  }

  .brand {
    font-size: 18px;
  }

  .header-action {
    width: 42px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .header-action .button-icon {
    font-size: 16px;
  }

  .page-shell {
    padding: 24px 16px 42px;
  }

  .hero {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .quote-mark {
    flex-basis: 54px;
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero p {
    font-size: 17px;
    max-width: 100%;
  }

  .generator-panel,
  .result-panel,
  .examples-panel {
    padding: 18px 14px;
  }

  .source-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .source-tab {
    gap: 7px;
    padding: 0 8px;
    white-space: normal;
  }

  .source-tab:nth-child(2) {
    border-right: 0;
  }

  .source-tab:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-strong);
  }

  .field-row,
  .field-row.is-split {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .field-row > label {
    padding-top: 0;
  }

  .result-heading,
  .in-text-heading {
    align-items: flex-start;
  }

  .result-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .citation-output,
  .in-text-output {
    font-size: 17px;
  }
}
