:root {
  color-scheme: light;

  --page: #f6f6f4;
  --surface: #fff;
  --surface-subtle: #f1f1ef;
  --ink: #171917;
  --ink-soft: #555a55;
  --muted: #858a85;
  --border: #dedfdb;
  --border-strong: #c9cbc6;
  --accent: #4f7f32;
  --code-surface: #fafaf9;
  --toggle-track: #e7e8e4;
  --toggle-border: #d1d3ce;
  --toggle-thumb: #fff;
  --toggle-active: #171917;
  --toggle-knob: #fff;
  --radius: 14px;
}
:root[data-site-theme="dark"] {
  color-scheme: dark;

  --page: #111311;
  --surface: #181a18;
  --surface-subtle: #141614;
  --ink: #f1f2ef;
  --ink-soft: #b5b9b3;
  --muted: #7f857e;
  --border: #2c302c;
  --border-strong: #424842;
  --accent: #83ad69;
  --code-surface: #121412;
  --toggle-track: #252925;
  --toggle-border: #3a403a;
  --toggle-thumb: #aeb4ad;
  --toggle-active: #e6e9e3;
  --toggle-knob: #111311;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-site-theme="light"]) {
    color-scheme: dark;

    --page: #111311;
    --surface: #181a18;
    --surface-subtle: #141614;
    --ink: #f1f2ef;
    --ink-soft: #b5b9b3;
    --muted: #7f857e;
    --border: #2c302c;
    --border-strong: #424842;
    --accent: #83ad69;
    --code-surface: #121412;
    --toggle-track: #252925;
    --toggle-border: #3a403a;
    --toggle-thumb: #aeb4ad;
    --toggle-active: #e6e9e3;
    --toggle-knob: #111311;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  background: var(--page);
}
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
}
button,
a {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
a {
  text-decoration: none;
}
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}
header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
}
.mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.wordmark em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}
.github {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  transition: color 0.18s;
}
.github:hover {
  color: var(--ink);
}
.github svg {
  width: 16px;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-select {
  height: 30px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 0.18s,
    background 0.18s;
}
.menu-select:hover,
.menu-select:focus {
  background: var(--surface-subtle);
  color: var(--ink);
}
.field-menu {
  width: 100%;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.field-menu:hover,
.field-menu:focus {
  border-color: var(--border-strong);
}
.user-status {
  display: flex;
  align-items: center;
  gap: 6px;
}
.user-status::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}
.user-status[data-state="valid"] {
  color: var(--accent);
}
.user-status[data-state="valid"]::before {
  background: var(--accent);
}
.user-status[data-state="error"] {
  color: #b64d4d;
}
.user-status[data-state="error"]::before {
  background: #b64d4d;
}
main {
  padding: 68px 0 80px;
}
.intro {
  max-width: 660px;
  margin-bottom: 46px;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(36px, 5vw, 54px);
  font-weight: 620;
  line-height: 1.04;
  letter-spacing: -0.05em;
}
.intro > p:last-child {
  max-width: 540px;
  margin: 18px 0 0;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.65;
}
.app {
  position: relative;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: visible;
}
.settings {
  position: relative;
  z-index: 3;
  padding: 26px;
  border-right: 1px solid var(--border);
  border-radius: calc(var(--radius) - 1px) 0 0 calc(var(--radius) - 1px);
  background: var(--surface);
}
.section-title {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.section-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}
.builder-form {
  margin-top: 26px;
}
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.options {
  margin: 0;
  padding: 8px 0 0;
  border: 0;
  border-top: 1px solid var(--border);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  margin: -1px;
  white-space: nowrap;
  border: 0;
}
.field + .field,
.field + .two-columns,
.two-columns + .options {
  margin-top: 19px;
}
label,
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}
input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  outline: none;
  appearance: none;
  background-color: var(--surface);
  color: var(--ink);
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
input:hover {
  border-color: var(--border-strong);
}
input:focus {
  border-color: #92978f;
  box-shadow: 0 0 0 3px rgb(23 25 23 / 6%);
}
.help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}
.option {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.switch {
  position: relative;
  width: 34px;
  height: 20px;
  flex: 0 0 auto;
}
.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.switch-ui {
  position: absolute;
  inset: 0;
  border: 1px solid var(--toggle-border);
  border-radius: 99px;
  background: var(--toggle-track);
  box-shadow: inset 0 1px 1px rgb(0 0 0 / 4%);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--toggle-thumb);
  box-shadow:
    0 1px 2px rgb(0 0 0 / 18%),
    0 0 0 0.5px rgb(0 0 0 / 6%);
  transition:
    transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.2s ease;
}
.option:hover .switch-ui {
  border-color: var(--border-strong);
}
.switch input:checked + .switch-ui {
  border-color: var(--toggle-active);
  background: var(--toggle-active);
  box-shadow: none;
}
.switch input:checked + .switch-ui::after {
  background: var(--toggle-knob);
  transform: translateX(16px);
}
.switch input:focus-visible + .switch-ui {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(79 127 50 / 16%);
}
.workspace {
  position: relative;
  z-index: 1;
  min-width: 0;
}
.preview {
  min-height: 350px;
  display: grid;
  place-items: center;
  padding: 44px 30px 26px;
  background: var(--surface-subtle);
  border-radius: 0 calc(var(--radius) - 1px) 0 0;
}
#preview-stage {
  min-height: 230px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  width: 100%;
  display: grid;
  place-items: center;
}
#card-preview {
  display: block;
  width: min(100%, 500px);
  height: auto;
}
.local-note {
  max-width: 540px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
  text-align: left;
}
.local-note svg {
  width: 13px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--accent);
}
.export {
  padding: 24px 26px 26px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 calc(var(--radius) - 1px);
  background: var(--surface);
}
.export-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 13px;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 17px;
}
.tab {
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.tab:hover {
  color: var(--ink-soft);
}
.tab[aria-selected="true"] {
  border-bottom-color: var(--ink);
  color: var(--ink);
}
.open-card {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
}
.open-card:hover {
  color: var(--ink);
}
.open-card svg {
  width: 12px;
}
.code-wrap {
  position: relative;
  min-height: 78px;
  display: flex;
  align-items: center;
  padding: 15px 102px 15px 15px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--code-surface);
}
#code-output {
  margin: 0;
  color: #696c69;
  font:
    10px/1.6 ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.copy {
  position: absolute;
  top: 12px;
  right: 12px;
  height: 32px;
  min-width: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  cursor: pointer;
  transition:
    border-color 0.18s,
    color 0.18s;
}
.copy:hover {
  border-color: var(--border-strong);
  color: var(--ink);
}
.copy.success {
  border-color: #b9c9b0;
  color: var(--accent);
}
.copy svg {
  width: 13px;
}
footer {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 10px;
}
footer nav {
  display: flex;
  gap: 18px;
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}
footer a:hover {
  color: var(--ink);
}

@media (width <= 800px) {
  main {
    padding-top: 48px;
  }
  .intro {
    margin-bottom: 34px;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .settings {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  }
  .preview {
    border-radius: 0;
  }
  .export {
    border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
  }
}

@media (width <= 520px) {
  .shell {
    width: min(100% - 24px, 1120px);
  }
  header {
    height: 64px;
  }
  .github {
    display: none;
  }
  .header-actions {
    gap: 2px;
  }
  main {
    padding: 42px 0 56px;
  }
  h1 {
    font-size: 38px;
  }
  .intro > p:last-child {
    font-size: 14px;
  }
  .settings,
  .export {
    padding: 21px 18px;
  }
  .preview {
    min-height: 265px;
    padding: 30px 12px 22px;
  }
  .local-note {
    padding: 0 8px;
  }
  .code-wrap {
    padding: 55px 13px 13px;
  }
  .copy {
    left: 12px;
    right: auto;
  }
  footer {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 14px 0 22px;
}
.theme-swatch {
  width: 38px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--swatch-bg);
  color: var(--swatch-ink);
  cursor: pointer;
  font-weight: 700;
}
.theme-swatch[aria-pressed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.action-button {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
button:disabled,
a[aria-disabled="true"] {
  opacity: 0.45;
  cursor: default;
}
.preview > div {
  width: 100%;
}
.action-feedback:empty {
  display: none;
}
