:root {
  --night-950: #070b25;
  --night-900: #0d1337;
  --night-800: #151e4a;
  --night-line: rgba(186, 198, 255, .18);
  --night-text: #eef0fb;
  --night-muted: rgba(220, 225, 255, .56);
  --paper: #dadde4;
  --paper-soft: #dfe1e7;
  --ink: #25293b;
  --muted: #566075;
  --accent: #485d97;
  --hairline: rgba(37, 41, 59, .13);
  --error: #8d3340;
  --serif: "Noto Serif SC", "Songti SC", STSong, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--night-950);
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  color: var(--night-text);
  background: var(--night-950);
  font-family: var(--serif);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid #aebcff;
  outline-offset: 3px;
}

::selection {
  color: #12162c;
  background: rgba(171, 179, 231, .72);
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.night-backdrop {
  position: fixed;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(4, 7, 28, .54), rgba(5, 8, 30, .82)),
    url("/assets/starfield-rooftop.jpg") 50% 38% / cover no-repeat;
  filter: saturate(.68) brightness(.68);
  transform: scale(1.015);
}

.night-backdrop::after {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 34%, transparent 0 25%, rgba(4, 6, 25, .36) 74%),
    linear-gradient(180deg, transparent 50%, rgba(5, 8, 29, .62));
  content: "";
}

.eyebrow {
  margin: 0;
  color: inherit;
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .16em;
}

.text-button,
.new-note-button,
.format-tools button,
.editor-tabs button,
.dialog-close {
  min-height: 44px;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.text-button:hover,
.new-note-button:hover,
.format-tools button:hover,
.editor-tabs button:hover,
.dialog-close:hover {
  background: rgba(109, 121, 163, .1);
}

.ink-action {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 6px;
  color: #eef1ff;
  background: #303d70;
  box-shadow: 0 10px 28px rgba(20, 27, 58, .2);
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.ink-action:hover {
  background: #3d4c83;
  transform: translateY(-1px);
}

.ink-action:active {
  transform: translateY(0);
}

.field-error {
  min-height: 1.35em;
  margin: 0;
  color: var(--error);
  font-size: .75rem;
  line-height: 1.5;
}

/* Login */
.login-view {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 28px;
}

.login-paper {
  position: relative;
  width: min(460px, 100%);
  padding: clamp(34px, 7vw, 64px);
  overflow: hidden;
  border-radius: 11px 14px 9px 13px;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255, 255, 255, .18), transparent 30%),
    var(--paper);
  box-shadow: 0 34px 110px rgba(1, 3, 18, .55);
}

.login-paper::before,
.editor-paper::before,
.empty-desk::before {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)' opacity='.18'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  content: "";
  mix-blend-mode: multiply;
  opacity: .055;
  pointer-events: none;
}

.login-paper > *,
.editor-paper > *,
.empty-desk > * {
  position: relative;
}

.login-paper .eyebrow {
  color: var(--accent);
}

.login-paper h1 {
  margin: 16px 0 13px;
  font-size: clamp(2.6rem, 8vw, 4.2rem);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.2;
}

.login-intro {
  margin: 0 0 34px;
  color: var(--muted);
  line-height: 1.8;
}

.login-paper form {
  display: grid;
  gap: 19px;
}

.login-paper label,
.paper-dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .06em;
}

.login-paper input,
.paper-dialog input {
  width: 100%;
  min-height: 46px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font-family: var(--serif);
  font-size: 1rem;
}

.login-paper input:focus,
.paper-dialog input:focus {
  border-bottom-color: var(--accent);
  outline: 0;
}

.login-action {
  width: 100%;
  margin-top: 5px;
}

.setup-message {
  margin: 24px 0 0;
  color: var(--error);
  font-size: .8rem;
  line-height: 1.7;
}

/* Main studio */
.studio-view {
  min-height: 100dvh;
  padding: 18px 20px 20px;
}

.studio-header {
  display: grid;
  width: min(1380px, 100%);
  height: 56px;
  margin: 0 auto 12px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}

.studio-brand {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.studio-brand strong {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .06em;
}

.studio-brand span,
.session-tools,
.save-status {
  color: var(--night-muted);
  font-family: var(--mono);
  font-size: .62rem;
  letter-spacing: .08em;
}

.save-status {
  margin: 0;
  text-align: center;
}

.save-status.is-dirty {
  color: #d3d9ff;
}

.save-status.is-error {
  color: #ffc1c9;
}

.session-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

.session-tools .text-button {
  font-family: var(--mono);
  font-size: .62rem;
}

.studio-shell {
  display: grid;
  width: min(1380px, 100%);
  height: calc(100dvh - 106px);
  min-height: 620px;
  margin: 0 auto;
  grid-template-columns: 254px minmax(0, 1fr);
  gap: 16px;
}

.library {
  display: flex;
  min-height: 0;
  flex-direction: column;
  padding: 26px 18px 18px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(8, 12, 39, .76);
  box-shadow: 0 24px 70px rgba(1, 3, 18, .35);
  backdrop-filter: blur(20px) saturate(110%);
}

.library-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 0 8px;
}

.library-heading .eyebrow {
  color: rgba(199, 208, 255, .48);
}

.library-heading h1 {
  margin: 9px 0 0;
  font-size: 1.55rem;
  font-weight: 580;
}

.new-note-button {
  width: 44px;
  padding: 0;
  color: #dce1ff;
  font-family: var(--mono);
  font-size: 1.25rem;
}

.library-counts {
  display: flex;
  gap: 14px;
  margin: 24px 8px 14px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--night-line);
  color: var(--night-muted);
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .06em;
}

.library-counts b {
  color: #d8ddfb;
  font-weight: 400;
}

.post-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(170, 183, 244, .2) transparent;
}

.post-group + .post-group {
  margin-top: 20px;
}

.post-group > h2 {
  margin: 0 8px 6px;
  color: rgba(199, 208, 255, .46);
  font-family: var(--mono);
  font-size: .55rem;
  font-weight: 400;
  letter-spacing: .14em;
}

.post-item {
  display: block;
  width: 100%;
  min-height: 76px;
  padding: 11px 10px 12px 20px;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.post-item:hover,
.post-item[aria-current="true"] {
  background: rgba(118, 132, 199, .11);
}

.post-item[aria-current="true"] {
  box-shadow: inset 2px 0 0 rgba(169, 181, 240, .58);
}

.post-item:hover {
  transform: translateX(2px);
}

.post-item strong {
  display: block;
  overflow: hidden;
  color: rgba(240, 242, 255, .92);
  font-size: .86rem;
  font-weight: 540;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item p {
  margin: 5px 0 0;
  overflow: hidden;
  color: rgba(206, 213, 250, .44);
  font-size: .67rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-item small {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  color: rgba(200, 208, 247, .42);
  font-family: var(--mono);
  font-size: .5rem;
  letter-spacing: .06em;
}

.post-item small em {
  color: rgba(190, 201, 255, .68);
  font-style: normal;
}

.library-empty {
  margin: 30px 10px;
  color: var(--night-muted);
  font-size: .75rem;
  line-height: 1.7;
}

.library-footnote {
  margin: 12px 8px 0;
  color: rgba(200, 208, 247, .34);
  font-size: .62rem;
  line-height: 1.5;
}

.empty-desk,
.editor-paper {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 10px 13px 9px 12px;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 7%, rgba(255, 255, 255, .18), transparent 31%),
    var(--paper);
  box-shadow: 0 28px 90px rgba(1, 3, 18, .46);
}

.empty-desk {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 40px;
  text-align: center;
}

.empty-star {
  color: rgba(72, 93, 151, .46);
  font-size: 2rem;
}

.empty-desk .eyebrow {
  margin-top: 18px;
  color: var(--accent);
}

.empty-desk h2 {
  margin: 12px 0 10px;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 580;
}

.empty-desk p:not(.eyebrow) {
  margin: 0 0 28px;
  color: var(--muted);
}

.editor-paper {
  display: grid;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.paper-meta {
  padding: 30px clamp(24px, 4vw, 52px) 23px;
  border-bottom: 1px solid var(--hairline);
}

.title-field,
.description-field {
  position: relative;
  display: block;
}

.paper-meta textarea,
.paper-meta input,
.markdown-field textarea {
  width: 100%;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  resize: none;
}

.paper-meta textarea:focus,
.paper-meta input:focus,
.markdown-field textarea:focus {
  outline: 0;
}

#post-title {
  min-height: 1.35em;
  padding: 0;
  overflow: hidden;
  font-size: clamp(2rem, 4.2vw, 3.75rem);
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1.26;
}

#post-title::placeholder,
#post-description::placeholder,
#post-markdown::placeholder {
  color: rgba(70, 78, 102, .35);
}

.description-field {
  margin-top: 11px;
  padding-right: 65px;
}

#post-description {
  min-height: 3.3em;
  padding: 0;
  color: var(--muted);
  font-size: .92rem;
  line-height: 1.72;
}

.description-field small {
  position: absolute;
  right: 0;
  bottom: 3px;
  color: rgba(86, 96, 117, .58);
  font-family: var(--mono);
  font-size: .55rem;
}

.meta-row {
  display: grid;
  margin-top: 19px;
  grid-template-columns: 145px minmax(160px, 1fr) auto;
  align-items: end;
  gap: 22px;
}

.meta-row label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .54rem;
  letter-spacing: .12em;
}

.meta-row input {
  min-height: 34px;
  padding: 3px 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-family: var(--serif);
  font-size: .78rem;
}

.post-state {
  min-height: 34px;
  padding: 9px 0 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .56rem;
  letter-spacing: .08em;
}

.desk-split {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
}

.writing-pane,
.preview-pane {
  display: grid;
  min-height: 0;
  grid-template-rows: 52px minmax(0, 1fr);
}

.writing-pane {
  border-right: 1px solid var(--hairline);
}

.pane-heading {
  display: flex;
  min-height: 52px;
  padding: 0 24px;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  color: var(--muted);
  font-family: var(--mono);
  font-size: .56rem;
  letter-spacing: .12em;
}

.format-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}

.format-tools button {
  min-width: 38px;
  min-height: 40px;
  padding: 5px 7px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .55rem;
}

.markdown-field {
  display: block;
  min-height: 0;
}

#post-markdown {
  height: 100%;
  min-height: 260px;
  padding: 24px clamp(22px, 3.4vw, 40px) 40px;
  font-family: var(--serif);
  font-size: .97rem;
  letter-spacing: .012em;
  line-height: 1.9;
  overflow-wrap: normal;
  resize: none;
  tab-size: 2;
}

.article-preview {
  min-height: 0;
  padding: 25px clamp(22px, 3.4vw, 40px) 42px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(62, 71, 100, .22) transparent;
}

.article-preview > header {
  margin-bottom: 28px;
  padding-bottom: 25px;
  border-bottom: 1px solid var(--hairline);
}

.article-preview time {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .55rem;
  letter-spacing: .08em;
}

.article-preview h2 {
  margin: 10px 0 9px;
  font-size: clamp(1.8rem, 3vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.3;
}

.article-preview header > p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.75;
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .54rem;
}

.preview-tags span + span::before {
  margin-right: 12px;
  color: rgba(86, 96, 117, .35);
  content: "·";
}

.prose-preview {
  font-size: .94rem;
  line-height: 1.95;
}

.prose-preview > :first-child {
  margin-top: 0;
}

.prose-preview p,
.prose-preview ul,
.prose-preview ol,
.prose-preview blockquote,
.prose-preview pre,
.prose-preview table {
  margin-block: 1.4em;
}

.prose-preview h2,
.prose-preview h3,
.prose-preview h4 {
  margin: 2.1em 0 .7em;
  line-height: 1.45;
}

.prose-preview h2 {
  padding-bottom: .4em;
  border-bottom: 1px solid var(--hairline);
  font-size: 1.35rem;
}

.prose-preview h3 {
  font-size: 1.12rem;
}

.prose-preview a {
  color: var(--accent);
  text-decoration-color: rgba(72, 93, 151, .35);
  text-underline-offset: 4px;
}

.prose-preview blockquote {
  margin-inline: 0;
  padding: .2em 0 .2em 1.15em;
  border-left: 2px solid rgba(72, 93, 151, .55);
  color: var(--muted);
}

.prose-preview img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.8em auto;
  border-radius: 7px;
}

.prose-preview code:not(pre code) {
  padding: .1em .3em;
  border-radius: 3px;
  color: #36405e;
  background: rgba(80, 91, 127, .09);
  font-family: var(--mono);
  font-size: .86em;
}

.prose-preview pre {
  max-width: 100%;
  padding: 17px;
  overflow-x: auto;
  border-radius: 7px;
  color: #e8ebff;
  background: #151a3a;
  font-family: var(--mono);
  font-size: .75rem;
  line-height: 1.7;
}

.prose-preview table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  white-space: nowrap;
}

.prose-preview th,
.prose-preview td {
  padding: 8px 10px;
  border: 1px solid var(--hairline);
  text-align: left;
}

.preview-empty {
  color: rgba(86, 96, 117, .5);
}

.paper-actions {
  display: grid;
  min-height: 65px;
  padding: 8px clamp(20px, 4vw, 42px);
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  border-top: 1px solid var(--hairline);
  background: rgba(218, 221, 228, .94);
}

.paper-actions > div {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.paper-actions .text-button {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .62rem;
}

.paper-actions .save-button {
  color: var(--accent);
}

.paper-actions kbd {
  margin-left: 5px;
  color: rgba(86, 96, 117, .55);
  font: inherit;
}

.danger-action {
  color: var(--error) !important;
}

/* Dialogs */
.paper-dialog {
  width: min(560px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 10px 13px 9px 12px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 34px 120px rgba(1, 3, 18, .65);
}

.paper-dialog::backdrop {
  background: rgba(2, 4, 20, .74);
  backdrop-filter: blur(6px);
}

.paper-dialog form {
  max-height: calc(100dvh - 28px);
  padding: clamp(24px, 5vw, 38px);
  overflow-y: auto;
}

.paper-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
}

.paper-dialog .eyebrow {
  color: var(--accent);
}

.paper-dialog h2 {
  margin: 9px 0 0;
  font-size: 2rem;
  font-weight: 600;
}

.dialog-close {
  width: 44px;
  padding: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 1.1rem;
}

.paper-dialog footer {
  display: flex;
  margin-top: 25px;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.paper-dialog footer .text-button {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .65rem;
}

#image-preview {
  display: block;
  width: 100%;
  max-height: 300px;
  margin: 25px 0 10px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(43, 48, 67, .06);
}

.image-detail {
  margin: 0 0 22px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: .58rem;
}

.publish-boundary {
  margin: 20px 0 24px;
  padding: 11px 13px;
  color: var(--muted);
  background: rgba(67, 77, 112, .07);
  font-size: .75rem;
  line-height: 1.6;
}

.paper-dialog label small {
  color: rgba(86, 96, 117, .58);
  font-family: var(--mono);
  font-size: .55rem;
  letter-spacing: 0;
}

.constellation-note {
  display: grid;
  margin: 24px 0 18px;
  padding: 18px 0;
  grid-template-columns: 34px 1fr;
  align-items: center;
  border-block: 1px solid var(--hairline);
  color: var(--accent);
}

.constellation-note > span {
  font-size: 1.1rem;
  text-shadow: 0 0 16px rgba(72, 93, 151, .45);
}

.constellation-note p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.65;
}

.publish-checks {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.publish-checks li {
  display: grid;
  grid-template-columns: 20px 1fr;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.5;
}

.publish-checks li::before {
  color: #5f7159;
  content: "✓";
}

.publish-checks li.is-missing::before {
  color: var(--error);
  content: "×";
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 32px));
  padding: 13px 16px;
  border-radius: 7px;
  color: #eef1ff;
  background: rgba(20, 27, 62, .94);
  box-shadow: 0 18px 55px rgba(1, 3, 18, .4);
  font-size: .75rem;
  line-height: 1.55;
}

.mobile-only {
  display: none;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .night-backdrop {
    background-position: 42% 40%;
  }

  .mobile-only {
    display: inline-flex;
  }

  .login-view {
    padding: 14px;
  }

  .login-paper {
    padding: 34px 24px 38px;
    border-radius: 8px 10px 7px 9px;
  }

  .studio-view {
    min-height: 100dvh;
    padding: 0;
  }

  .studio-header {
    position: sticky;
    z-index: 30;
    top: 0;
    height: 66px;
    margin: 0;
    padding: env(safe-area-inset-top) 14px 0;
    grid-template-columns: 44px 1fr auto;
    gap: 8px;
    background: rgba(7, 11, 37, .94);
    backdrop-filter: blur(18px);
  }

  .studio-brand {
    display: block;
    overflow: hidden;
    text-align: center;
  }

  .studio-brand strong {
    display: none;
  }

  .studio-brand span {
    color: rgba(238, 240, 251, .9);
    white-space: nowrap;
  }

  .save-status {
    position: absolute;
    right: 74px;
    bottom: 5px;
    left: 74px;
    overflow: hidden;
    font-size: .5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .session-tools > span {
    display: none;
  }

  .session-tools .text-button {
    min-width: 44px;
    padding: 0 4px;
    color: rgba(238, 240, 251, .78);
  }

  #mobile-library-button {
    width: 44px;
    padding: 0;
  }

  body[data-mobile-view="library"] #mobile-library-button {
    visibility: hidden;
  }

  .studio-shell {
    display: block;
    width: 100%;
    height: auto;
    min-height: calc(100dvh - 66px);
  }

  .library {
    min-height: calc(100dvh - 66px);
    padding: 28px 14px calc(32px + env(safe-area-inset-bottom));
    border-radius: 0;
    background: rgba(7, 11, 37, .74);
  }

  body[data-mobile-view="editor"] .library,
  body[data-mobile-view="editor"] .empty-desk {
    display: none;
  }

  body[data-mobile-view="library"] .editor-paper {
    display: none;
  }

  .library-heading,
  .library-counts {
    padding-inline: 6px;
  }

  .library-heading h1 {
    font-size: 2rem;
  }

  .library-counts {
    margin-top: 28px;
  }

  .post-item {
    min-height: 92px;
    padding: 14px 12px 14px 22px;
  }

  .post-item strong {
    font-size: 1rem;
  }

  .post-item p {
    font-size: .76rem;
  }

  .empty-desk {
    min-height: calc(100dvh - 66px);
    border-radius: 0;
  }

  .editor-paper {
    width: calc(100% - 28px);
    min-height: calc(100dvh - 84px);
    margin: 18px auto calc(92px + env(safe-area-inset-bottom));
    padding-bottom: 72px;
    border-radius: 8px 10px 7px 9px;
    grid-template-rows: auto auto minmax(520px, 1fr) auto;
  }

  .paper-meta {
    padding: 28px 20px 20px;
  }

  #post-title {
    font-size: clamp(2rem, 10vw, 2.75rem);
  }

  .description-field {
    padding-right: 0;
  }

  .description-field small {
    position: static;
    display: block;
    margin-top: 3px;
    text-align: right;
  }

  .meta-row {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .post-state {
    min-height: 24px;
    padding-top: 3px;
  }

  .editor-tabs {
    display: grid;
    height: 50px;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--hairline);
  }

  .editor-tabs button {
    position: relative;
    justify-content: center;
    color: var(--muted);
    font-family: var(--mono);
    font-size: .62rem;
  }

  .editor-tabs button[aria-selected="true"] {
    color: var(--ink);
  }

  .editor-tabs button[aria-selected="true"]::after {
    position: absolute;
    right: 30%;
    bottom: 0;
    left: 30%;
    height: 2px;
    background: var(--accent);
    content: "";
  }

  .desk-split {
    display: block;
    min-height: 520px;
  }

  .writing-pane,
  .preview-pane {
    min-height: 520px;
    border-right: 0;
  }

  body[data-editor-tab="write"] .preview-pane,
  body[data-editor-tab="preview"] .writing-pane {
    display: none;
  }

  #post-markdown {
    min-height: 468px;
    padding: 22px 20px 40px;
    font-size: 1rem;
  }

  .pane-heading {
    padding-inline: 17px;
  }

  .article-preview {
    min-height: 468px;
    padding: 24px 20px 40px;
  }

  .paper-actions {
    position: fixed;
    z-index: 10;
    right: 14px;
    bottom: 0;
    left: 14px;
    display: block;
    width: auto;
    min-height: 72px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  }

  .paper-actions > .field-error {
    min-height: 0;
    margin: 0 8px;
  }

  .paper-actions > div {
    justify-content: space-between;
  }

  .paper-actions kbd {
    display: none;
  }

  .paper-actions .ink-action {
    padding-inline: 13px;
  }

  .paper-actions .danger-action,
  .paper-actions .save-button {
    padding-inline: 5px;
    font-size: .56rem;
  }

  .paper-dialog {
    width: calc(100% - 28px);
    max-height: calc(100dvh - 28px);
    margin: auto auto 14px;
    border-radius: 9px 11px 7px 9px;
  }

  .paper-dialog form {
    padding: 26px 20px calc(24px + env(safe-area-inset-bottom));
  }

  .paper-dialog footer {
    position: sticky;
    bottom: 0;
    padding-top: 10px;
    background: var(--paper);
  }

  .toast {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
