:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --line: #e3e6eb;
  --fg: #0f1419;
  --fg-2: #4a5361;
  --link: #1d5fd1;
  --code-bg: #0f1419;
  --code-fg: #e6edf3;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0d12;
  --surface: #12151c;
  --surface-2: #181c24;
  --line: #262b35;
  --fg: #eef1f5;
  --fg-2: #a3acba;
  --link: #79a8ff;
  --code-bg: #05070a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); }
code { font: 0.9em/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 10; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

.top { border-bottom: 1px solid var(--line); background: var(--surface); }
.top-in { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand small { font-weight: 500; color: var(--fg-2); font-size: 14px; }
.top nav { display: flex; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.top nav a { color: var(--fg-2); text-decoration: none; font-size: 15px; padding: 6px 0; }
.top nav a:hover { color: var(--fg); }
.theme, .copy, .button, select, input[type="color"] { font: inherit; }
.theme { border: 1px solid var(--line); background: var(--surface-2); color: var(--fg); border-radius: 8px; min-height: 40px; padding: 0 12px; cursor: pointer; }

main section { padding: 28px 16px; }
h1 { font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 8px 0 12px; letter-spacing: -0.01em; }
h2 { font-size: 24px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 20px 0 8px; }
.lead { font-size: 18px; color: var(--fg-2); max-width: 680px; margin: 0 0 12px; }
.note, .muted { color: var(--fg-2); font-size: 15px; }

.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.controls label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--fg-2); font-weight: 500; }
.controls select, .controls input { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); padding: 0 10px; }
.controls input[type="color"] { padding: 4px; width: 100%; }
.widget-box { min-height: 360px; }

.code { position: relative; }
pre { margin: 0; background: var(--code-bg); color: var(--code-fg); border-radius: 10px; padding: 52px 16px 16px; overflow-x: auto; }
pre code { background: none; padding: 0; color: inherit; overflow-wrap: normal; white-space: pre; }
.copy { position: absolute; top: 8px; right: 8px; min-height: 36px; padding: 0 12px; border-radius: 8px; border: 1px solid #3a4250; background: #1b212b; color: #e6edf3; cursor: pointer; }
details { margin-top: 16px; }
summary { cursor: pointer; font-weight: 600; min-height: 40px; display: flex; align-items: center; }

.table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
.list { padding-left: 20px; }
.list li { margin: 6px 0; }
.button { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; border-radius: 10px; background: var(--fg); color: var(--bg); text-decoration: none; font-weight: 600; }
.legal p { max-width: 720px; }
.foot { border-top: 1px solid var(--line); padding: 20px 0 32px; color: var(--fg-2); font-size: 14px; }

@media (min-width: 720px) {
  .controls { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  main section { padding: 36px 16px; }
}
