*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Light palette is the bare :root default; the dark one is applied by the OS
   preference. No explicit theme switch here — the page has nothing to toggle. */
:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --card-hover: #f0f4fb;
  --text: #182033;
  --muted: #5c6780;
  --border: #d5dded;
  --accent: #1f6f4a;
  --accent-text: #ffffff;
  --accent-hover: #185a3c;
  --focus: #5b83c9;
  --shadow: 0 1px 2px #1b23330f, 0 4px 12px #1b23330a;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151a24;
    --card: #1d2430;
    --card-hover: #242d3b;
    --text: #e3e8f0;
    --muted: #8f9bb0;
    --border: #2d3746;
    --accent: #3fa06b;
    --accent-text: #101720;
    --accent-hover: #4fb87d;
    --focus: #6f9ae0;
    --shadow: 0 1px 2px #0005, 0 4px 14px #0004;
  }
}

html { color-scheme: light dark; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.page {
  max-width: 46rem;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.page__head { margin-bottom: 2rem; }

h1 {
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.page__sub {
  margin-top: 0.4rem;
  color: var(--muted);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

.empty {
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}

.cards {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: background 0.15s ease;
}

.card:hover { background: var(--card-hover); }

.card__text { flex: 1 1 18rem; min-width: 0; }

.card__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
}

.card__desc {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.card__meta {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.card__meta .dot { margin: 0 0.4rem; opacity: 0.6; }

.card__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 0 0 auto;
}

.copy {
  min-width: 7.5rem;
  padding: 0.6rem 1.1rem;
  font: inherit;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.copy:hover { background: var(--accent-hover); }

.copy.is-done { background: var(--accent-hover); }

.copy.is-failed { background: #b8412a; }

.download {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}

.download:hover { color: var(--text); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.howto {
  margin-top: 2.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}

.howto__title {
  font-size: 1rem;
  font-weight: 600;
}

.howto__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.instance {
  padding: 0.55rem 1rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.instance:hover { background: var(--card-hover); }

.instance__note {
  color: var(--muted);
  font-size: 0.85rem;
}

.instance__note a { color: inherit; }

.instance__note a:hover { color: var(--text); }

.steps {
  margin: 1.1rem 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.steps li { margin-bottom: 0.3rem; }

.steps strong, .steps em { color: var(--text); }

.steps em { font-style: normal; font-weight: 500; }

kbd {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.05rem 0.35rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

/* Off-screen rather than display:none — the execCommand fallback has to be
   able to select the textarea, which requires it to be rendered. */
.clipboard-shim {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.75rem;
  transform: translate(-50%, 1rem);
  padding: 0.6rem 1.1rem;
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
