:root {
  color-scheme: light;
  --ink: #17242d;
  --muted: #66767e;
  --line: #d9e1e5;
  --surface: #ffffff;
  --surface-subtle: #f4f7f8;
  --violet: #5652b8;
  --violet-soft: #efeffc;
  --success: #19734a;
  --danger: #a32929;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 20px 28px;
}

.masthead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px 4px 10px 4px;
  background: var(--violet);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.3;
}

.intro {
  margin: 18px 0 24px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.default-badge,
.preview-label {
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.signature-options {
  display: grid;
  gap: 9px;
}

.signature-option {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 11px;
  min-height: 88px;
  padding: 13px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.signature-option:hover {
  border-color: #aaa8dc;
}

.signature-option:has(input:checked) {
  border-color: var(--violet);
  background: var(--violet-soft);
  box-shadow: 0 0 0 1px var(--violet);
}

.signature-option:focus-within {
  outline: 3px solid rgba(86, 82, 184, 0.22);
  outline-offset: 2px;
}

.signature-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.option-indicator {
  width: 16px;
  height: 16px;
  border: 1px solid #9aa8af;
  border-radius: 50%;
  background: #fff;
}

input:checked + .option-indicator {
  border: 5px solid var(--violet);
}

.option-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.option-copy strong {
  font-size: 14px;
}

.option-copy small {
  color: var(--violet);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.option-copy span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.option-code {
  color: #8c99a0;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.preview-section {
  margin-top: 24px;
}

.signature-preview {
  min-height: 180px;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.signature-preview > * {
  background: #fff;
}

.status {
  min-height: 20px;
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.status[data-state="success"] {
  color: var(--success);
}

.status[data-state="error"] {
  color: var(--danger);
}

.actions {
  display: grid;
  gap: 8px;
}

.primary-action,
.secondary-action {
  min-height: 42px;
  border-radius: 7px;
  font-weight: 700;
  cursor: pointer;
}

.primary-action {
  border: 1px solid var(--violet);
  background: var(--violet);
  color: #fff;
}

.primary-action:hover {
  background: #4743a4;
}

.secondary-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.secondary-action:hover {
  border-color: #9aa8af;
  background: var(--surface-subtle);
}

button:focus-visible {
  outline: 3px solid rgba(86, 82, 184, 0.28);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

@media (max-width: 340px) {
  .shell {
    padding-inline: 14px;
  }

  .signature-option {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .option-code {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
