@font-face {
  font-family: 'Manrope';
  src: url('../fonts/manrope.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;  --fg: #09090b;
  --panel: #ffffff;  --panel-border: rgba(24, 24, 40, 0.10);
  --border: #e4e4e7;  --muted: #f4f4f5;  --muted-fg: #71717a;
  --shadow-panel: 0 1px 2px rgba(24,24,40,.05), 0 8px 24px -16px rgba(24,24,40,.18);

  --accent: #fbc711;  --accent-hover: #ddaf0f;  --on-accent: #645007;
  --accent-container: #fff8e2;  --on-accent-container: #5f4c06;

  --link: #1b74bc;
  --danger: #cc372d;   --danger-bg: #fef2f1;
  --success: #38813a;  --success-bg: #f2f9f3;
  --warning: #8f6c03;  --warning-bg: #fffbee;

  --radius: 0.875rem;
  --panel-radius: 1.375rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;  --fg: #fafafa;
    --panel: #1b1d29;  --panel-border: rgba(255,255,255,.09);
    --border: #27272a;  --muted: #1c1c1f;  --muted-fg: #a1a1aa;
    --shadow-panel: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -16px rgba(0,0,0,.6);
    --accent-container: #4b3c05;  --on-accent-container: #fde694;
    --link: #2295f1;
    --danger: #f34236;   --danger-bg: #350f0c;
    --success: #4bae4f;  --success-bg: #102611;
    --warning: #ffc006;  --warning-bg: #382a01;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.wrap { width: min(64rem, calc(100% - 3rem)); margin-inline: auto; }
.page { padding: 2rem 0 3rem; display: grid; gap: 1.5rem; }
.foot { padding-bottom: 2rem; color: var(--muted-fg); font-size: .8125rem; }

.topbar { border-bottom: 1px solid var(--border); background: var(--panel); }
.topbar .wrap { display: flex; align-items: center; gap: 1.5rem; min-height: 4rem; }
.topbar .brand { font-weight: 700; letter-spacing: -.01em; }
.topbar nav { display: flex; gap: 1rem; margin-right: auto; }
.topbar nav a {
  color: var(--muted-fg); text-decoration: none; font-weight: 600;
  font-size: .9375rem; padding: .375rem .125rem; border-bottom: 2px solid transparent;
}
.topbar nav a:hover { color: var(--fg); }
.topbar nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); }

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
h2 { font-size: 1.0625rem; font-weight: 600; margin: 0 0 .75rem; }
h2 + form, h2 + p { margin-top: 0; }
.panel h2 + h2 { margin-top: 2rem; }

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow-panel);
  padding: 1.5rem;
}
.panel.narrow { max-width: 34rem; }
.grid-2 { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); align-items: start; }

label { display: block; font-size: .9375rem; font-weight: 600; margin: 1rem 0 .375rem; }
label:first-of-type { margin-top: 0; }
input[type="text"], input[type="password"], input[type="file"], input:not([type]), select, textarea {
  display: block; width: 100%; padding: .625rem .75rem;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; font-size: .9375rem;
}
input[type="hidden"] { display: none; }
select { appearance: auto; }
textarea { font-family: inherit; line-height: 1.5; resize: vertical; min-height: 4.5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem 1.25rem; margin: 1.5rem 0; }
legend { font-weight: 600; font-size: .9375rem; padding-inline: .375rem; }

.hint { color: var(--muted-fg); font-size: .8125rem; margin: .375rem 0 0; }
.hint.block { display: block; }
.dim { color: var(--muted-fg); font-weight: 400; }
code { font-size: .875em; background: var(--muted); padding: .125rem .375rem; border-radius: .375rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .375rem;
  min-height: 2.75rem; padding: .5rem 1rem;
  background: var(--muted); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius);
  font: inherit; font-size: .9375rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--muted-fg); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; }
.btn.small { min-height: 2.25rem; padding: .25rem .625rem; font-size: .875rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn.arming { background: var(--danger); color: #fff; border-color: transparent; }
.actions { display: flex; gap: .75rem; margin-top: 1.5rem; flex-wrap: wrap; }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
a { color: var(--link); }

.tag {
  display: inline-flex; align-items: center; min-height: 2.25rem;
  padding: .125rem .625rem; border-radius: 999px;
  border: 1px solid var(--border); font: inherit; font-size: .8125rem;
  font-weight: 600; cursor: pointer;
}
.tag.on { background: var(--success-bg); color: var(--success); border-color: transparent; }
.tag.off { background: var(--muted); color: var(--muted-fg); }

input[type="checkbox"], input[type="radio"] {
  width: 1.125rem; height: 1.125rem; flex: none; accent-color: var(--accent); cursor: pointer;
}
.field-check { display: flex; align-items: center; gap: .625rem; min-height: 2.75rem; cursor: pointer; font-weight: 400; }

.switch { display: inline-flex; align-items: center; gap: .625rem; cursor: pointer; min-height: 2.75rem; font-weight: 400; margin-top: .5rem; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  flex: none; width: 2.75rem; height: 1.5rem; background: var(--border);
  border: 1px solid var(--panel-border); border-radius: 999px; position: relative;
  transition: background .15s ease;
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 1.125rem; height: 1.125rem; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(24,24,40,.3);
  transition: transform .15s ease;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(1.25rem); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch .track, .switch .track::after { transition: none; } }

table { width: 100%; border-collapse: collapse; }
caption { text-align: left; }
th {
  text-align: left; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted-fg);
  padding: 0 .75rem .5rem 0;
}
td { padding: .75rem .75rem .75rem 0; border-top: 1px solid var(--border); vertical-align: middle; }
td.nowrap { white-space: nowrap; }
.inline { display: inline; }

.icon { width: 2rem; height: 2rem; object-fit: contain; border-radius: .375rem; display: block; }
.icon.big { width: 3rem; height: 3rem; }
.icon.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-weight: 700; border-radius: .5rem;
}
.current-icon { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; }

.note {
  padding: .75rem 1rem; border-radius: var(--radius); font-size: .9375rem;
  background: var(--muted); color: var(--fg); margin: 0;
}
.note.success { background: var(--success-bg); color: var(--success); }
.note.error { background: var(--danger-bg); color: var(--danger); }
.note.warning { background: var(--warning-bg); color: var(--warning); }

pre {
  background: var(--muted); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; overflow-x: auto; font-size: .875rem; line-height: 1.5;
}
.copied { font-size: .8125rem; color: var(--success); margin-left: .5rem; }

.preview {
  display: flex; justify-content: center; padding: 2rem;
  background: var(--muted); border-radius: var(--radius);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.row { display: flex; gap: .75rem; align-items: stretch; }
.row input { flex: 1; }
.row .btn { white-space: nowrap; }

/* Shown / hidden: a tick or a dash, so the state still reads with the colour
   taken away. The word lives in the title and the label, not on screen. */
.mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  font: inherit; font-size: 1.0625rem; line-height: 1; cursor: pointer;
}
.mark.on { color: var(--success); border-color: transparent; background: var(--success-bg); }
.mark.off { color: var(--muted-fg); }
.mark:hover { border-color: var(--muted-fg); }

/* Preview tab: a stand-in for a site's own menu bar, so the button is seen
   where it will actually live. */
.seg { display: flex; gap: .5rem; }
.seg .btn[aria-current="true"] { background: var(--accent-container); color: var(--on-accent-container); border-color: transparent; }
.fakesite { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fakebar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1rem; min-height: 4rem;
  background: var(--brand-navy, #111827); color: #fff;
}
.fakebar .spacer { margin-left: auto; }
.fakebar .fakelink { font-size: .9375rem; opacity: .85; }
.fakebody { height: 16rem; background: var(--muted); }
.fakesite.is-light { background: #ffffff; }
.fakesite.is-light .fakebody { background: #f4f4f5; }
.fakesite.is-dark { background: #09090b; }
.fakesite.is-dark .fakebody { background: #17171a; }

/* One wordmark, its preview and its file box are one block, with real air
   between the two blocks - the preview must never look like it belongs to the
   control above it. */
.logo-group {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 1rem 1.125rem 1.25rem;
  margin-top: 1.25rem;
}
.logo-group + .logo-group { margin-top: 2rem; }
.logo-group .group-label {
  display: block; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--muted-fg);
  margin-bottom: .75rem;
}
.logo-group label { margin-top: 1rem; }
.logo-group input[type="file"] { background: var(--panel); }

/* Each preview sits on the background it is meant for, so white type on a
   white card isn't invisible. */
.logo-preview { height: 2.25rem; width: auto; padding: .625rem 1rem; border-radius: var(--radius); display: block; }
.logo-preview.light { background: #ffffff; }
.logo-preview.dark { background: #111827; }
