body {
  background-color: #000;
  color: #e8e8e8;
  font-family: system-ui, Arial, sans-serif;
  margin: 0 auto;
  max-width: 786px;
  padding: 0 20px;
  word-wrap: break-word;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
header {
  text-align: center;
  padding-top: 5px;
}
a {
  color: inherit;
}
audio, video {
  width: 100%;
  margin-bottom: 10px;
}
video {
  background: #252525;
}
.image-preview {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
  border: 1px solid #ddd;
}
#title-container {
  position: relative;
  margin-bottom: 20px;
  box-sizing: border-box;
}
#title h1 {
  margin: 0;
}
#title {
  display: inline-block;
  margin: 0 44px;
  max-width: calc(100% - 88px);
}
#header-category {
  margin: 0px auto;
  letter-spacing: 0.5px;
  padding-bottom: 4px;
  color: #ccc;
  font-weight: bold;
  font-size: smaller;
  text-transform: uppercase;
}
#header-category .sep {
  opacity: 0.4;
  margin: 0 5px;
}
#back-button, #share-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.3s ease;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: #fff;
}
#back-button {
  left: 0;
}
#share-button {
  right: 0;
}
#back-button:hover, #share-button:hover {
  opacity: 0.8;
}
#share-button:focus {
  opacity: 1;
}
#not-found {
  text-align: center;
}
#search-container {
  max-width: 400px;
  margin: -8px auto 0;
  position: relative;
}
#search {
  width: 100%;
  margin: 8px auto 16px;
  padding: 8px 40px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #121212;
  color: inherit;
  font-size: 20px;
  box-sizing: border-box;
  outline: none;
}
#search-icon, #clear-icon {
  position: absolute;
  margin: auto 0;
  z-index: 2;
}
#search-icon {
  left: 12px;
  width: 18.75px;
  top: 7px;
  bottom: 12.5px;
}
#clear-icon {
  right: 12px;
  font-size: 32px;
  line-height: 20px;
  top: 0;
  bottom: 0;
  height: 32px;
  cursor: pointer;
}
#categories {
  text-align: center;
  margin-bottom: 15px;
}
#categories a {
  display: inline-block;
  background-color: #121212;
  margin: 5px;
  border: 1px solid #444;
  padding: 8px;
  border-radius: 8px;
}
#categories a.chosen-category {
  background-color: #e8e8e8;
  color: #000;
}
.card, .card-md {
  background-color: #121212;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
  border: 1px solid #252525;
}
.card h2, .card-md h2 {
  margin: 0;
}
.read-more, #title, #categories a {
  text-decoration: none;
}
.read-more:hover {
  text-decoration: underline;
}
.category {
  color: #ccc;
  font-weight: bold;
  font-size: smaller;
}
pre, code {
  white-space: pre-wrap;
}
#content p {
  margin-top: 0;
}
#content a {
  word-break: break-all; /* For long URLs */
}
#content blockquote {
  border-left: 4px solid purple;
  padding-left: 15px;
  margin: 10px 0;
}
#content ol, #content ul {
  padding-left: 15px;
  margin: 0 0 1em 0;
}
#content table {
  margin-bottom: 1em;
}
#content ol ol {
  padding-left: 20px;
}
#content img {
  max-width: 100%;
}
.results-summary, .partial-heading {
  color: #ccc;
}
.partial-heading {
  font-style: italic;
  margin: 40px 0 10px;
}
.result-title, .result-text {
  text-decoration: none;
}
.result-text {
  display: block;
  margin-top: 10px;
}
#remove-highlights {
  position: fixed;
  bottom: 28px;
  left: 10px;
  cursor: pointer;
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  padding: .48rem 1rem;
  border: 0;
  border-radius: 9999px;
  background-color: #303030;
  color: #e8e8e8;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  user-select: none;
  -webkit-user-select: none;
}
#remove-highlights .x {
  width: 18px;
  height: 18px;
  margin-right: .45rem;
  text-align: center;
  line-height: 18px;
  font-size: .8rem;
  font-weight: 400;
  border-radius: 50%;
  background-color: #505050;
}
#remove-highlights:hover {
  background-color: #262626;
}
#search.search-error {
  background-color: #1f1209;
  border-color: #8c5835;
  color: #d6bba7;
  cursor: pointer;
}
.search-error::placeholder {
  color: #d6bba7;
}
#footer {
  text-align: center;
}

/* LIGHT MODE */
@media (prefers-color-scheme: light) {
  body { background-color: #fff; color: #000; }

  mark { background-color: #fef08a;}

  #back-button, #share-button { color: #000; }

  #search { background-color: #f7f7f7; border-color: #ccc; }
  #search::placeholder { color: #757575; }
  #categories a { background-color: #f7f7f7; border-color: #ccc; }
  #categories a.chosen-category { background-color: #000; color: #fff; }

  .card, .card-md { background-color: #fdfdfd; border-color: #e9e9e9; }
  .category, .article-meta { color: #555; }

  #content blockquote { color: #555; }

  .results-summary, .partial-heading { color: #555; }

  #remove-highlights { background-color: #e0e0e0; color: #000; }
  #remove-highlights .x { background-color: #c9c9c9; }
  #remove-highlights:hover { background-color: #d5d5d5; }

  #search.search-error { background-color: #fff8f2; border-color: #e0c0a0; color: #8a5a30; }
  .search-error::placeholder { color: #8a5a30; }
}