/* cssminify.org / jsminifier.org - shared styles */
:root {
  --bg: #f6f6f9;
  --surface: #ffffff;
  --surface-2: #f0f0f5;
  --code-bg: #fbfbfd;
  --border: #e2e2ea;
  --border-strong: #cfcfdb;
  --text: #16161d;
  --muted: #5d5d6e;
  --danger: #c0262d;
  --danger-bg: #fdecec;
  --ok: #18794e;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 8px 24px -12px rgba(20, 20, 40, .12);
  --radius: 14px;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Code", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0d11; --surface: #14151b; --surface-2: #1b1c24; --code-bg: #101117;
    --border: #262833; --border-strong: #353846; --text: #ebebf1; --muted: #9b9daf;
    --danger: #ff7a7f; --danger-bg: #2a1416; --ok: #4cc38a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c0d11; --surface: #14151b; --surface-2: #1b1c24; --code-bg: #101117;
  --border: #262833; --border-strong: #353846; --text: #ebebf1; --muted: #9b9daf;
  --danger: #ff7a7f; --danger-bg: #2a1416; --ok: #4cc38a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.no-js .js-only { display: none !important; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: -.01em; }
.brand-name { font-size: 1.05rem; }
.tld { color: var(--muted); font-weight: 500; }
.logo {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: var(--accent); color: var(--accent-ink);
  font: 800 13px/1 var(--mono); letter-spacing: -.04em;
}
.links { display: flex; gap: 4px; }
.links a { color: var(--muted); text-decoration: none; font-size: .925rem; padding: 6px 10px; border-radius: 8px; }
.links a:hover { color: var(--text); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sister-link {
  font-size: .875rem; font-weight: 600; color: var(--text); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.sister-link:hover { border-color: var(--border-strong); }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { border-color: var(--border-strong); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* Hero */
.hero { padding-top: 36px; padding-bottom: 20px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px;
  font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }
.hero h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.035em; margin-bottom: 12px; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--muted); max-width: 720px; }
.trust { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .9rem; color: var(--muted); }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust svg { color: var(--accent-text); }

/* Tool */
.tool-section { padding-bottom: 24px; }
.tool {
  background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow); padding: 14px;
}
.tool-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 4px 14px; }
.options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.opt {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font-size: .85rem; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.opt:hover { border-color: var(--border-strong); }
.opt input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.opt select {
  font: inherit; font-size: .85rem; color: var(--text); background: transparent; border: 0; padding: 0 2px; cursor: pointer;
}
.opt select option { background: var(--surface); color: var(--text); }
.opt-more { position: relative; }
.opt-more > summary { list-style: none; }
.opt-more > summary::-webkit-details-marker { display: none; }
.opt-more > summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg) translateY(-2px); margin-left: 2px; }
.opt-more[open] > summary::after { transform: rotate(-135deg) translate(-2px, 0); }
.opt-panel {
  position: absolute; z-index: 10; top: calc(100% + 8px); left: 0; min-width: 260px;
  display: grid; gap: 6px; padding: 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.opt-panel .opt { border-radius: 8px; justify-content: flex-start; }
.opt-panel .opt small { color: var(--muted); margin-left: auto; padding-left: 10px; }
.run { display: flex; align-items: center; gap: 8px; }
.hint {
  font-size: .75rem; color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 6px; padding: 2px 6px; background: var(--surface-2);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 .9rem/1 var(--sans); color: var(--text); text-decoration: none; white-space: nowrap;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; padding: 11px 18px; font-size: .95rem; }
.btn-primary:hover { background: var(--accent); border-color: transparent; filter: brightness(1.07); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: .8rem; border-radius: 8px; }
.btn.is-busy { opacity: .7; pointer-events: none; }

.panes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pane {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--code-bg); overflow: hidden;
}
.pane-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 8px 8px 14px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.pane-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.pane-title strong { font-size: .9rem; }
.meta { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.code {
  display: block; width: 100%; flex: 1; min-height: 360px; resize: vertical; margin: 0;
  padding: 14px 16px; border: 0; outline: none; background: transparent; color: var(--text);
  font: 13px/1.6 var(--mono); tab-size: 2; white-space: pre; overflow: auto;
}
#output { white-space: pre-wrap; word-break: break-all; }
.code::placeholder { color: var(--muted); opacity: .8; }
.files { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px dashed var(--border); background: var(--surface); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-family: var(--mono);
  padding: 3px 4px 3px 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
}
.chip button { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 4px; }
.chip button:hover { color: var(--danger); }
.drop {
  position: absolute; inset: 0; display: none; place-items: center; text-align: center;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 2px dashed var(--accent); border-radius: var(--radius);
}
.drop div { display: grid; gap: 4px; }
.drop span { color: var(--muted); font-size: .875rem; }
.pane.dragging .drop { display: grid; }

.alert, .notice { margin-top: 12px; padding: 10px 14px; border-radius: 10px; font-size: .9rem; }
.alert { color: var(--danger); background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); font-family: var(--mono); font-size: .85rem; white-space: pre-wrap; }
.notice { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 12px; }
.stat { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.stat .label { display: block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .value { display: block; font: 700 1.2rem/1.3 var(--sans); font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.stat-saved .value { color: var(--accent-text); }
.bar { display: block; height: 4px; margin-top: 8px; border-radius: 99px; background: var(--border); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }
.stats[data-empty] .value { color: var(--muted); }

/* Sections */
.section { padding-top: 56px; padding-bottom: 8px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.feature { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }
.f-icon {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text);
}
.f-icon svg { width: 19px; height: 19px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 18px 20px 18px 62px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .95rem; }
.steps li strong { color: var(--text); display: block; }
.steps li::before {
  content: counter(s); position: absolute; left: 18px; top: 18px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; background: var(--accent); color: var(--accent-ink);
}

.api-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 32px; align-items: start; }
.api-spec { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 20px 0; font-size: .925rem; }
.api-spec dt { font-weight: 600; color: var(--muted); }
.api-spec dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.api-spec code, .prose code, .answer code { font-size: .85em; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 5px; border-radius: 5px; }
.code-tabs { position: relative; border-radius: var(--radius); background: #111218; border: 1px solid #23252f; overflow: hidden; color: #e4e5ee; }
.tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid #23252f; overflow-x: auto; }
.tabs button { font: 600 .8rem var(--sans); color: #9a9cb0; background: none; border: 0; padding: 7px 11px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: #fff; background: #23252f; }
.snippet { margin: 0; padding: 18px; overflow-x: auto; font-size: 13px; line-height: 1.65; }
.copy-snippet { position: absolute; right: 10px; bottom: 10px; background: #23252f; color: #e4e5ee; border-color: #34374a; }
.copy-snippet:hover { background: #2c2f3c; border-color: #44475c; }

.faq { display: grid; gap: 10px; margin-top: 20px; max-width: 880px; }
.faq details { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.faq summary { cursor: pointer; padding: 15px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.answer { padding: 0 18px 4px; color: var(--muted); }

.sister-card {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px; text-decoration: none; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.sister-card:hover { border-color: var(--border-strong); }
.sister-card strong { display: block; font-size: 1.05rem; }
.sister-card .arrow { margin-left: auto; font-size: 1.4rem; color: var(--muted); }
.logo-sister { width: 44px; height: 44px; border-radius: 12px; font-size: 15px; flex: none; }
.site-css .logo-sister { background: #f7df1e; color: #1a1a1a; }
.site-js .logo-sister { background: #5b5bf6; color: #fff; }

/* Prose pages */
.prose { max-width: 760px; padding-top: 48px; padding-bottom: 24px; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.prose h2 { font-size: 1.25rem; margin-top: 2em; }
.notfound { text-align: left; padding-top: 72px; }

/* Footer */
.site-footer { margin-top: 72px; border-top: 1px solid var(--border); background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; padding-top: 36px; padding-bottom: 24px; }
.footer-grid h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .925rem; }
.footer-grid ul a { color: var(--text); text-decoration: none; }
.footer-grid ul a:hover { text-decoration: underline; }
.footer-grid p { margin-top: 12px; max-width: 360px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 16px; padding-bottom: 28px; border-top: 1px solid var(--border); font-size: .85rem; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 60;
  padding: 10px 16px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 600;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 960px) {
  .panes { grid-template-columns: 1fr; }
  .code { min-height: 260px; }
  .features, .steps { grid-template-columns: 1fr 1fr; }
  .api-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .links { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .nav { gap: 12px; }
  .sister-link { display: none; }
  .hero { padding-top: 32px; }
  .tool { padding: 10px; border-radius: var(--radius); }
  .tool-bar { flex-direction: column; align-items: stretch; }
  .run { order: 2; }
  .run .btn-primary { flex: 1; }
  .hint { display: none; }
  .features, .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat-saved { grid-column: span 2; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: span 2; }
  .opt-panel { left: 0; right: auto; min-width: 0; width: calc(100vw - 52px); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Logo marks (SVG) */
.logo:has(img) { background: none; }
.logo img { display: block; width: 100%; height: 100%; }
