@font-face {
  font-family: InkTypeSerif;
  src: url('/writing.ttf') format('truetype');
  font-display: swap;
}
:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #17191b;
  background: #fff;
  font-size: 14px;
  --line: #e6e8e9;
  --muted: #70757a;
  --soft: #f7f8f8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #333;
  outline-offset: 4px;
}
button {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  padding: 9px 14px;
}
button:hover:not(:disabled) {
  background: var(--soft);
}
a {
  color: inherit;
}
.quiet {
  border-color: transparent;
  background: transparent;
}
.primary {
  background: #202326;
  color: white;
  border-color: #202326;
  padding: 12px 21px;
}
.primary:hover:not(:disabled) {
  background: #3a3e41;
}
.secondary {
  border-color: #c9cccf;
}
.hint,
.small {
  color: var(--muted);
  line-height: 1.65;
}
.small {
  font-size: 12px;
}
.topbar {
  height: 76px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 30px;
  gap: 20px;
}
.wordmark {
  font-family: Georgia, serif;
  font-size: 28px;
  text-decoration: none;
  letter-spacing: -1.2px;
  white-space: nowrap;
}
.brand-dot {
  padding-left: 2px;
}
.top-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}
.workspace {
  display: flex;
  flex: 1;
  min-height: 0;
}
.library {
  width: 252px;
  flex-shrink: 0;
  background: #fafafa;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 25px 18px 20px;
  gap: 15px;
}
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 7px;
  color: var(--muted);
  font-size: 12px;
}
.library-heading button {
  font-size: 22px;
  padding: 0 8px;
}
#search {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  padding: 10px 12px;
  font-size: 12px;
}
#drafts {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.draft-row {
  display: block;
  width: 100%;
  border: 1px solid transparent;
  text-align: left;
  margin-bottom: 7px;
  padding: 12px 13px;
  background: transparent;
}
.draft-row[aria-current='true'] {
  background: #fff;
  border-color: var(--line);
}
.draft-row strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 13px;
}
.draft-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}
.import {
  font-size: 12px;
  text-align: left;
}
.library-note {
  border-top: 1px solid var(--line);
  padding: 18px 8px 0;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}
#empty-library {
  font-size: 12px;
  padding: 0 8px;
}
main {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  overflow: auto;
}
.welcome {
  margin: auto;
  padding: 60px 40px 90px;
  max-width: 650px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
}
h1 {
  font-family: InkTypeSerif, Georgia, serif;
  font-size: clamp(44px, 5vw, 68px);
  font-weight: 400;
  line-height: 1.07;
  letter-spacing: -1.5px;
  margin: 27px 0 22px;
}
.welcome > p:not(.small) {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 27px;
}
.welcome .small {
  margin-top: 18px;
}
.manuscript {
  width: min(100%, 900px);
  max-width: 900px;
  min-width: 0;
  margin: 0 auto;
  padding: 58px clamp(24px, 5vw, 75px) 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
}
.draft-title {
  width: 100%;
  border: 0;
  padding: 0 0 25px;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  outline-offset: 6px;
}
#editor {
  display: block;
  width: 100%;
  min-height: 350px;
  flex: 1;
  border: 0;
  resize: none;
  background: transparent;
  padding: 0 0 80px;
  font-family: InkTypeSerif, Georgia, serif;
  font-size: 24px;
  line-height: 1.65;
  outline: none;
}
#editor:focus-visible {
  outline: none;
}
#editor::placeholder {
  color: #b4b7b9;
}
.footer {
  min-height: 54px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 22px;
  font-size: 11px;
  flex-wrap: wrap;
}
.footer button,
.footer select {
  font-size: 11px;
  padding: 7px 8px;
}
.save-group,
.editor-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.save-group {
  min-width: 0;
}
.save-group > span {
  color: var(--muted);
  max-width: 390px;
}
.editor-actions select {
  border: 0;
  background: transparent;
  max-width: 112px;
}
.recovery {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  background: #fff3dd;
  border-top: 1px solid #decba6;
  padding: 10px 20px;
  font-size: 12px;
}
.recovery p {
  margin: 0;
  max-width: 750px;
  line-height: 1.6;
}
.recovery button {
  border-color: #b6a684;
  font-size: 11px;
  white-space: nowrap;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 13px;
  width: min(440px, calc(100vw - 32px));
  padding: 38px;
  box-shadow: 0 24px 90px #0002;
  max-height: calc(100dvh - 60px);
  overflow: auto;
}
dialog::backdrop {
  background: #17191b35;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-family: InkTypeSerif, Georgia, serif;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 400;
  margin: 0 22px 22px 0;
}
dialog p {
  line-height: 1.7;
}
dialog .close {
  position: absolute;
  right: 12px;
  top: 10px;
  font-size: 23px;
  padding: 3px 10px;
}
form label {
  display: block;
  font-size: 12px;
  margin: 20px 0 8px;
}
form input {
  display: block;
  width: 100%;
  padding: 12px;
  border: 1px solid #cdd1d4;
  border-radius: 6px;
}
form .primary {
  width: 100%;
  margin-top: 16px;
}
#code {
  letter-spacing: 6px;
  font-size: 22px;
}
#different-email {
  display: block;
  margin: 12px auto 0;
  font-size: 12px;
}
#auth-message {
  font-size: 12px;
  color: #555;
  min-height: 20px;
}
#signed-email {
  overflow-wrap: anywhere;
}
.history-dialog {
  width: min(690px, calc(100vw - 32px));
}
.revision {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
.revision h3 {
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 10px;
}
.revision pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow: auto;
  font-family: InkTypeSerif, Georgia, serif;
  font-size: 18px;
  line-height: 1.6;
}
.revision button {
  font-size: 12px;
}
.mobile-only {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
[hidden] {
  display: none !important;
}
body.focus .topbar,
body.focus .library,
body.focus .editor-actions {
  display: none;
}
body.focus .manuscript {
  padding-top: 75px;
}
body.focus .save-group {
  width: 100%;
  justify-content: space-between;
}
body.focus .footer {
  border-color: transparent;
}
body.focus #focus {
  display: block;
}
body.focus .exit-focus {
  display: block;
}
@media (max-width: 800px) {
  .topbar {
    height: 64px;
    padding: 0 15px;
    gap: 8px;
  }
  .wordmark {
    font-size: 25px;
  }
  .top-actions {
    gap: 0;
  }
  .top-actions button {
    font-size: 12px;
    padding: 8px;
  }
  .mobile-only {
    display: block;
    font-size: 12px;
    padding: 8px;
  }
  .library {
    display: none;
    position: absolute;
    top: 64px;
    bottom: 85px;
    left: 0;
    z-index: 2;
    box-shadow: 18px 0 40px #0001;
  }
  .library.open {
    display: flex;
  }
  .manuscript {
    padding-top: 33px;
  }
  #editor {
    font-size: 22px;
  }
  .footer {
    padding: 8px 12px;
    gap: 3px;
    min-height: 80px;
  }
  .save-group {
    width: 100%;
    justify-content: space-between;
  }
  .save-group > span {
    max-width: 75%;
  }
  .editor-actions {
    justify-content: space-between;
    width: 100%;
    gap: 2px;
  }
  .welcome {
    padding: 40px 26px 70px;
  }
  dialog {
    padding: 30px 24px;
  }
  .recovery {
    padding: 10px 14px;
    gap: 8px;
  }
  .recovery p {
    width: 100%;
  }
  body.focus .manuscript {
    padding-top: 40px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
