* {
  box-sizing: border-box;
}

:root {
  --bg-color: #fcfcfc;
  --text-main: #111;
  --text-muted: #666;
  --text-faint: #999;
  --text-ref: black;
  --link-color: #0000EE;
  --border-main: #111;
  --accent-dot: #c9bc38;
  --accent-close: #c99;
  --icon-fill: #aaa;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #222;
    --text-main: #ddd;
    --text-muted: #aaa;
    --text-faint: #777;
    --text-ref: #ddd;
    --link-color: #8ab4f8;
    --border-main: #ddd;
    --accent-dot: #e6db74;
    --accent-close: #e06c75;
    --icon-fill: #777;
  }
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font: 12pt/14pt "Helvetica Neue", Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 1em 5%;
  max-width: 1200px;
}

a:link,
a:visited,
a:active {
  text-decoration: none;
  background-color: transparent;
  color: var(--link-color);
}

#container {
  display: flex;
  flex-direction: row;
  height: 100%;
  position: relative;
}

#selector {
  width: 280px;
  margin-top: 1.5em;
  padding: 10px;
  line-height: 1.55em;
  overflow-y: visible;
  border-right: 1px solid var(--bg-color);
  /* Matches background to prevent visible border by default */
}

#form form {
  position: relative;
}

.noresults #selector {
  margin: 50px auto;
  width: 90%;
}

.noresults #form form {
  margin: 0 auto;
  width: 90%;
  max-width: 600px;
}

.noresults input#search {
  display: block;
  width: 100%;
}

.start {
  margin: 3em 15%;
  width: 70%;
  text-align: center;
  color: var(--text-muted);
}

.results .start {
  display: none;
}

#main {
  flex: 1;
  margin: 1.5em 1em 0 20px;
  padding: 0;
}

#count {
  color: var(--text-faint);
  font-size: 75%;
}

#rfc-list {
  padding-bottom: 6em;
}

ul {
  padding-left: 0.75em;
  list-style-type: none;
}

li {
  line-height: 1.55em;
  text-indent: -4.7em;
  margin-left: 4.7em;
}

li ul {
  margin-left: -0.5em;
}

.noresults #main {
  display: none;
  flex: 0;
}

.noresults .tags {
  width: 60%;
  margin: 0 auto 1em auto;
  text-align: center;
}

@media all and (max-width: 800px) {

  .results .tags,
  .results h2.tags,
  .results #collection,
  .results #stream,
  .results #level,
  .results #wg,
  .results #collection-header,
  .results #stream-header,
  .results #level-header,
  .results #wg-header,
  .results .start em,
  .results .start em+p {
    display: none !important;
  }
}

input#search {
  width: 100%;
  font-size: 18px;
  background-color: var(--bg-color);
  color: var(--text-main);
  border: 1px solid var(--text-faint);
  padding: 2px 25px 2px 10px;
}

.control {
  font-size: 85%;
}

.noresults .control {
  display: none;
}

.tag,
.tag-active {
  display: inline;
  padding: .25em .6em;
  font-size: 75%;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border: 2px;
  border-radius: 5px;
  user-select: none;
  cursor: pointer;
  filter: none;
}

.tag-active {
  border: 1px solid var(--border-main);
}

li .tag {
  margin: 0 0 0 .75em;
}

h1 {
  width: 100%;
  font-size: 300%;
  text-align: center;
  margin: 0 0 1em 0;
  line-height: 1.2em;
  padding-top: 5px;
  cursor: pointer;
  user-select: none;
}

h1 .dot {
  color: var(--accent-dot);
}

h1 .fyi {
  color: var(--text-faint);
}

h2 {
  font-size: 14pt;
}

.mobile-hidden {
  display: none !important;
}

#clearSearch {
  position: absolute;
  font-size: 16px;
  top: 0px;
  right: 4px;
  z-index: 100;
  cursor: pointer;
  user-select: none;
  color: var(--accent-close);
  padding: 2px 6px;
}

.noresults #clearSearch {
  display: none;
}

.footer {
  width: 100%;
  padding: 3px;
  text-align: center;
}

.octicon {
  fill: var(--icon-fill);
}

.reference {
  color: var(--text-ref);
}

.status-obsoleted .reference,
.level-historic .reference {
  text-decoration: line-through;
}

.refcountlink {
  font-size: 75%;
  margin-left: 1em;
  white-space: nowrap;
}

.sort-active {
  font-weight: bold;
  color: var(--text-main);
  text-decoration: none;
  cursor: default;
}

@media all and (max-width: 800px) {
  #container {
    flex-direction: column;
  }

  #main {
    margin: 1em 0;
  }

  #selector,
  .noresults #selector {
    width: 100%;
  }

  .start {
    margin: 2em 0;
    width: 100%;
  }

  .noresults .tags {
    width: 100%;
  }

  .results #selector h2,
  .results #selector div.tags,
  .results #selector .tag,
  .results .tags,
  .results h2.tags,
  .results .start em,
  .results .start em+p,
  .results #collection,
  .results #stream,
  .results #level,
  .results #wg,
  .results #collection-header,
  .results #stream-header,
  .results #level-header,
  .results #wg-header,
  .results p.start {
    display: none !important;
  }

  .noresults #form form {
    width: 100%;
  }

  .noresults input#search {
    display: block;
    width: 100%;
  }

  #sort {
    text-align: center;
  }

  .noresults #clearSearch {
    display: none;
  }

  .results .footer {
    display: none;
  }
}

@media all and (min-width: 800px) {
  #selector {
    position: fixed;
    overflow-y: auto;
    height: 100%;
    border-right: none;
  }

  #selector::-webkit-scrollbar {
    width: 1px;
  }

  #selector::-webkit-scrollbar-track {
    background: transparent;
  }

  #selector::-webkit-scrollbar-thumb {
    background-color: #d1d1d1;
    /* Subtler grey for thumb */
    border-radius: 10px;
  }

  #shadow {
    width: 280px;
    margin-top: 1.5em;
    padding: 0;
  }
}