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

body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a2e;
  background: #f5f6f8;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: #e8eaed;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.site-header {
  background: #0d1b2a;
  color: #fff;
  padding: 12px 24px;
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-header__brand {
  font-weight: 600;
  font-size: 1.1rem;
}

.site-header__nav {
  font-size: 0.875rem;
  color: #94a3b8;
  min-width: 0;
}

.site-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.page-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
}

.page-lead {
  margin: 0 0 32px;
  color: #475569;
}

.widget-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 24px;
}

.widget-panel__label {
  margin: 0 0 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.embed-guide {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 24px;
}

.embed-guide__title {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
}

.embed-guide__steps {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  color: #334155;
}

.embed-guide__steps li {
  margin-bottom: 8px;
}

.embed-guide__steps li:last-child {
  margin-bottom: 0;
}

.embed-guide__note {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.embed-snippet {
  margin-bottom: 16px;
}

.embed-snippet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.embed-snippet__title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.embed-snippet__copy {
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}

.embed-snippet__copy:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.embed-snippet__copy--done {
  border-color: #22c55e;
  background: #f0fdf4;
  color: #166534;
}

.embed-snippet__code {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  white-space: pre;
}

.embed-snippet__code code {
  background: none;
  padding: 0;
  font-size: inherit;
  white-space: inherit;
  overflow-wrap: normal;
  word-break: normal;
}

.widget-slot {
  min-height: 48px;
}

.widget-slot--hello {
  max-width: 360px;
}

.widget-slot--ta {
  width: 100%;
  max-width: 520px;
}

.site-main--wide {
  max-width: 1120px;
}

.toc {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 28px;
}

.toc__title {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
}

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.toc__list a {
  color: #0b77d5;
  text-decoration: none;
  font-size: 0.9375rem;
}

.toc__list a:hover {
  text-decoration: underline;
}

.doc-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 24px 28px;
  margin-bottom: 24px;
}

.doc-section__title {
  margin: 0 0 12px;
  font-size: 1.25rem;
  font-weight: 600;
}

.doc-section p {
  margin: 0 0 12px;
  color: #334155;
}

.doc-section p:last-child {
  margin-bottom: 0;
}

.doc-steps {
  margin: 0 0 16px;
  padding-left: 1.25rem;
  color: #334155;
}

.doc-steps li {
  margin-bottom: 8px;
}

.doc-list {
  margin: 0 0 12px;
  padding-left: 1.25rem;
  color: #334155;
}

.doc-note {
  font-size: 0.875rem;
  color: #64748b;
}

.callout {
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 0.9375rem;
  margin-top: 12px;
}

.callout--info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
}

.callout--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #713f12;
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
}

.ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ref-table th,
.ref-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}

.ref-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}

.ref-table td:first-child {
  min-width: 140px;
}

.locale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 16px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: #334155;
}

.locale-grid code {
  margin-right: 6px;
}

.doc-section--internal {
  background: #f8fafc;
  border-style: dashed;
}

.faq {
  margin: 0;
}

.faq dt {
  font-weight: 600;
  margin-top: 16px;
  color: #1e293b;
}

.faq dt:first-child {
  margin-top: 0;
}

.faq dd {
  margin: 4px 0 0;
  color: #475569;
}

.playground {
  display: grid;
  gap: 24px;
  margin-top: 16px;
}

.playground > * {
  min-width: 0;
}

@media (min-width: 900px) {
  .playground {
    grid-template-columns: minmax(280px, 360px) 1fr;
    align-items: start;
  }
}

.playground__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.playground__form > * {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.playground__preview {
  min-width: 0;
}

.playground__group {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 16px;
  margin: 0;
  width: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
}

.playground__group-title {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 0.875rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.playground__group-lead {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  color: #64748b;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.field:last-child {
  margin-bottom: 0;
}

.field--checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
}

.field--checkbox .field__label,
.field--checkbox .field__hint {
  flex: 1;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
}

.field__label em {
  font-weight: 400;
  color: #dc2626;
  font-style: normal;
}

.field__hint {
  font-size: 0.75rem;
  color: #64748b;
  overflow-wrap: anywhere;
}

.field input[type="text"],
.field input[type="url"],
.field select {
  display: block;
  font: inherit;
  width: 100%;
  inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
}

.field input[type="color"] {
  display: block;
  width: 100%;
  inline-size: 100%;
  height: 40px;
  padding: 2px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
}

.btn {
  font: inherit;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
}

.btn:hover {
  background: #f1f5f9;
}

.btn--primary {
  background: #0b77d5;
  border-color: #0b77d5;
  color: #fff;
}

.btn--primary:hover {
  background: #0969bd;
}

.btn--small {
  font-size: 0.8125rem;
  padding: 6px 12px;
}

.playground__preview-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
}

.embed-output {
  margin-top: 20px;
  min-width: 0;
}

.embed-output__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.embed-output__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  min-width: 0;
}

.embed-output__code {
  margin: 0;
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.45;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  white-space: pre;
}

.embed-output__code code {
  background: none;
  padding: 0;
  white-space: inherit;
  overflow-wrap: normal;
  word-break: normal;
}

.demo-url-wrap {
  margin: 0;
}

.demo-url {
  font-size: 0.8125rem;
  word-break: break-all;
  color: #0b77d5;
}

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

  .site-main {
    padding: 24px 16px 40px;
  }

  .toc,
  .doc-section {
    padding: 20px 16px;
  }

  .playground__group {
    padding: 12px;
  }
}

.widget-panel--compact {
  margin-bottom: 16px;
  padding: 16px 20px;
}

.widget-panel--compact:last-child {
  margin-bottom: 0;
}
