* {
  box-sizing: border-box;
}
:root {
  color-scheme: light;
  --ink: #202638;
  --mute: #626a7b;
  --blue: #354fc0;
  --blue-dark: #273d9e;
  --tint: #e9edfc;
  --line: #dfe3ec;
  --wash: #f6f7fb;
  --paper: #fff;
  --sans: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Iowan Old Style", Georgia, "Times New Roman", serif;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
button,
input,
textarea {
  outline-offset: 3px;
}
:focus-visible {
  outline: 2px solid var(--blue);
}
svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  vertical-align: middle;
}
.primary,
.secondary,
.danger,
.quiet,
.chip,
.icon,
.navitem,
.newlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-weight: 600;
}
.primary,
.secondary,
.danger {
  min-height: 44px;
  padding: 0.62rem 1.15rem;
  border-radius: 10px;
  font-size: 0.94rem;
}
.primary {
  color: white;
  background: var(--blue);
}
.primary:hover {
  background: var(--blue-dark);
}
.secondary {
  background: var(--wash);
  border: 1px solid var(--line);
}
.danger {
  color: #a7353c;
  background: #faebed;
}
.icon {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 9px;
  color: var(--mute);
}
.icon:hover,
.quiet:hover {
  background: #e8eaf1;
  color: var(--ink);
}
.quiet {
  min-height: 44px;
  border-radius: 9px;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
  color: var(--mute);
  justify-content: flex-start;
}
#sidebar {
  width: 256px;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--wash);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 36px 18px 22px;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 0 8px;
}
.brand img {
  width: 42px;
  height: 42px;
}
.brand strong,
.mobilebrand {
  font-family: var(--serif);
  font-size: 1.75rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}
.brand small {
  display: block;
  color: var(--mute);
  font-size: 0.8rem;
  margin-top: 3px;
}
.brand #closemenu {
  display: none;
  margin-left: auto;
}
#new-note {
  margin: 34px 4px 23px;
  justify-content: flex-start;
  padding-left: 16px;
}
#sidebar nav {
  overflow-y: auto;
  flex: 1;
}
.navitem {
  width: 100%;
  min-height: 44px;
  justify-content: flex-start;
  padding: 8px 11px;
  text-align: left;
  border-radius: 9px;
  color: #424a5d;
  font-size: 0.93rem;
  font-weight: 500;
  gap: 11px;
}
.navitem:hover {
  background: #eceef5;
}
.navitem[aria-current="page"] {
  background: #e1e6fa;
  color: #283f9f;
  font-weight: 650;
}
.navitem span,
.chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.navitem small {
  font-size: 0.77rem;
  line-height: 1.4;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  color: var(--mute);
}
.folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 27px 2px 6px 12px;
}
.folder-head h2,
.eyebrow,
.group-head {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.085em;
  text-transform: uppercase;
}
.folder-head h2 {
  color: var(--mute);
  margin: 0;
}
.folder-head .icon {
  width: 36px;
  height: 36px;
}
.folder-tip {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--mute);
  padding: 0 12px;
}
.account {
  padding: 16px 3px 0;
  border-top: 1px solid var(--line);
  margin-top: 20px;
}
#main {
  margin-left: 256px;
  padding: clamp(34px, 6.7vh, 80px) clamp(28px, 5.1vw, 96px) 48px;
  min-height: 100vh;
}
#library,
#editor {
  max-width: 1120px;
  margin: 0 auto;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--blue);
}
.book-mark {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
}
.view-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 24px;
}
.view-head h1,
.loginbox h1 {
  font: 500 clamp(2.5rem, 4.2vw, 4.4rem) / 1.08 var(--serif);
  letter-spacing: -0.045em;
  margin: 0;
  overflow-wrap: anywhere;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--wash);
  color: var(--mute);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  width: min(370px, 100%);
  height: 44px;
}
.search:focus-within {
  outline: 2px solid #7586d2;
  outline-offset: 1px;
}
.search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
}
.search input::placeholder {
  color: var(--mute);
}
kbd {
  border: 1px solid var(--line);
  color: #72798b;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 0.8rem;
  background: #fff;
}
#view-count {
  font-size: 0.88rem;
  color: var(--mute);
  white-space: nowrap;
}
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--mute);
  margin: 26px 0 12px;
}
.group-head svg {
  width: 16px;
  height: 16px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 238px), 1fr));
  gap: 14px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 20px 20px 16px;
  min-height: 172px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  min-width: 0;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.card:hover {
  border-color: #aab5e0;
  background: #fafbff;
}
.card .open-note {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.card .card-move {
  position: absolute;
  right: 6px;
  top: 6px;
  color: #646f8b;
  z-index: 1;
}
.card .card-move svg {
  width: 16px;
  height: 16px;
}
.card .doc {
  color: var(--blue);
  margin-bottom: 13px;
  width: 19px;
  height: 19px;
}
.card h3 {
  font: 600 1.25rem/1.3 var(--serif);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card p {
  margin: 5px 0 16px;
  font-size: 0.93rem;
  line-height: 1.45;
  color: var(--mute);
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: pre-line;
}
.meta {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  font-size: 0.77rem;
  color: var(--mute);
}
.meta span:first-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.meta time {
  white-space: nowrap;
}
.meta svg {
  width: 13px;
  height: 13px;
  margin-right: 4px;
}
.empty {
  margin-top: 24px;
  padding: clamp(30px, 5vw, 70px) 20px;
  min-height: 310px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  border: 1px solid #e1e5f1;
  border-radius: 18px;
  background:
    radial-gradient(#d5daeb 0.8px, transparent 1px) 0 0/14px 14px,
    #f6f7fc;
}
.empty svg.art {
  width: 145px;
  height: 104px;
  filter: drop-shadow(0 5px 5px #27314b13);
}
.empty h2 {
  font: 500 clamp(1.65rem, 2.4vw, 2.2rem) / 1.15 var(--serif);
  letter-spacing: -0.035em;
  margin: 22px 0 8px;
}
.empty p {
  color: #535d72;
  margin: 0 0 13px;
  max-width: 360px;
}
.newlink {
  color: var(--blue);
  min-height: 44px;
}
.newlink:hover {
  text-decoration: underline;
}
.editor-tools,
.paper-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.editor-tools {
  margin-bottom: 20px;
}
.editor-tools .quiet {
  margin-left: -9px;
}
#save-status {
  font-size: 0.84rem;
  color: var(--mute);
}
.paper {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(18px, 4vw, 52px);
  min-height: 65vh;
  display: flex;
  flex-direction: column;
}
.chip {
  min-height: 40px;
  padding: 5px 12px;
  color: #354478;
  border-radius: 8px;
  background: var(--tint);
  max-width: 80%;
  font-size: 0.86rem;
}
.chip svg {
  width: 16px;
  height: 16px;
}
#title,
#body {
  border: 0;
  background: transparent;
  width: 100%;
  padding: 0;
  outline: none;
}
#title {
  font: 500 clamp(1.9rem, 3.8vw, 3.6rem) / 1.2 var(--serif);
  letter-spacing: -0.035em;
  margin: 28px 0 20px;
}
#title::placeholder {
  color: #8a91a1;
}
#body {
  min-height: 42vh;
  line-height: 1.72;
  font-size: 1.09rem;
  flex: 1;
}
#body {
  min-width: 0;
  cursor: text;
}
.paper {
  min-width: 0;
}
.insert-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0;
  margin-bottom: 12px;
  border-block: 1px solid var(--line);
}
.insert-tools button {
  min-height: 44px;
  padding: 6px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-dark);
  border-radius: 8px;
}
.insert-tools button:hover {
  background: var(--tint);
}
.text-block {
  width: 100%;
  min-width: 0;
  display: block;
  min-height: 1.75em;
  line-height: 1.72;
  font: inherit;
  border: 0;
  background: transparent;
  padding: 0;
  resize: none;
  overflow: hidden;
}
.text-block:focus {
  outline: none;
}
.text-block::placeholder {
  color: #737b8a;
}
/* Keep the editable textarea and the marked verse on the same writing surface. */
.text-region {
  position: relative;
  min-width: 0;
}
.lyric-lines {
  display: none;
}
.song-mode {
  --gutter: 3.2em;
}
.song-mode .text-region {
  padding-left: var(--gutter);
}
.song-mode .lyric-lines,
.song-mode .text-block {
  font: inherit;
  letter-spacing: inherit;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  tab-size: 8;
  text-align: start;
  font-variant-ligatures: none;
}
.song-mode .lyric-lines {
  display: block;
  pointer-events: none;
  user-select: none;
}
.lyric-line {
  position: relative;
  min-height: 1lh;
}
.lyric-line::before {
  content: attr(data-count);
  position: absolute;
  top: 0;
  right: calc(100% + 0.7em);
  width: 3.2ch;
  text-align: right;
  color: var(--mute);
  font-size: 0.8em;
  line-height: inherit;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.song-mode .text-region::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--gutter) - 0.55em);
  border-left: 1px solid var(--line);
  pointer-events: none;
}
.song-mode .text-block {
  position: absolute;
  top: 0;
  left: var(--gutter);
  width: calc(100% - var(--gutter));
  height: 100%;
  min-height: 0;
  margin: 0;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--ink);
}
.song-mode .text-block::placeholder {
  color: var(--mute);
  -webkit-text-fill-color: var(--mute);
}
.song-mode .text-block::selection {
  background: rgba(95, 129, 231, 0.23);
  color: transparent;
}
.copy-buffer {
  position: fixed;
  top: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
}
.rhythm-panel {
  background: #f6f7fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 16px;
}
.rhythm-panel h2 {
  font-size: 0.94rem;
  font-weight: 650;
  margin: 0 0 8px;
}
.meter-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.meter-choices button {
  min-height: 44px;
  padding: 6px 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.meter-choices button[aria-pressed="true"] {
  border-color: var(--blue);
  background: var(--tint);
  color: var(--blue-dark);
  font-weight: 650;
}
.foot {
  color: var(--mute);
  font-size: 0.8em;
  letter-spacing: 0.03em;
}
.rhythm-key {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--mute);
  font-size: 0.81rem;
  margin-top: 5px;
}
.rhythm-key .quiet {
  font-size: 0.82rem;
  padding: 0 6px;
}
#placement {
  position: sticky;
  top: 8px;
  z-index: 2;
  background: #edf0ff;
  border: 1px solid #aeb9e9;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px 8px;
  flex-wrap: wrap;
  box-shadow: 0 3px 12px #253c7c16;
}
#placement-hint {
  flex: 1 1 11rem;
  font-size: 0.9rem;
}
.choosing-position .text-region {
  outline: 1px dashed #afbade;
  outline-offset: 1px;
  border-radius: 4px;
}
.choosing-position .text-region:focus-within {
  outline: 2px solid var(--blue);
}
.media-block.move-source {
  outline: 2px solid var(--blue);
}
.media-block figcaption .quiet + .quiet {
  margin-left: 0;
}
@media (max-width: 780px) {
  #placement {
    top: 60px;
  }
  .song-mode {
    --gutter: 2.55em;
  }
}
@media (max-width: 480px) {
  .rhythm-panel {
    padding: 9px;
  }
  .meter-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }
  .meter-choices button {
    flex-direction: column;
    gap: 0;
    padding: 4px 2px;
    font-size: 0.82rem;
  }
  .foot {
    line-height: 1;
  }
  #placement-hint {
    flex-basis: 100%;
  }
}
.media-block {
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--wash);
  min-width: 0;
  cursor: default;
}
.media-block img,
.media-block video {
  display: block;
  height: auto;
  max-width: 100%;
  border-radius: 6px;
}
.media-block video {
  max-height: 72vh;
  background: #151922;
}
.media-block audio {
  display: block;
  width: min(100%, 520px);
}
.media-block figcaption,
.media-pending,
.voice-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.media-block figcaption {
  margin-top: 5px;
  font-size: 0.87rem;
  color: var(--mute);
}
.media-block figcaption a {
  flex: 1 1 7rem;
  min-width: 0;
  color: inherit;
  overflow-wrap: anywhere;
}
.media-block figcaption .quiet {
  margin-left: auto;
}
.media-size {
  display: flex;
  align-items: center;
  gap: 6px;
}
.media-size input {
  width: clamp(72px, 12vw, 140px);
  min-height: 44px;
  accent-color: var(--blue);
}
.media-size output {
  min-width: 3em;
  font-variant-numeric: tabular-nums;
}
.media-pending span,
.voice-panel span {
  overflow-wrap: anywhere;
  flex: 1 1 130px;
}
.voice-panel {
  gap: 8px;
}
.loginbox .voice-panel span {
  flex-basis: 100%;
}
@media (max-width: 480px) {
  .insert-tools {
    gap: 0;
  }
  .insert-tools button {
    padding: 6px 7px;
    font-size: 0.86rem;
  }
  .media-block figcaption a {
    flex-basis: 100%;
  }
}
#recovery {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
dialog {
  border: none;
  border-radius: 16px;
  padding: 24px;
  width: min(420px, calc(100% - 28px));
  color: var(--ink);
  box-shadow: 0 18px 68px #20263838;
  max-height: 85dvh;
}
dialog::backdrop {
  background: #1b24435c;
}
dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
dialog header h2 {
  margin: 0;
  font: 500 1.7rem/1.15 var(--serif);
  letter-spacing: -0.03em;
}
dialog header .icon {
  margin-right: -8px;
}
#modal-content {
  margin: 16px 0;
}
#modal-content p {
  color: var(--mute);
  margin: 8px 0;
}
#modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
.field,
.loginbox input {
  display: block;
  border: 1px solid #c8cedb;
  border-radius: 9px;
  height: 46px;
  padding: 8px 12px;
  width: 100%;
  margin: 7px 0 16px;
}
.field-label,
.loginbox label {
  font-size: 0.9rem;
  font-weight: 600;
}
.folderchoice {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  min-height: 46px;
  text-align: left;
  overflow-wrap: anywhere;
}
.folderchoice:hover,
.folderchoice.selected {
  background: var(--tint);
}
.folderchoice svg:last-child:not(:first-child) {
  margin-left: auto;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-radius: 10px;
  max-width: 90vw;
  width: max-content;
  background: #202638;
  color: #fff;
  padding: 11px 18px;
  box-shadow: 0 8px 24px #15192c30;
  z-index: 20;
  font-size: 0.93rem;
}
.drop {
  outline: 2px dashed var(--blue);
  outline-offset: -2px;
}
#modal-error,
#error {
  color: #a02733;
  font-size: 0.9rem;
}
.muted {
  color: var(--mute);
}
.mobilebar,
#shade {
  display: none;
}
.loginpage {
  min-height: 100dvh;
  background: var(--wash);
  display: grid;
  place-items: center;
  padding: 20px;
}
.loginbox {
  width: min(100%, 420px);
  padding: 34px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.loginbox img {
  width: 48px;
  height: 48px;
  margin-bottom: 26px;
}
.loginbox h1 {
  font-size: 2.8rem;
  margin: 10px 0 28px;
}
.loginbox .primary {
  width: 100%;
}
#error:empty {
  display: none;
}
@media (max-width: 780px) {
  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 58px;
    padding: 0 12px;
    border-bottom: 1px solid var(--line);
    background: #fffffff5;
  }
  .mobilebrand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.45rem;
    font-weight: bold;
  }
  .mobilebrand img {
    width: 28px;
    height: 28px;
  }
  .add {
    color: var(--blue);
  }
  #sidebar {
    width: min(295px, 86vw);
    transform: translateX(-100%);
    visibility: hidden;
    padding-top: 22px;
  }
  body.drawer #sidebar {
    transform: translateX(0);
    visibility: visible;
  }
  .brand #closemenu {
    display: flex;
  }
  .drawer #shade {
    display: block;
    position: fixed;
    inset: 0;
    background: #18203956;
    z-index: 4;
  }
  .drawer {
    overflow: hidden;
  }
  #main {
    margin-left: 0;
    padding: 27px max(16px, 4.5vw) 34px;
    min-height: calc(100dvh - 58px);
  }
  .view-head {
    margin: 9px 0 20px;
  }
  .toolbar {
    padding-bottom: 18px;
  }
  .search {
    max-width: 320px;
  }
  kbd {
    display: none;
  }
  .empty {
    margin-top: 18px;
    min-height: 290px;
  }
  .empty .art {
    max-width: 120px;
  }
  .paper {
    padding: 18px 14px;
    min-height: 65dvh;
  }
  .editor-tools {
    margin-bottom: 8px;
  }
  #title {
    margin: 20px 0 12px;
  }
  #body {
    min-height: 45dvh;
  }
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  }
  .card {
    min-height: 150px;
  }
  .account {
    padding-bottom: env(safe-area-inset-bottom);
  }
  .group-head {
    margin-top: 20px;
  }
  .icon,
  .folder-head .icon {
    min-width: 44px;
    min-height: 44px;
  }
}
@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }
  .card {
    padding: 14px 16px 12px;
    min-height: 112px;
  }
  .card .doc {
    display: none;
  }
  .card h3 {
    margin-right: 35px;
  }
  .card p {
    margin-bottom: 10px;
  }
  .card .card-move {
    top: 0;
    right: 2px;
  }
  #view-count {
    font-size: 0.8rem;
  }
  .loginbox {
    padding: 26px;
  }
}
