/* Inter (SIL Open Font License, fonts/OFL.txt), served from this site: no visitor data goes to a font CDN. */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('fonts/inter-latin.woff2') format('woff2'); }

:root {
  --bg: #000000;
  --surface: #171717;
  --surface-2: #212121;
  --surface-3: #2f2f2f;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #ececec;
  --muted: #b4b4b4;
  --faint: #8f8f8f;
  --accent: #2f7cf6;
  --accent-soft: rgba(47, 124, 246, 0.14);
  --warn: #f5b74e;
  --danger: #f87171;
  --ok: #4ade80;
  --radius: 16px;
  --pill: 9999px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
code { font: 13px var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; position: sticky; top: 0; background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px); z-index: 2; }
.brand { font-weight: 600; font-size: 17px; text-decoration: none; }
.topbar nav { display: flex; gap: 20px; }
.topbar nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: var(--text); }

main { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }
.hero { text-align: center; padding: 72px 0 40px; }
.hero h1 { font-size: clamp(26px, 5vw, 34px); font-weight: 500; letter-spacing: -0.02em; margin: 0 0 12px; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 520px; }

.notice { display: flex; gap: 12px; align-items: flex-start; background: var(--accent-soft); border: 1px solid rgba(47, 124, 246, 0.3); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.notice svg { width: 20px; height: 20px; flex: none; fill: var(--accent); margin-top: 2px; }
.notice p { margin: 0; color: var(--text); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; margin-bottom: 16px; }
.card h2 { font-size: 16px; font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; }
.step { width: 24px; height: 24px; border-radius: var(--pill); background: var(--surface-3); color: var(--muted); font-size: 12px; display: inline-grid; place-items: center; flex: none; }
.optional { font-size: 12px; font-weight: 500; color: var(--faint); border: 1px solid var(--border); border-radius: var(--pill); padding: 1px 8px; }

.field { display: block; width: 100%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; font: inherit; margin-bottom: 10px; outline: none; transition: border-color 0.15s; }
.field:focus { border-color: var(--accent); }
.field::placeholder { color: var(--faint); }
.field.mono { font-family: var(--mono); font-size: 13px; }
select.field { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.hint { color: var(--faint); font-size: 13px; margin: 4px 0 0; }
.warn { color: var(--warn); font-size: 13px; margin: 8px 0 0; }
.label { color: var(--muted); font-size: 13px; margin: 14px 0 8px; display: block; }

.steps { margin: 4px 0 8px; padding-left: 20px; color: var(--muted); font-size: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.steps li { padding-left: 2px; min-width: 0; }
.snippet { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-width: 0; }
.snippet code { flex: 1; min-width: 0; padding: 8px 10px; overflow-x: auto; white-space: nowrap; word-break: normal; }
.copy { flex: none; background: var(--surface-3); color: var(--text); border: 1px solid var(--border); border-radius: var(--pill); padding: 6px 14px; font: inherit; font-size: 13px; cursor: pointer; }
.copy:hover { background: var(--surface-2); }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: var(--pill); padding: 4px; margin-bottom: 14px; }
.segmented button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; padding: 7px 16px; border-radius: var(--pill); cursor: pointer; }
.segmented button[aria-selected="true"] { background: var(--surface-3); color: var(--text); }

.service-row { display: grid; grid-template-columns: 170px 1fr auto; gap: 8px; align-items: start; }
.service-row .field { margin-bottom: 8px; }
.service-row .remove { background: transparent; border: 0; color: var(--faint); font-size: 20px; line-height: 1; padding: 12px 6px; cursor: pointer; }
.service-row .remove:hover { color: var(--text); }
.creds { display: grid; gap: 0; }
.creds.two { grid-template-columns: 1fr 1fr; gap: 8px; }

.ghost { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); border-radius: 12px; padding: 9px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.ghost:hover { color: var(--text); border-color: var(--faint); }

.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--border-strong); background: var(--surface-2); }
.choice input { accent-color: var(--text); margin-top: 4px; }
.choice strong { display: block; font-weight: 500; }
.choice small { display: block; color: var(--faint); font-size: 13px; }
.choice.compact { padding: 10px 14px; }
.indent { margin: -2px 0 12px 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 7px 16px; border-radius: var(--pill); border: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.chips input:checked + span { background: var(--text); color: #000; border-color: var(--text); }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stack { display: block; }
.toggle { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; color: var(--muted); font-size: 14px; cursor: pointer; }
.toggle input { accent-color: var(--text); width: 16px; height: 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.primary, .secondary { font: inherit; font-size: 15px; font-weight: 500; border-radius: var(--pill); padding: 11px 22px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.primary { background: var(--text); color: #000; border: 1px solid var(--text); }
.primary:hover { background: #fff; }
.secondary { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.secondary:hover { background: var(--surface-2); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

.review { background: var(--surface-2); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; font-size: 14px; }
.review ul { list-style: none; margin: 0; padding: 0; }
.review li { padding: 3px 0; display: flex; gap: 10px; }
.review:empty { display: none; }
.review li span:last-child { min-width: 0; overflow-wrap: anywhere; }
.tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; border-radius: 6px; padding: 2px 6px; flex: none; }
.tag.add { background: rgba(74, 222, 128, 0.14); color: var(--ok); }
.tag.replace { background: var(--accent-soft); color: #8fb6fb; }
.tag.remove { background: rgba(248, 113, 113, 0.14); color: var(--danger); }
.tag.keep { background: var(--surface-3); color: var(--faint); }

.log { list-style: none; margin: 14px 0 0; padding: 0; font-size: 14px; }
.log li { padding: 4px 0 4px 22px; position: relative; color: var(--muted); }
.log li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.log li.ok::before { background: var(--ok); }
.log li.err { color: var(--danger); }
.log li.err::before { background: var(--danger); }
.log li.run::before { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.done { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }

.restore summary { cursor: pointer; color: var(--muted); }
.restore[open] summary { margin-bottom: 10px; }
.restore input[type="file"] { color: var(--muted); font: inherit; font-size: 14px; margin: 10px 0; display: block; }

.prose, .faq { margin-top: 56px; }
.prose h2, .faq h2 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; margin: 0 0 16px; }
.prose p, .prose li { color: var(--muted); }
.prose ol { padding-left: 20px; }
.prose li { margin-bottom: 8px; }
.credits ul { padding-left: 20px; }
.prose strong { color: var(--text); font-weight: 500; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 18px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-size: 18px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 18px 16px; color: var(--muted); }

.footer { max-width: 720px; margin: 0 auto; padding: 24px 16px 40px; display: flex; justify-content: space-between; color: var(--faint); font-size: 13px; border-top: 1px solid var(--border); }
.footer a { color: var(--faint); }

@media (max-width: 560px) {
  .hero { padding: 48px 0 28px; }
  .card { padding: 18px 16px; }
  .service-row { grid-template-columns: 1fr auto; }
  .service-row select { grid-column: 1 / -1; }
  .creds.two, .row { grid-template-columns: 1fr; gap: 0; }
  .actions > * { flex: 1 1 100%; justify-content: center; }
}

select:disabled { opacity: 0.4; cursor: not-allowed; }
