:root {
  color-scheme: light dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}
body {
  min-height: 100vh;
  margin: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.app {
  width: min(100%, 720px);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  /* padding: 2rem 1.5rem 2.5rem; */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
h1 {
  font-size: 1.8rem;
  margin: 0;
}
fieldset {
  border: 1px solid #8884;
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background-color: #fff;
}
label {
  display: block;
  font-weight: 600;
}
textarea,
input,
button {
  width: 100%;
  font: inherit;
  padding: 0.5rem;
  border-radius: 0.4rem;
  border: 1px solid #7775;
  box-sizing: border-box;
}
textarea {
  resize: vertical;
  min-height: 100px;
}
.button-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.button-row button {
  width: auto;
  flex: 1;
}
textarea,
input,
output,
pre {
  margin-bottom: 0.75rem;
}
.code-editor {
  position: relative;
}
.code-editor textarea {
  margin-bottom: 0;
  padding-right: 5rem;
}
.code-editor pre {
  margin-bottom: 0;
}
.copy-block {
  position: relative;
  margin-bottom: 0.75rem;
}
.copy-block pre,
.copy-block output {
  margin-bottom: 0;
  padding-right: 5rem;
}
button {
  cursor: pointer;
  margin-top: 0.25rem;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
.tab-bar {
  display: inline-flex;
  gap: 0.5rem;
  margin: 0;
}
.tab-btn {
  border: 1px solid #7775;
  border-radius: 999px;
  background: #0001;
  padding: 0.4rem 1.25rem;
  font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}
.tab-btn.active {
  background: #2563eb22;
  border-color: #2563eb55;
}
.tab-panels {
  position: relative;
}
.tab-panel {
  display: block;
}
.tab-panel[hidden] {
  display: none;
}
.row {
  display: grid;
  gap: 1rem;
}
.row.two {
  grid-template-columns: 1fr 1fr;
}
.decode-results {
  border-top: 1px dashed #7774;
  margin-top: 1rem;
  padding-top: 1rem;
}
.decode-results strong {
  display: block;
  margin-bottom: 0.75rem;
}
.encode-results {
  border-top: 1px dashed #7774;
  margin-top: 1rem;
  padding-top: 1rem;
}
.encode-results strong {
  display: block;
  margin-bottom: 0.75rem;
}
pre,
output {
  display: none;
  white-space: pre-wrap;
  word-break: break-word;
  background: #0001;
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px dashed #7774;
  min-height: 3.5rem;
}
pre.visible,
output.visible {
  display: block;
}
.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.6rem;
  margin-top: 0;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid #2563eb55;
  background: #2563eb22;
  color: inherit;
  cursor: pointer;
  width: auto;
  z-index: 1;
}
.copy-btn:active {
  transform: scale(0.98);
}
.error {
  color: #d93025;
  font-weight: 600;
  margin-top: 0.5rem;
}

.site-footer {
  width: min(100%, 720px);
  text-align: center;
  font-size: 0.9rem;
  color: inherit;
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
}
