[x-cloak] {
  display: none !important;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.2;
  color: black;
}

header {
  display: flex;
  gap: 16px;
  padding: 16px 32px;
  align-items: center;
  border-bottom: 1px solid #eee;
}

header > h1 a {
    display: block;
    width: 32px;
    height: 32px;
    background-image: url("../images/logo.svg");
    background-repeat: no-repeat;
    background-size: 100%;
    overflow: hidden;
    text-indent: -999px;
}

header .search {
    display: flex;
    flex-grow: 1;
    align-items: flex-end;
}

header .search input {
    position: relative;
    padding: 8px 16px 8px 32px;
    width: 256px;
    border-radius: 16px;
    background-image: url("../images/magnifyingglass.svg");
    background-repeat: no-repeat;
    background-size: 16px 16px;
    background-position: 8px center;
}

section {
    margin: 0 auto;
    padding: 16px 32px 16px 80px;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h4 {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    opacity: 0.3;
    text-transform: uppercase;
}

strong {
    font-weight: 550;
}

nav {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.links {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

a {
  color: inherit;
  text-decoration: none;
}

h1 a {
  text-decoration: none;
}

.muted {
    opacity: 0.4;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #555;
}

input,
textarea {
  font: inherit;
  padding: 8px 12px;
  background: transparent;
  border: none;
  background: #eee;
  border-radius: 8px;
  color: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #ddd;
}

button[type="submit"] {
  align-self: flex-start;
  font: inherit;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: black;
  color: white;
  cursor: pointer;
}

button[type="submit"]:disabled,
input:disabled {
  opacity: 0.5;
  cursor: default;
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: baseline;
}

button.link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
}

/* Mast */

.mast {
  display: flex;
  gap: 16px;
  align-items: center;
}

.mast h2,
.mast h3 {
    margin: 0;
    font-size: inherit;
}

.mast h3 {
    font-size: 12px;
    font-weight: inherit;
}

.mast small {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.4;
}

.mast .picture {
  object-fit: cover;
  display: block;
  margin-left: -48px;
}

/* Misc */

.picture {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.picture-empty {
  background: #e4e4df;
}

.picture-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.upload {
  color: #1a1a1a;
  text-decoration: underline;
  cursor: pointer;
}

.upload input[type="file"] {
  display: none;
}

.search-page {
    padding: 16px 32px;
}

.search-page h2 {
    margin-bottom: 1rem;
}

.search-page .book-list {
    margin: 1rem 0;
}

.search-page .wider,
.search-page .manual-add {
    margin-top: 1.5rem;
}

.search-page form {
    max-width: 400px;
}

.usage-page {
    padding: 16px 32px;
}

.usage-table {
    margin-top: 1rem;
    border-collapse: collapse;
    width: 100%;
}

.usage-table th,
.usage-table td {
    padding: 6px 12px 6px 0;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.usage-table th {
    font-size: 12px;
    font-weight: 400;
    color: #777;
}

.usage-table .num {
    text-align: right;
}

.book-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.book-title {
    margin-right: 4px;
    font-weight: 550;
}

.book .link {
    font-size: 12px;
    opacity: 0.4;
}

.byline {
  color: #555;
  margin-top: 0.25rem;
}

.picture-small {
  width: 2rem;
  height: 2rem;
}

.reader-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.reader {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.typeahead {
  position: relative;
  display: block;
}

.typeahead input {
  width: 100%;
  box-sizing: border-box;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin-top: 0.25rem;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.suggestions li {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  cursor: pointer;
  color: #1a1a1a;
}

.suggestions li:hover,
.suggestions li.active {
  background: #f0f0eb;
}

.suggestion-detail {
  color: #777;
  font-size: 0.8125rem;
}

.error {
  color: #b3261e;
  margin-bottom: 1rem;
}

.saved {
  color: #2e7d32;
  font-size: 0.875rem;
}

/* Guide */

.guide {
  max-width: 65ch;
}

.guide p {
  margin-bottom: 1em;
}

.guide audio {
  width: 100%;
  margin-bottom: 1.5em;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-list .link:disabled {
  opacity: 0.4;
  cursor: default;
}
