:root {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: #243832;
  background: #f6f4ef;
  line-height: 1.75;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  position: sticky;
  top: 0;
  background: #f6f4eff5;
  border-bottom: 1px solid #ddd;
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px max(20px, env(safe-area-inset-left));
  z-index: 2;
}
header a {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}
#status {
  flex: 1;
  font-size: 13px;
  color: #64756e;
}
main {
  max-width: 820px;
  margin: auto;
  padding: 24px 20px 100px;
}
h1 {
  line-height: 1.4;
  font-size: 28px;
}
button,
input,
textarea {
  font: inherit;
}
button {
  border: 1px solid #c8d2ca;
  background: #fff;
  border-radius: 9px;
  color: #245d4e;
  padding: 8px 12px;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
}
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}
input {
  width: 100%;
  padding: 12px;
  border: 1px solid #c8d2ca;
  border-radius: 10px;
  background: #fff;
}
#list button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #dce2db;
  border-radius: 0;
  background: none;
  padding: 20px 0;
  color: inherit;
}
#list small {
  display: block;
  color: #758079;
  margin-top: 5px;
}
.muted {
  color: #758079;
}
article {
  font-size: 18px;
  overflow-wrap: anywhere;
  margin-top: 28px;
}
article img,
article video {
  max-width: 100%;
  height: auto;
}
article pre {
  overflow: auto;
}
article a {
  color: #245d4e;
}
textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border: 1px solid #c8d2ca;
  border-radius: 10px;
  background: #fff;
  resize: vertical;
}
#noteStatus {
  font-size: 14px;
}
.notes {
  margin-top: 50px;
  border-top: 1px solid #ccd5cd;
  padding-top: 20px;
}
#error,
#conflict {
  color: #923d28;
}
#otherNote {
  white-space: pre-wrap;
  background: #fff0e6;
  padding: 15px;
}
body:has(#reading:not([hidden])) #library {
  display: none;
}
[hidden] {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root {
    background: #18221f;
    color: #e6e9e4;
  }
  header {
    background: #18221ff5;
  }
  button,
  input,
  textarea {
    background: #24312b;
    color: #e6e9e4;
  }
  #otherNote {
    background: #392b21;
  }
}
