@font-face {
  font-family: JetBrainsMono;
  src: url(JetBrainsMono-Regular.z57Ci.woff2);
}

@font-face {
  font-family: JetBrainsMono;
  src: url(JetBrainsMono-Bold.ChfiO.woff2);
  font-weight: bold;
}

*,
.cm-editor .cm-gutters,
.cm-editor .cm-lineNumbers,
.cm-editor .cm-content {
  font-family: JetBrainsMono;
  outline: none;
  border: none;
  background: none;
  margin: 0;
  padding: 0;
}

#editor {
  overflow-y: auto;
}

#editor,
.cm-editor,
.cm-editor .cm-scroller {
  flex-grow: 1;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.cm-editor.cm-focused {
  outline: none;
}

.cm-editor .cm-lineNumbers .cm-gutterElement {
  padding: 0 0 0 0.5rem;
  min-width: 0;
  color: rgba(0, 32, 64, 0.3);
}

.cm-editor .cm-lineNumbers .cm-activeLineGutter {
  color: rgba(0, 32, 64, 0.7);
  background-color: rgba(0, 32, 64, 0.07);
}

.cm-editor .cm-content .cm-activeLine {
  background-color: rgba(0, 32, 64, 0.07);
}

.cm-editor .cm-content .cm-line {
  padding: 0 1rem;
}

.cm-editor .cm-content {
  align-self: stretch;
  padding: 1rem 0 50vh 0;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

body:not([data-show]) {
  visibility: hidden;
}

#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgb(0, 32, 64);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  visibility: visible;
}

#auth-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 18rem;
}

#auth-title {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.25rem;
  font-weight: bold;
  text-align: center;
}

#auth-input {
  padding: 0.6rem 0.75rem;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-bottom: 2px solid rgba(255, 255, 255, 0.3) !important;
}

#auth-input:focus {
  border-bottom: 2px solid rgba(255, 255, 255, 0.8) !important;
}

#auth-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

#auth-error {
  color: rgba(255, 100, 100, 0.9);
  font-size: 0.875rem;
  text-align: center;
  min-height: 1.25rem;
}

#auth-submit {
  padding: 0.6rem;
  font-size: 1rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
  transition: background 0.2s;
}

#auth-submit:hover {
  background: rgba(255, 255, 255, 0.25);
}

#auth-submit:active {
  background: rgba(255, 255, 255, 0.1);
}

header {
  position: relative;
  z-index: 1;
}

header::after {
  content: "";
  position: absolute;
  left: 0;
  top: 100%;
  width: 100%;
  height: 0.5rem;
  background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.025), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: 0.5s;
  pointer-events: none;
}

.scrolled header::after {
  opacity: 1;
}

h1 {
  padding: 0.5rem;
  color: rgb(0, 64, 128);
  font-size: 2rem;
  text-align: center;
}

#resultRow {
  display: flex;
  background-color: rgba(0, 32, 64, 0.1);
  overflow: hidden;
}

#result {
  width: 0;
  flex: 1;
  padding: 0.5rem;
  font-size: 0.875rem;
}

#resultRow button {
  width: 5rem;
  font-size: 1rem;
  font-weight: bold;
  padding: 0.5rem;
  background-color: rgba(0, 32, 64, 0.17);
  transition: 0.5s cubic-bezier(0, 0, 0, 1);
  transition-property: width, background-color;
}

#resultRow button:active {
  background-color: rgba(0, 32, 64, 0.07);
}

#filterRow {
  display: flex;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  background-color: rgba(0, 32, 64, 0.05);
  flex-wrap: wrap;
}

#filterRow button {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  background-color: rgba(0, 32, 64, 0.1);
  border-radius: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#filterRow button:hover {
  background-color: rgba(0, 32, 64, 0.2);
}

#filterRow button:active {
  background-color: rgba(0, 32, 64, 0.1);
}

#filterRow button.active {
  background-color: rgb(0, 64, 128);
  color: white;
}

#save {
  margin-left: auto;
  background-color: rgba(0, 100, 0, 0.15);
}

#save:hover {
  background-color: rgba(0, 100, 0, 0.28);
}

#save.saved {
  background-color: rgba(0, 130, 0, 0.35);
}

#save.saved::after {
  content: " ✔";
  color: green;
}

#copy.pending,
#copy.success,
#copy.error {
  background-color: rgba(0, 32, 64, 0.07);
  width: 7rem;
}

#copy.pending::after {
  content: " ✔";
}

#copy.success::after {
  content: " ✔";
  color: green;
}

#copy.error::after {
  content: " ✘";
  color: red;
}

#shorten.pending,
#shorten.success,
#shorten.error {
  background-color: rgba(0, 32, 64, 0.07);
  width: 7rem;
}

#shorten.pending::after {
  content: " …";
}

#shorten.success::after {
  content: " ✔";
  color: green;
}

#shorten.error::after {
  content: " ✘";
  color: red;
}
