:root {
  --paper: #fbfaf7;
  --panel: #f4f2ec;
  --panel-strong: #ebe8df;
  --browser-surface: #f8f7f3;
  --surface: #ffffff;
  --surface-translucent: rgb(255 255 255 / 78%);
  --topbar: rgb(255 255 255 / 88%);
  --ink: #24231f;
  --muted: #77736b;
  --faint: #aaa59b;
  --line: #dfdcd3;
  --accent: #bf5b3d;
  --accent-soft: #f6e6de;
  --shadow: 0 18px 50px rgb(62 50 36 / 10%);
  --sidebar-width: 220px;
  --browser-width: 330px;
  --resizer-width: 10px;
  --text-font:
    "Segoe UI Variable Text", ui-sans-serif, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Noto Sans", "PingFang SC", "Microsoft YaHei", Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  color-scheme: light;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--text-font);
  font-synthesis: none;
}

html[data-theme="dark"] {
  --paper: #191a1c;
  --panel: #202225;
  --panel-strong: #2a2c30;
  --browser-surface: #1d1f22;
  --surface: #181a1d;
  --surface-translucent: rgb(31 33 36 / 84%);
  --topbar: rgb(24 26 29 / 90%);
  --ink: #eeeae2;
  --muted: #aaa69e;
  --faint: #777a80;
  --line: #37393e;
  --accent: #e18a6c;
  --accent-soft: #3c2924;
  --shadow: 0 20px 60px rgb(0 0 0 / 28%);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-size: 15px;
  transition: color 160ms, background 160ms;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

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

button {
  border: 0;
}

[hidden] {
  display: none !important;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 16% 20%, rgb(191 91 61 / 9%), transparent 28%),
    radial-gradient(circle at 85% 78%, rgb(105 126 100 / 8%), transparent 32%),
    var(--paper);
}

.login-card {
  width: min(100%, 420px);
  padding: 46px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-translucent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 30px;
  place-items: center;
  border-radius: 17px;
  color: var(--surface);
  background: var(--ink);
  font-family: Georgia, serif;
  font-size: 27px;
}

.login-card h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 7vw, 45px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.login-copy {
  margin: 18px 0 34px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

.login-card label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.login-card input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--surface);
  transition: border-color 140ms, box-shadow 140ms;
}

.login-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(191 91 61 / 12%);
}

.primary-button {
  width: 100%;
  height: 48px;
  margin-top: 12px;
  border-radius: 10px;
  color: var(--surface);
  background: var(--ink);
  cursor: pointer;
  font-weight: 650;
  transition: transform 120ms, background 120ms;
}

.primary-button:hover {
  filter: brightness(1.18);
}

.primary-button:active {
  transform: translateY(1px);
}

.form-error {
  min-height: 18px;
  margin: 12px 0 0;
  color: #a13c2c;
  font-size: 12px;
  text-align: center;
}

.workspace {
  --active-browser-width: var(--browser-width);
  --active-browser-resizer-width: var(--resizer-width);

  display: grid;
  min-height: 100vh;
  align-items: start;
  grid-template-columns:
    var(--sidebar-width) var(--active-browser-width)
    var(--active-browser-resizer-width) minmax(0, 1fr);
}

.workspace.browser-collapsed {
  --active-browser-width: 0px;
  --active-browser-resizer-width: 0px;
}

.workspace.browser-collapsed .note-browser {
  visibility: hidden;
  pointer-events: none;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  flex-direction: column;
  padding: 18px 12px;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 8px;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.sidebar-browser-expand {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 12px;
  color: var(--ink);
}

.brand:hover {
  background: var(--panel-strong);
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--surface);
  background: var(--ink);
  font-family: Georgia, serif;
  font-size: 17px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 13px;
}

.brand small {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 500;
}

.layer-nav {
  margin-top: 30px;
}

.nav-section {
  min-width: 0;
}

.nav-section-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 5px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: left;
}

.nav-section-toggle:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

.nav-section-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.ui-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.nav-section-chevron {
  width: 14px;
  height: 14px;
  transition: transform 140ms;
}

.nav-section-toggle[aria-expanded="false"] .nav-section-chevron {
  transform: rotate(-90deg);
}

.nav-section.collapsed .nav-section-content {
  display: none;
}

.nav-section-heading {
  display: flex;
  align-items: center;
}

.nav-section-heading .nav-section-toggle {
  flex: 1;
}

.nav-section-heading #clear-tag {
  margin: 13px 7px 0 2px;
  padding: 5px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.nav-section-heading #clear-tag:hover {
  color: var(--ink);
}

.nav-label {
  margin: 25px 10px 8px;
  color: var(--faint);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.nav-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-label-row .nav-label {
  margin-top: 18px;
}

.nav-label-row button {
  margin: 12px 8px 0 0;
  padding: 4px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.nav-label-row button:hover {
  color: var(--ink);
}

.nav-item,
.sidebar-action {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover,
.sidebar-action:hover,
.nav-item.active {
  color: var(--ink);
  background: var(--panel-strong);
}

.nav-item.active {
  font-weight: 650;
}

.nav-icon {
  width: 13px;
  color: var(--muted);
  font-size: 16px;
  text-align: center;
}

.status-nav-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.status-nav-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.unread-nav-indicator {
  fill: #5b8def;
  stroke: none;
}

.nav-item:hover .status-nav-icon,
.nav-item.active .status-nav-icon {
  color: var(--ink);
}

.note-unread-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #5b8def;
}

.nav-count {
  min-width: 20px;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface-translucent);
  font-size: 9px;
  text-align: center;
}

.layer-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b8b4ab;
}

.layer-dot.resources {
  background: #b87b47;
}

.layer-dot.inbox {
  background: #c55f47;
}

.layer-dot.wiki {
  background: #6c8c70;
}

.layer-dot.archive {
  background: #8d8994;
}

.sidebar-spacer {
  min-height: 14px;
  flex: 1;
}

.recent-section {
  margin-top: 2px;
}

.recent-list {
  min-height: 28px;
}

.recent-nav-item {
  display: flex;
  width: 100%;
  min-height: 31px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.recent-nav-item:hover,
.recent-nav-item.active {
  color: var(--ink);
  background: var(--panel-strong);
}

.recent-nav-item > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-nav-icon {
  width: 13px;
  flex: 0 0 auto;
  color: var(--faint);
  font-size: 13px;
  text-align: center;
}

.tag-section {
  max-height: min(34vh, 280px);
  overflow: hidden;
}

.tag-list {
  max-height: min(26vh, 220px);
  overflow-y: auto;
}

.tag-nav-item {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.tag-nav-item:hover,
.tag-nav-item.active {
  color: var(--ink);
  background: var(--panel-strong);
}

.tag-nav-item > span:nth-child(2) {
  overflow: hidden;
  flex: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-nav-item > span:first-child {
  color: var(--faint);
}

.tag-count {
  color: var(--faint);
  font-size: 9px;
}

.empty-tags {
  margin: 4px 10px;
  color: var(--faint);
  font-size: 10px;
}

.sidebar-action > span:first-child,
.sidebar-action-icon {
  width: 14px;
  color: var(--faint);
  font-size: 15px;
  text-align: center;
}

.sidebar-action-icon {
  height: 14px;
}

.sidebar-action-label {
  width: auto !important;
  color: inherit !important;
  font-size: inherit !important;
  text-align: left !important;
  white-space: nowrap;
}

.panel-resizer {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 100vh;
  min-width: 0;
  cursor: col-resize;
  touch-action: none;
}

.panel-resizer::before {
  position: absolute;
  inset: 0 4.5px;
  background: transparent;
  content: "";
  opacity: 0;
  transition: inset 120ms, opacity 120ms;
}

.panel-resizer:hover::before,
.panel-resizer.dragging::before {
  inset: 0 3px;
  background: var(--accent);
  opacity: 0.35;
}

.panel-action-button,
.icon-button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 5px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 120ms, background 120ms;
}

.panel-action-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.panel-action-button:hover,
.icon-button:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

.panel-action-button:focus-visible,
.icon-button:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

body.panel-dragging {
  cursor: col-resize;
  user-select: none;
}

.note-browser {
  position: sticky;
  top: 0;
  height: 100vh;
  min-width: 0;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--browser-surface);
}

.browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 22px 16px;
}

.browser-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.browser-header h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 23px;
  font-weight: 500;
}

.new-note-button {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--surface);
  background: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.new-note-button span {
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  margin: 0 16px 14px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--faint);
  background: var(--panel-strong);
}

.search-box:focus-within {
  border-color: var(--line);
  background: var(--surface);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}

.search-box kbd {
  padding: 2px 5px;
  border: 1px solid #d4d0c6;
  border-radius: 4px;
  color: var(--faint);
  background: var(--paper);
  font: 9px ui-monospace, monospace;
}

.notes-list {
  height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 0 8px 22px;
}

.note-card {
  width: 100%;
  padding: 14px;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 100ms;
}

.note-card:hover,
.note-card.active {
  background: var(--surface);
  box-shadow: 0 1px 0 rgb(55 48 39 / 4%);
}

.note-card.active {
  box-shadow: inset 2px 0 var(--accent);
}

.note-card-top {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.note-card h3 {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-card:not(.unread) h3 {
  color: var(--muted);
  font-weight: 530;
}

.note-card .note-unread-dot {
  margin-top: 5px;
}

.note-card time {
  color: var(--faint);
  font-size: 9px;
}

.note-card-comment-count {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  margin-top: 2px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1;
}

.note-card-comment-count svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.note-card p {
  display: -webkit-box;
  overflow: hidden;
  margin: 8px 0 0 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.note-card-tags {
  display: flex;
  overflow: hidden;
  gap: 5px;
  margin: 9px 0 0 15px;
}

.note-card-tags span {
  overflow: hidden;
  max-width: 110px;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--panel);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-list {
  padding: 60px 26px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.editor-shell {
  --tabs-height: 42px;

  height: 100vh;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
}

.note-tabs {
  display: flex;
  height: var(--tabs-height);
  min-width: 0;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: var(--browser-surface);
}

.home-tab,
.note-tab-open,
.note-tab-close {
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.home-tab {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  border-right: 1px solid var(--line);
  font-size: 11px;
}

.home-tab svg,
.note-tab-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.home-tab:hover,
.home-tab.active {
  color: var(--ink);
  background: var(--surface);
}

.open-note-tabs {
  display: flex;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}

.note-tab {
  position: relative;
  display: flex;
  min-width: 138px;
  max-width: 230px;
  flex: 0 0 auto;
  align-items: stretch;
  border-right: 1px solid var(--line);
}

.note-tab::after {
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  content: "";
}

.note-tab.active {
  background: var(--surface);
}

.note-tab.active::after {
  background: var(--accent);
}

.note-tab.comparison::after {
  background: #5b8def;
}

.note-tab-open {
  display: flex;
  min-width: 0;
  align-items: center;
  flex: 1;
  gap: 7px;
  padding: 0 5px 0 11px;
  font-size: 11px;
  text-align: left;
}

.note-tab-open > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-tab:hover .note-tab-open,
.note-tab.active .note-tab-open {
  color: var(--ink);
}

.note-tab-close {
  display: grid;
  width: 28px;
  flex: 0 0 28px;
  place-items: center;
  padding: 0;
  opacity: 0;
}

.note-tab:hover .note-tab-close,
.note-tab-close:focus-visible {
  opacity: 1;
}

.note-tab-close:hover {
  color: var(--ink);
  background: var(--panel-strong);
}

.editor-content {
  height: calc(100vh - var(--tabs-height));
  min-width: 0;
}

.welcome-view {
  height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 92% 8%, rgb(191 91 61 / 7%), transparent 25%),
    var(--surface);
}

.welcome-page {
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 92px 64px 120px;
}

.welcome-mark {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 40px;
  place-items: center;
  border-radius: 16px;
  color: var(--surface);
  background: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.welcome-page h1 {
  margin: 0 0 32px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(40px, 6vw, 58px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.welcome-content {
  color: var(--ink);
  background: transparent !important;
  font-family: var(--text-font);
  font-size: 17px;
  line-height: 1.75;
}

.welcome-content h1,
.welcome-content h2,
.welcome-content h3,
.welcome-content h4 {
  font-family: Georgia, "Times New Roman", serif;
}

.note-workspace {
  display: grid;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.note-workspace.comparing {
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 1fr);
}

.note-workspace.comments-open {
  grid-template-columns:
    minmax(420px, 1fr)
    minmax(300px, var(--comments-width, 360px));
}

.editor {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
}

.editor-topbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(10px);
}

.compare-pane {
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.compare-topbar {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--topbar);
  font-size: 11px;
  backdrop-filter: blur(10px);
}

.compare-topbar > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.compare-label {
  margin-left: 6px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.compare-page {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 72px 52px 100px;
}

.compare-page h2 {
  margin: 0 0 38px;
  overflow-wrap: anywhere;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.compare-content {
  color: var(--ink);
  background: transparent !important;
  font-family: var(--text-font);
  font-size: 16px;
  line-height: 1.75;
}

.compare-content h1,
.compare-content h2,
.compare-content h3,
.compare-content h4 {
  font-family: Georgia, "Times New Roman", serif;
}

.comments-pane {
  position: relative;
  display: flex;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--browser-surface);
}

.comments-resizer {
  position: absolute;
  z-index: 6;
  inset: 0 auto 0 -7px;
  width: 14px;
  cursor: col-resize;
  touch-action: none;
}

.comments-resizer::before {
  position: absolute;
  inset: 0 6px;
  background: transparent;
  content: "";
  transition: inset 120ms, background 120ms;
}

.comments-resizer:hover::before,
.comments-resizer:focus-visible::before,
.comments-resizer.dragging::before {
  inset: 0 5px;
  background: var(--accent);
}

.comments-resizer:focus-visible {
  outline: 0;
}

.comments-header {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 15px 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(10px);
}

.comments-header .eyebrow {
  margin-bottom: 3px;
}

.comments-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.comments-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px 28px;
  scrollbar-color: var(--muted) transparent;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.comments-list::-webkit-scrollbar {
  width: 10px;
}

.comments-list::-webkit-scrollbar-track {
  background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 10px;
  background: var(--muted);
  background-clip: padding-box;
}

.comments-empty {
  margin: 36px 18px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.comment-card {
  margin-bottom: 11px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 160ms, box-shadow 160ms;
}

.comment-card.focused-comment {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(191 91 61 / 10%);
}

.comment-card.reply {
  margin-left: 24px;
  border-left: 2px solid var(--accent);
}

.comment-card-header {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.comment-card-header strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-card-header time {
  color: var(--faint);
  font-size: 9px;
}

.comment-card-body {
  margin: 8px 0 9px;
  color: var(--ink);
  background: transparent !important;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.comment-card-body p {
  margin: 0 0 4px;
  line-height: 1.4;
}

.comment-card-quote {
  display: block;
  width: 100%;
  max-height: 84px;
  overflow: hidden;
  margin: 9px 0 2px;
  padding: 8px 9px;
  border-left: 2px solid var(--accent);
  color: var(--muted);
  background: var(--accent-soft);
  cursor: pointer;
  font: italic 11px/1.5 var(--text-font);
  text-align: left;
  text-overflow: ellipsis;
}

.comment-card-quote:hover {
  color: var(--ink);
}

.comment-card-body.plaintext {
  white-space: pre-wrap;
}

.comment-card-body > :first-child {
  margin-top: 0 !important;
}

.comment-card-body > :last-child {
  margin-bottom: 0 !important;
}

.comment-card-body pre {
  max-width: 100%;
  overflow-x: auto;
}

.comment-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-card-actions button {
  padding: 2px 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
}

.comment-card-actions button:hover {
  color: var(--accent);
}

.comment-delete-button.confirming {
  color: #b64d3d;
}

.comment-card-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.comment-form {
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.comment-form > label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.comment-form textarea {
  display: block;
  width: 100%;
  min-height: 76px;
  max-height: 240px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: 0;
  color: var(--ink);
  background: var(--paper);
  font: 12px/1.5 var(--text-font);
  resize: none;
}

.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(191 91 61 / 10%);
}

.comment-form-actions,
.comment-reply-context,
.comment-anchor-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.comment-form-actions {
  margin-top: 9px;
}

.comment-form-actions span {
  color: var(--faint);
  font-size: 9px;
}

.comment-form-actions button {
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 7px;
  color: var(--surface);
  background: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 650;
}

.comment-form-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.comment-reply-context {
  margin-bottom: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 9px;
}

.comment-reply-context span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-anchor-context {
  max-height: 118px;
  margin-bottom: 9px;
  padding: 8px 9px;
  overflow: hidden;
  border-radius: 7px;
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 9px;
}

.comment-anchor-context > div {
  min-width: 0;
  overflow: hidden;
}

.comment-anchor-context span {
  display: block;
  margin-bottom: 3px;
  color: var(--faint);
  font-weight: 650;
  text-transform: uppercase;
}

.comment-anchor-context blockquote {
  max-height: 72px;
  margin: 0;
  overflow: hidden;
  font: italic 10px/1.45 var(--text-font);
}

.comment-anchor-context button,
.comment-reply-context button {
  flex: 0 0 auto;
  padding: 2px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.mobile-back-button {
  display: none;
}

.breadcrumb,
.save-state {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.breadcrumb span:last-child {
  overflow: hidden;
  max-width: 220px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.save-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #80a281;
}

.save-indicator.saving {
  background: #d39a51;
}

.save-indicator.error {
  background: #c6503e;
}

.editor-topbar-actions,
.view-mode-switch {
  display: flex;
  align-items: center;
}

.editor-topbar-actions {
  gap: 14px;
}

.comments-toggle {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
}

.comments-toggle:hover,
.comments-toggle[aria-expanded="true"] {
  color: var(--ink);
  background: var(--panel-strong);
}

.comments-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.comments-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.comments-count {
  min-width: 16px;
  padding: 1px 5px;
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  font-size: 9px;
  text-align: center;
}

.editor-page {
  position: relative;
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 74px 60px 100px;
}

.comment-markers {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.comment-marker {
  position: absolute;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface);
  box-shadow: 0 3px 10px rgb(0 0 0 / 13%);
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  pointer-events: auto;
  transform: translateX(-3px);
}

.comment-marker:hover,
.comment-marker:focus-visible {
  color: var(--surface);
  background: var(--accent);
  outline: 0;
}

.note-title {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.08;
  overflow-wrap: anywhere;
  resize: none;
  white-space: pre-wrap;
}

.note-title::placeholder {
  color: var(--faint);
}

.note-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 25px 0 12px;
}

.note-actions select {
  flex: 0 0 auto;
  height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: 0;
  color: var(--muted);
  background: var(--paper);
  cursor: pointer;
  font-size: 11px;
}

.note-actions #updated-time {
  margin-left: auto;
  color: var(--faint);
  font-size: 10px;
  white-space: nowrap;
}

.tags-field-wrap {
  position: relative;
  min-width: 140px;
  max-width: 370px;
  flex: 1;
}

.tags-field {
  display: flex;
  width: 100%;
  height: 29px;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
}

.tags-field input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
}

.tags-field button {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 5px;
  color: var(--faint);
  background: transparent;
  cursor: pointer;
}

.tags-field button:hover,
.tags-field button[aria-expanded="true"] {
  color: var(--ink);
  background: var(--panel-strong);
}

.tags-field button .ui-icon {
  width: 14px;
  height: 14px;
  transition: transform 140ms;
}

.tags-field button[aria-expanded="true"] .ui-icon {
  transform: rotate(180deg);
}

.tags-field:focus-within {
  border-color: var(--accent);
  background: var(--surface);
}

.tag-picker {
  position: absolute;
  z-index: 18;
  top: calc(100% + 6px);
  left: 0;
  display: grid;
  width: 100%;
  max-height: 240px;
  gap: 2px;
  padding: 5px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgb(0 0 0 / 16%);
}

.tag-picker > p {
  margin: 7px 8px;
  color: var(--faint);
  font-size: 10px;
}

.tag-picker > button {
  display: grid;
  min-height: 32px;
  align-items: center;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  text-align: left;
}

.tag-picker > button:hover,
.tag-picker > button.selected {
  color: var(--ink);
  background: var(--panel-strong);
}

.tag-picker > button > span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#vditor-editor {
  min-height: 420px;
  margin-top: 24px;
  border: 0;
  background: transparent;
}

#vditor-editor .vditor-toolbar {
  position: sticky;
  z-index: 1;
  top: 52px;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-translucent);
  backdrop-filter: blur(10px);
}

#vditor-editor .vditor-toolbar__item {
  padding: 0 1px;
}

#vditor-editor .vditor-ir {
  background: transparent;
}

#vditor-editor .vditor-ir pre.vditor-reset {
  min-height: 420px;
  padding: 26px 0 80px !important;
  color: var(--ink);
  background: transparent;
  font-family: var(--text-font);
  font-size: 17px;
  line-height: 1.75;
}

#vditor-editor .vditor-ir__node {
  min-height: 1.75em;
}

#vditor-editor .vditor-ir__preview {
  font-family: var(--text-font);
}

#vditor-editor .vditor-reset h1,
#vditor-editor .vditor-reset h2,
#vditor-editor .vditor-reset h3,
#vditor-editor .vditor-reset h4 {
  font-family: Georgia, "Times New Roman", serif;
}

#vditor-editor .vditor-reset a {
  color: var(--accent);
}

.vditor-reset blockquote {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--accent-soft);
}

#vditor-editor .vditor-reset code,
#vditor-editor .vditor-ir__marker {
  background: var(--panel);
}

#vditor-editor .vditor-reset img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
}

.attachment-hover-download {
  position: fixed;
  z-index: 18;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-translucent);
  box-shadow: 0 5px 18px rgb(0 0 0 / 16%);
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.attachment-hover-download .ui-icon {
  width: 17px;
  height: 17px;
}

.attachment-hover-download:hover {
  color: var(--surface);
  border-color: var(--accent);
  background: var(--accent);
}

.context-menu,
.selection-comment-menu,
.context-submenu {
  position: fixed;
  z-index: 30;
  width: 190px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgb(0 0 0 / 18%);
}

.context-menu button,
.selection-comment-menu button,
.context-submenu button {
  display: flex;
  width: 100%;
  min-height: 34px;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border-radius: 6px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.context-menu button:hover,
.selection-comment-menu button:hover,
.context-submenu button:hover {
  background: var(--panel-strong);
}

.selection-comment-menu {
  position: fixed;
  z-index: 31;
  width: 190px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 12px 34px rgb(0 0 0 / 18%);
}

.context-menu button:disabled,
.context-submenu button:disabled {
  color: var(--faint);
  cursor: default;
  background: transparent;
}

.menu-icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
  text-align: center;
}

.menu-svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.menu-chevron {
  width: 14px;
  height: 14px;
  margin-left: auto;
  color: var(--faint);
}

.menu-separator {
  height: 1px;
  margin: 4px -5px;
  background: var(--line);
}

.context-menu .danger-menu-item {
  color: #b64d3d;
}

.context-submenu {
  position: absolute;
  top: 73px;
  left: calc(100% + 6px);
  width: 178px;
}

.context-submenu p {
  margin: 4px 9px 5px;
  color: var(--faint);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.dialog-backdrop {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgb(20 19 17 / 38%);
  backdrop-filter: blur(3px);
}

.confirm-dialog {
  width: min(100%, 410px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgb(0 0 0 / 25%);
}

.confirm-dialog h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 500;
}

.confirm-dialog p {
  margin: 13px 0 24px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.confirm-dialog strong {
  color: var(--ink);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.confirm-actions button {
  min-height: 35px;
  padding: 0 13px;
  border-radius: 7px;
  background: var(--panel-strong);
  cursor: pointer;
  font-size: 11px;
  font-weight: 650;
}

.confirm-actions #delete-confirm {
  color: white;
  background: #b64d3d;
}

.confirm-actions button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(340px, calc(100vw - 48px));
  padding: 11px 15px;
  border-radius: 8px;
  color: var(--surface);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 11px;
}

@media (max-width: 1100px) {
  .note-workspace.comments-open {
    position: relative;
    grid-template-columns: minmax(0, 1fr);
  }

  .comments-pane {
    position: absolute;
    z-index: 5;
    inset: 0 0 0 auto;
    width: min(100%, var(--comments-width, 360px));
    box-shadow: -18px 0 45px rgb(44 37 30 / 12%);
  }
}

@media (max-width: 960px) {
  :root {
    --sidebar-width: 76px;
    --browser-width: 300px;
  }

  .brand {
    justify-content: center;
  }

  .sidebar-browser-expand {
    top: 64px;
    right: 23px;
  }

  .brand > span:last-child,
  .nav-item:not(.active)::after,
  .nav-item {
    font-size: 0;
  }

  .nav-item {
    justify-content: center;
  }

  .layer-nav .nav-section,
  .layer-nav .nav-section-content {
    display: contents;
  }

  .nav-section-toggle,
  .recent-section {
    display: none;
  }

  .nav-item .layer-dot,
  .nav-item .nav-icon {
    width: 10px;
    height: 10px;
  }

  .nav-label,
  .nav-count,
  .sidebar-action {
    justify-content: center;
    font-size: 0;
  }

  .tag-section {
    display: none;
  }

  .editor-page {
    padding-right: 36px;
    padding-left: 36px;
  }

  .compare-page {
    padding-right: 36px;
    padding-left: 36px;
  }

  .welcome-page {
    padding-right: 42px;
    padding-left: 42px;
  }
}

@media (max-width: 720px) {
  :root {
    --mobile-navigation-height: 66px;
    --mobile-topbar-height: calc(52px + env(safe-area-inset-top));
  }

  body {
    min-height: 100dvh;
  }

  .login-shell {
    min-height: 100dvh;
    padding: 20px;
  }

  .login-card {
    padding: 36px 28px;
    border-radius: 18px;
  }

  .workspace {
    display: block;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    z-index: 4;
    inset: auto 0 0;
    width: 100%;
    height: calc(
      var(--mobile-navigation-height) + env(safe-area-inset-bottom)
    );
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    overflow: hidden;
    border-top: 1px solid var(--line);
    border-right: 0;
    background: var(--surface-translucent);
    backdrop-filter: blur(18px);
  }

  .brand,
  .tag-section,
  .recent-section,
  .sidebar-spacer,
  .sidebar-action,
  .nav-section-toggle {
    display: none;
  }

  .layer-nav {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 2px;
    margin: 0;
  }

  .nav-item,
  .nav-item:not(.active)::after {
    font-size: 9px;
  }

  .nav-item {
    position: relative;
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 5px 2px 4px;
    border-radius: 10px;
    text-align: center;
  }

  .nav-item .layer-dot {
    width: 9px;
    height: 9px;
  }

  .nav-item .nav-icon {
    width: auto;
    height: auto;
    font-size: 18px;
    line-height: 0.6;
  }

  .nav-count {
    position: absolute;
    top: 3px;
    left: calc(50% + 3px);
    min-width: 15px;
    margin: 0;
    padding: 0 4px;
    font-size: 8px;
    line-height: 15px;
  }

  .panel-resizer {
    display: none;
  }

  .sidebar-browser-expand {
    display: none !important;
  }

  .browser-header .panel-action-button {
    display: none;
  }

  .note-browser {
    position: relative;
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    flex-direction: column;
    padding-bottom: calc(
      var(--mobile-navigation-height) + env(safe-area-inset-bottom)
    );
    border-right: 0;
  }

  .workspace.browser-collapsed .note-browser {
    visibility: visible;
    pointer-events: auto;
  }

  .browser-header {
    padding: calc(22px + env(safe-area-inset-top)) 18px 14px;
  }

  .browser-header h2 {
    font-size: 27px;
  }

  .new-note-button {
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
  }

  .search-box {
    height: 42px;
    margin: 0 14px 12px;
    border-radius: 10px;
  }

  .notes-list {
    height: auto;
    min-height: 0;
    flex: 1;
    padding: 0 10px 18px;
  }

  .note-card {
    padding: 15px 14px;
    border-radius: 12px;
  }

  .editor-shell {
    --tabs-height: 0px;

    position: fixed;
    z-index: 5;
    inset: 0;
    display: none;
    height: 100vh;
    height: 100dvh;
  }

  .note-tabs {
    display: none;
  }

  .editor-shell.mobile-open {
    display: block;
    overflow: hidden;
  }

  .editor-content {
    height: 100vh;
    height: 100dvh;
  }

  .note-workspace {
    height: 100%;
  }

  .editor-topbar {
    height: var(--mobile-topbar-height);
    padding: env(safe-area-inset-top) 14px 0;
  }

  .editor-topbar-actions {
    gap: 7px;
  }

  .save-state {
    font-size: 0;
  }

  .mobile-back-button {
    display: flex;
    min-width: 64px;
    min-height: 44px;
    align-items: center;
    gap: 5px;
    margin-left: -7px;
    padding: 0 7px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
  }

  .mobile-back-button .ui-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-back-button span:last-child {
    font-size: 11px;
    font-weight: 600;
  }

  .breadcrumb span:nth-child(3),
  .breadcrumb span:last-child {
    display: none;
  }

  .editor-page {
    width: 100%;
    padding:
      38px 20px
      calc(88px + env(safe-area-inset-bottom));
  }

  .note-title {
    font-size: clamp(36px, 10vw, 44px);
  }

  .note-actions {
    flex-wrap: wrap;
    margin-top: 22px;
  }

  .note-actions select,
  .tags-field {
    height: 36px;
  }

  .tags-field-wrap {
    order: 3;
    min-width: 0;
    max-width: none;
    flex-basis: 100%;
  }

  #vditor-editor {
    min-height: 360px;
    margin-top: 18px;
  }

  #vditor-editor .vditor-toolbar {
    top: var(--mobile-topbar-height);
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  #vditor-editor .vditor-toolbar::-webkit-scrollbar {
    display: none;
  }

  #vditor-editor .vditor-ir pre.vditor-reset {
    min-height: 360px;
    padding: 22px 0 64px !important;
    font-size: 16px;
  }

  .note-workspace.comparing {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .note-workspace.comments-open {
    position: static;
    grid-template-columns: 1fr;
  }

  .compare-pane {
    display: none !important;
  }

  .comments-pane {
    position: fixed;
    z-index: 7;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border-left: 0;
    box-shadow: none;
  }

  .comments-resizer {
    display: none;
  }

  .comments-header {
    min-height: var(--mobile-topbar-height);
    padding:
      env(safe-area-inset-top) 14px 0
      20px;
  }

  .comments-list {
    padding: 18px 16px 28px;
  }

  .comment-form {
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  }

  .comment-form textarea {
    min-height: 88px;
    font-size: 16px;
  }

  .comments-toggle-label {
    display: none;
  }

  .comments-toggle {
    min-width: 42px;
    min-height: 42px;
    justify-content: center;
    padding: 7px;
  }

  .welcome-page {
    padding: 62px 28px 90px;
  }

  .markdown-body {
    font-size: 16px;
  }

  .metadata-grid {
    grid-template-columns: 1fr;
  }

  #context-compare {
    display: none;
  }

  .toast {
    right: 14px;
    bottom: calc(
      var(--mobile-navigation-height) + env(safe-area-inset-bottom) + 12px
    );
    max-width: calc(100vw - 28px);
  }
}
