:root {
  color-scheme: light dark;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  --background: #ffffff;
  --foreground: #111111;
  --muted: #555555;
  --error: #a00000;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #111111;
    --foreground: #eeeeee;
    --muted: #bbbbbb;
    --error: #ff9a9a;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #111111;
  --muted: #555555;
  --error: #a00000;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #111111;
  --foreground: #eeeeee;
  --muted: #bbbbbb;
  --error: #ff9a9a;
}

body {
  color: var(--foreground);
  background: var(--background);
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem;
}

a {
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

header,
main,
form,
fieldset {
  margin-block: 1rem;
}

nav a {
  margin-inline-end: 1rem;
}

.header-bar,
.header-actions {
  align-items: center;
  display: flex;
}

.header-bar {
  gap: 1rem;
  justify-content: space-between;
}

.header-actions {
  flex-shrink: 0;
  gap: 0.5rem;
  margin-inline-start: auto;
}

.inline-form {
  display: inline-block;
  margin-inline-end: 1rem;
}

.header-actions .inline-form {
  margin: 0;
}

input,
textarea,
button,
select {
  font: inherit;
}

input:not([type="checkbox"], [type="radio"]),
textarea {
  box-sizing: border-box;
  display: block;
  max-width: 100%;
  width: 42rem;
}

.description {
  max-width: 70ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.api-key-value {
  max-width: 70ch;
  overflow-wrap: anywhere;
}

.bookmark-url,
small,
.collection-count {
  color: var(--muted);
}

.bookmark-url a {
  color: inherit;
}

.bookmark-meta {
  font-size: 0.875rem;
}

.collection-count {
  font-size: 0.65em;
  font-weight: normal;
}

.bookmarklet-heading {
  font-size: 1.5rem;
}

.bookmarks h2 {
  font-size: 1.15rem;
  line-height: 1.35;
  margin-block-end: 0.25rem;
}

.error {
  color: var(--error);
  display: block;
}

.pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  list-style: none;
  padding: 0;
}

textarea {
  min-height: 10rem;
}

:focus-visible {
  outline: 0.2rem solid currentColor;
  outline-offset: 0.15rem;
}

@media (max-width: 40rem) {
  body {
    padding: 0.75rem;
  }

  nav a {
    display: block;
    margin-block: 0.5rem;
  }

  .header-bar {
    align-items: flex-start;
  }
}
