:root {
  color-scheme: light;
  --ink: #342f2a;
  --paper: #fbf4e8;
  --panel: rgba(255, 250, 238, 0.9);
  --shadow: 0 18px 44px rgba(38, 32, 25, 0.22);
  --blue-ink: #1f88a8;
  --photo-red: #c75c55;
  --soft-yellow: #f7c531;
  --desktop-bg-color: rgba(224, 226, 222, 0.34);
  --desktop-pan-x: 0px;
  --desktop-pan-y: 0px;
  --desktop-bg-x: 0px;
  --desktop-bg-y: 0px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  color: #302d28;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 255, 255, 0.9) 0, rgba(245, 239, 226, 0.78) 47%, rgba(220, 224, 218, 0.86) 100%),
    linear-gradient(135deg, #f6efe1 0%, #dfe8e7 46%, #efe5d2 100%);
  overflow: hidden;
}

body.pen-tool-active .notebook-shell,
body.pen-tool-active .notebook-shell * {
  cursor: var(--active-tool-cursor, crosshair) !important;
}

body.eraser-tool-active .notebook-shell,
body.eraser-tool-active .notebook-shell * {
  cursor: none !important;
}

body.desktop-sticker-mode .notebook-shell {
  cursor: crosshair;
}

body:not(.pen-tool-active):not(.eraser-tool-active):not(.desktop-sticker-mode) .notebook-shell {
  cursor: default;
}

body:not(.pen-tool-active):not(.eraser-tool-active):not(.desktop-sticker-mode) .book {
  cursor: default;
}

body:not(.desktop-panning) .page-layer,
body:not(.desktop-panning) .document-editor-layer,
body:not(.desktop-panning) .diary-page,
body:not(.desktop-panning) .text-layer,
body:not(.desktop-panning) .page-editor,
body:not(.desktop-panning) .cover-editor {
  cursor: text;
}

body.desktop-pan-ready .notebook-shell,
body.desktop-pan-ready .book {
  cursor: grab;
}

body.desktop-panning,
body.desktop-panning * {
  cursor: grabbing !important;
  user-select: none !important;
}

body.desktop-panning .page-arrow,
body.desktop-returning .page-arrow,
body.desktop-panning .floating-sheet,
body.desktop-panning .desktop-sticker,
body.desktop-panning .desktop-image,
body.desktop-panning .floating-note {
  transition: none !important;
}

body.desktop-connect-mode .desktop-sticker,
body.desktop-connect-mode .desktop-image,
body.desktop-connect-mode .floating-sheet {
  cursor: crosshair;
}

button,
input {
  font: inherit;
}

.app {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 0;
}

.notebook-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background: #e7e9e6;
  box-shadow: none;
  overflow: hidden;
}

.notebook-shell::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5760px;
  height: 3240px;
  transform: translate(calc(-50% + var(--desktop-pan-x)), calc(-50% + var(--desktop-pan-y)));
  transform-origin: center;
  background:
    linear-gradient(var(--desktop-bg-color), var(--desktop-bg-color)),
    url("desktop-texture.png") 0 0 / 720px 720px repeat;
  background-blend-mode: multiply, normal;
  box-shadow: 0 0 80px rgba(42, 44, 40, 0.08);
  pointer-events: none;
  will-change: transform;
}

.book {
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(116vw, 136vh);
  aspect-ratio: 7360 / 4912;
  transform: translate(calc(-50% + var(--desktop-pan-x)), calc(-50% + var(--desktop-pan-y)));
  transform-origin: center;
  user-select: none;
  -webkit-user-select: none;
}

.book.turn-next,
.book.turn-prev {
  animation: none;
}

@keyframes pageTurnNext {
  0% {
    filter: none;
    transform: translate(-50%, -50%) perspective(900px) rotateY(0deg);
  }
  48% {
    filter: brightness(0.94) blur(0.2px);
    transform: translate(-51.5%, -50%) perspective(900px) rotateY(-5deg) scale(0.994);
  }
  100% {
    filter: none;
    transform: translate(-50%, -50%) perspective(900px) rotateY(0deg);
  }
}

@keyframes pageTurnPrev {
  0% {
    filter: none;
    transform: translate(-50%, -50%) perspective(900px) rotateY(0deg);
  }
  48% {
    filter: brightness(0.94) blur(0.2px);
    transform: translate(-48.5%, -50%) perspective(900px) rotateY(5deg) scale(0.994);
  }
  100% {
    filter: none;
    transform: translate(-50%, -50%) perspective(900px) rotateY(0deg);
  }
}

.book-bg {
  position: absolute;
  left: -9%;
  top: -9%;
  width: 118%;
  height: 118%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -moz-user-select: none;
  z-index: 0;
}

.book-page-mask,
.book-frame {
  position: absolute;
  left: -9%;
  top: -9%;
  width: 118%;
  height: 118%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.book-page-mask {
  z-index: 12;
}

.book-frame {
  z-index: 40;
}

.book-frame[hidden] {
  display: none;
}

.book.frame-turning .page-layer {
  opacity: 0;
}

.book.frame-turning .book-page-mask {
  z-index: 8300;
}

.book.frame-turning .book-frame {
  z-index: 8400;
}

.text-layer,
.page-editor,
.cover-editor,
.cover-title-input,
.page-title-input {
  user-select: text;
  -webkit-user-select: text;
}

.page-layer {
  position: absolute;
  z-index: 20;
  top: 12.4%;
  height: 75.8%;
  overflow: hidden;
  border-radius: 5% 3% 4% 5% / 4% 3% 4% 5%;
  touch-action: none;
}

.page-layer::before {
  display: none;
}

.left-page {
  left: 12.5%;
  width: 36.9%;
}

.right-page {
  left: 50.25%;
  width: 36.9%;
}

canvas,
.text-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

canvas {
  z-index: 1;
  cursor: text;
}

.text-layer {
  z-index: 2;
  pointer-events: auto;
}

.cover-spread .left-page,
.cover-spread .right-page {
  overflow: hidden;
}

.cover-spread .left-page canvas,
.cover-spread .right-page canvas {
  display: none;
}

.cover-inside {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.16), transparent 30%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.14)),
    var(--cover-color);
  box-shadow: inset -18px 0 32px rgba(44, 34, 25, 0.2), inset 0 0 0 1px rgba(40, 31, 23, 0.08);
}

.cover-inside::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.32) 0 1px, transparent 1.5px) 0 0 / 18px 18px,
    linear-gradient(90deg, rgba(0, 0, 0, 0.12), transparent 14%, transparent 100%);
}

.cover-inside span {
  position: relative;
  max-width: 72%;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(16px, 1.7vw, 30px);
  font-weight: 800;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
  transform: rotate(-4deg);
}

.cover-title-input {
  position: absolute;
  z-index: 6;
  left: 19%;
  right: 15%;
  top: 18.4%;
  height: 7%;
  border: 0;
  border-bottom: 1px solid rgba(113, 93, 78, 0.16);
  outline: 0;
  background: transparent;
  color: rgba(48, 41, 33, 0.78);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(13px, 1vw, 19px);
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
  caret-color: var(--photo-red);
}

.cover-editor {
  --cover-line-step: 2.36em;
  position: absolute;
  left: 19%;
  right: 15%;
  top: 27.8%;
  height: 38.6%;
  outline: 0;
  border: 0;
  color: rgba(46, 39, 31, 0.86);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(9px, 0.68vw, 13px);
  line-height: var(--cover-line-step);
  overflow: hidden;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent calc(var(--cover-line-step) - 1px),
      rgba(125, 102, 82, 0.18) calc(var(--cover-line-step) - 1px),
      rgba(125, 102, 82, 0.18) var(--cover-line-step)
    );
  caret-color: var(--photo-red);
}

.cover-editor div {
  min-height: var(--cover-line-step);
}

.cover-editor:empty::before {
  content: "для кого этот блокнот...";
  color: rgba(78, 70, 61, 0.34);
}

.page-editor {
  position: absolute;
  inset: 14% 7.5% 7% 8.8%;
  display: block;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 11pt;
  line-height: 1.25;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  overflow: hidden;
  caret-color: var(--photo-red);
  text-shadow: 0 0 0.2px rgba(35, 31, 27, 0.48);
  pointer-events: auto;
}

.draw-mode .page-editor {
  pointer-events: none;
}

.right-page .page-editor {
  inset: 14% 7.4% 8.5% 6.8%;
}

.document-editor-layer {
  position: absolute;
  left: var(--doc-layer-left, 0);
  top: var(--doc-layer-top, 0);
  width: var(--doc-layer-width, 100%);
  height: var(--doc-layer-height, 100%);
  z-index: 22;
  overflow: visible;
  pointer-events: none;
}

.document-editor-layer.active {
  pointer-events: auto;
}

.diary-spread {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--doc-page-width, 360px) var(--doc-page-width, 360px);
  column-gap: var(--doc-page-gap, 72px);
  align-items: start;
  width: calc(var(--doc-page-width, 360px) * 2 + var(--doc-page-gap, 72px));
  height: var(--doc-page-height, 58%);
  overflow: visible;
}

.diary-page {
  position: relative;
  min-width: 0;
}

.document-editor-container {
  position: relative;
  top: 0;
  left: auto;
  display: block;
  width: var(--doc-page-width, 360px);
  max-width: none;
  min-height: var(--doc-page-height, 58%);
  height: var(--doc-page-height, 58%);
  max-height: var(--doc-page-height, 58%);
  overflow: hidden;
  color: var(--ink);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 11pt;
  line-height: var(--doc-line-height, 18px);
  caret-color: var(--photo-red);
  text-shadow: 0 0 0.2px rgba(35, 31, 27, 0.48);
  user-select: text;
  -webkit-user-select: text;
}

.document-editor-container.right {
  --doc-container-left: 0;
}

.page-overflow-hint {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  z-index: 3;
  text-align: center;
  font-size: 11px;
  color: rgba(150, 100, 50, 0.6);
  font-style: italic;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.page-overflow-hint[hidden] {
  display: none;
}

.page-overflow-hint.visible {
  opacity: 1;
}

.paste-distribution-status {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(125, 103, 68, 0.18);
  border-radius: 999px;
  background: rgba(255, 254, 240, 0.94);
  color: rgba(62, 48, 31, 0.82);
  box-shadow: 0 12px 30px rgba(39, 32, 20, 0.16);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.paste-distribution-status::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(152, 111, 52, 0.36);
  border-top-color: rgba(152, 111, 52, 0.95);
  animation: pasteDistributionSpin 720ms linear infinite;
}

.paste-distribution-status[hidden] {
  display: none;
}

.paste-distribution-status.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes pasteDistributionSpin {
  to {
    transform: rotate(360deg);
  }
}

.diary-tiptap-editor {
  min-height: 100%;
  width: 100%;
  outline: 0;
  position: relative;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  height: 100%;
  max-height: var(--doc-page-height, 58%);
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
}

.diary-tiptap-editor h1 {
  font-size: 24pt;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 24pt;
  margin-bottom: 12pt;
  color: var(--text-primary, #1a1a1a);
}

.diary-tiptap-editor h2 {
  font-size: 18pt;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 18pt;
  margin-bottom: 8pt;
}

.diary-tiptap-editor h3 {
  font-size: 14pt;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 12pt;
  margin-bottom: 6pt;
}

.diary-tiptap-editor p {
  font-size: 11pt;
  line-height: 1.25;
  margin: 0 0 6pt 0;
}

.diary-tiptap-editor ul,
.diary-tiptap-editor ol,
.diary-tiptap-editor blockquote {
  margin: 0 0 6pt;
}

.diary-tiptap-editor ul,
.diary-tiptap-editor ol {
  padding-left: 1.55em;
}

.diary-tiptap-editor ul[data-type="taskList"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

.diary-tiptap-editor ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0;
}

.diary-tiptap-editor ul[data-type="taskList"] li > label {
  flex-shrink: 0;
  margin-top: 4px;
  user-select: none;
  cursor: pointer;
}

.diary-tiptap-editor ul[data-type="taskList"] li > label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(52, 47, 42, 0.42);
  border-radius: 3px;
  background: rgba(255, 252, 241, 0.86);
  cursor: pointer;
  display: inline-block;
  margin: 0;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.diary-tiptap-editor ul[data-type="taskList"] li > label input[type="checkbox"]:hover {
  border-color: rgba(52, 47, 42, 0.72);
}

.diary-tiptap-editor ul[data-type="taskList"] li > label input[type="checkbox"]:checked {
  background: var(--blue-ink);
  border-color: var(--blue-ink);
  box-shadow: none;
}

.diary-tiptap-editor ul[data-type="taskList"] li > label input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 0;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.diary-tiptap-editor ul[data-type="taskList"] li > label > span {
  display: none;
}

.diary-tiptap-editor ul[data-type="taskList"] li > div {
  flex: 1;
  min-width: 0;
}

.diary-tiptap-editor ul[data-type="taskList"] li > div > p {
  margin: 0;
}

.diary-tiptap-editor ul[data-type="taskList"] li[data-checked="true"] > div,
.diary-tiptap-editor ul[data-type="taskList"] li[data-checked="true"] > div > p,
.diary-tiptap-editor ul[data-type="taskList"] li[data-checked="true"] > div * {
  color: rgba(52, 47, 42, 0.48);
  text-decoration: line-through;
  text-decoration-thickness: 1.4px;
}

.diary-tiptap-editor mark {
  background: rgba(255, 225, 92, 0.58);
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.diary-tiptap-editor img[data-wrap] {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
  cursor: pointer;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"] {
  max-width: 100%;
  vertical-align: middle;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"] [data-resize-wrapper] {
  max-width: 100%;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"] img {
  display: block;
  max-width: 100%;
  height: auto;
}

.diary-tiptap-editor .ProseMirror-selectednode,
.diary-tiptap-editor [data-node-view-wrapper].ProseMirror-selectednode img {
  outline: 2px solid var(--blue-ink);
  outline-offset: 3px;
}

.diary-tiptap-editor [data-resize-handle],
.diary-tiptap-editor .resize-handle {
  width: 10px;
  height: 10px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(52, 47, 42, 0.42);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(38, 32, 25, 0.24);
}

.diary-tiptap-editor [data-resize-handle="top-right"],
.diary-tiptap-editor [data-resize-handle="bottom-left"] {
  cursor: nesw-resize;
}

.diary-tiptap-editor [data-resize-handle="top-left"],
.diary-tiptap-editor [data-resize-handle="bottom-right"] {
  cursor: nwse-resize;
}

.diary-tiptap-editor img[data-wrap="inline"] {
  display: inline-block;
  vertical-align: middle;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="inline"]) {
  display: inline-flex !important;
  vertical-align: middle;
}

.diary-tiptap-editor img[data-wrap="square"][data-align="left"] {
  float: left;
  margin: 0 16px 12px 0;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="square"][data-align="left"]) {
  float: left;
  margin: 0 16px 12px 0;
}

.diary-tiptap-editor img[data-wrap="square"][data-align="center"] {
  display: block;
  margin: 0 auto 12px;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="square"][data-align="center"]) {
  display: flex !important;
  width: fit-content;
  margin: 0 auto 12px;
}

.diary-tiptap-editor img[data-wrap="square"][data-align="right"] {
  float: right;
  margin: 0 0 12px 16px;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="square"][data-align="right"]) {
  float: right;
  margin: 0 0 12px 16px;
}

.diary-tiptap-editor img[data-wrap="tight"][data-align="left"] {
  float: left;
  margin: 0 16px 12px 0;
  shape-outside: url(attr(src));
  shape-image-threshold: 0.5;
  shape-margin: 8px;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="tight"][data-align="left"]) {
  float: left;
  margin: 0 16px 12px 0;
  shape-outside: margin-box;
  shape-margin: 8px;
}

.diary-tiptap-editor img[data-wrap="tight"][data-align="center"] {
  display: block;
  margin: 0 auto 12px;
  shape-image-threshold: 0.5;
  shape-margin: 8px;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="tight"][data-align="center"]) {
  display: flex !important;
  width: fit-content;
  margin: 0 auto 12px;
  shape-margin: 8px;
}

.diary-tiptap-editor img[data-wrap="tight"][data-align="right"] {
  float: right;
  margin: 0 0 12px 16px;
  shape-outside: url(attr(src));
  shape-image-threshold: 0.5;
  shape-margin: 8px;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="tight"][data-align="right"]) {
  float: right;
  margin: 0 0 12px 16px;
  shape-outside: margin-box;
  shape-margin: 8px;
}

.diary-tiptap-editor img[data-wrap="topBottom"] {
  display: block;
  margin: 16px auto;
  clear: both;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="topBottom"]) {
  display: flex !important;
  width: fit-content;
  margin: 16px auto;
  clear: both;
}

.diary-tiptap-editor img[data-wrap="behind"] {
  position: relative;
  z-index: 0;
  opacity: 0.52;
  pointer-events: auto;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="behind"]) {
  position: relative;
  display: inline-flex !important;
  height: 0;
  overflow: visible;
  vertical-align: top;
  z-index: 0;
  opacity: 0.52;
  pointer-events: auto;
}

.diary-tiptap-editor img[data-wrap="inFront"] {
  position: relative;
  z-index: 3;
  pointer-events: auto;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"]:has(img[data-wrap="inFront"]) {
  position: relative;
  display: inline-flex !important;
  height: 0;
  overflow: visible;
  vertical-align: top;
  z-index: 3;
  pointer-events: auto;
}

.diary-tiptap-editor:has(img[data-wrap="behind"]) > *:not([data-resize-container]),
.diary-tiptap-editor:has(img[data-wrap="inFront"]) > *:not([data-resize-container]) {
  position: relative;
  z-index: 1;
}

.diary-tiptap-editor img[data-wrap="sticker"] {
  max-width: none;
  cursor: move;
  box-shadow: 0 8px 18px rgba(38, 32, 25, 0.18);
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"][data-wrap="sticker"] {
  position: absolute !important;
  z-index: 5;
  display: inline-flex !important;
  max-width: none;
  cursor: move;
  touch-action: none;
}

.diary-tiptap-editor img[data-wrap="left"],
.diary-tiptap-editor [data-resize-container][data-node="customImage"][data-wrap="left"] {
  float: left;
  margin: 0 16px 12px 0;
  shape-outside: margin-box;
  clear: none;
}

.diary-tiptap-editor img[data-wrap="right"],
.diary-tiptap-editor [data-resize-container][data-node="customImage"][data-wrap="right"] {
  float: right;
  margin: 0 0 12px 16px;
  shape-outside: margin-box;
  clear: none;
}

.diary-tiptap-editor img[data-wrap="topBottom"],
.diary-tiptap-editor [data-resize-container][data-node="customImage"][data-wrap="topBottom"] {
  display: flex !important;
  width: fit-content;
  max-width: 100%;
  margin: 16px auto;
  clear: both;
}

.diary-tiptap-editor [data-resize-container][data-node="customImage"].image-sticker-dragging {
  z-index: 15;
  filter: drop-shadow(0 12px 22px rgba(38, 32, 25, 0.24));
}

.diary-tiptap-editor [data-resize-handle="top"],
.diary-tiptap-editor [data-resize-handle="bottom"] {
  cursor: ns-resize;
}

.diary-tiptap-editor [data-resize-handle="left"],
.diary-tiptap-editor [data-resize-handle="right"] {
  cursor: ew-resize;
}

.image-layout-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: min(620px, calc(100vw - 24px));
  padding: 7px 8px;
  border: 1px solid rgba(52, 47, 42, 0.2);
  border-radius: 6px;
  background: rgba(255, 250, 238, 0.96);
  box-shadow: 0 10px 24px rgba(38, 32, 25, 0.2);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  z-index: 150;
}

.image-layout-menu span {
  margin-right: 4px;
  color: rgba(52, 47, 42, 0.62);
  white-space: nowrap;
}

.image-layout-menu button {
  border: 1px solid rgba(52, 47, 42, 0.22);
  border-radius: 4px;
  background: rgba(255, 252, 241, 0.9);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  width: 32px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
}

.image-layout-menu button:hover {
  border-color: var(--blue-ink);
  color: var(--blue-ink);
}

.image-layout-menu button.active {
  border-color: var(--blue-ink);
  background: rgba(31, 136, 168, 0.12);
}

.image-layout-menu button.active .wrap-icon::before {
  background: var(--blue-ink);
  border-color: var(--blue-ink);
}

.wrap-icon {
  position: relative;
  display: block;
  width: 22px;
  height: 20px;
}

.wrap-icon::before,
.wrap-icon::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.wrap-icon::before {
  border-radius: 2px;
  background: rgba(31, 136, 168, 0.78);
  border: 1px solid rgba(31, 136, 168, 0.95);
}

.wrap-icon::after {
  height: 12px;
  width: 18px;
  border-top: 2px solid rgba(52, 47, 42, 0.55);
  border-bottom: 2px solid rgba(52, 47, 42, 0.55);
}

.wrap-icon-inline::before {
  left: 7px;
  top: 5px;
  width: 8px;
  height: 8px;
}

.wrap-icon-inline::after {
  left: 2px;
  top: 4px;
}

.wrap-icon-square::before,
.wrap-icon-tight::before {
  left: 2px;
  top: 4px;
  width: 9px;
  height: 9px;
}

.wrap-icon-square::after {
  right: 1px;
  top: 3px;
  width: 9px;
}

.wrap-icon-tight::before {
  border-radius: 50%;
}

.wrap-icon-tight::after {
  right: 1px;
  top: 3px;
  width: 9px;
  border-top-style: dotted;
  border-bottom-style: dotted;
}

.wrap-icon-top-bottom::before {
  left: 7px;
  top: 6px;
  width: 8px;
  height: 8px;
}

.wrap-icon-top-bottom::after {
  left: 2px;
  top: 2px;
  height: 16px;
}

.wrap-icon-behind::before,
.wrap-icon-front::before {
  left: 7px;
  top: 5px;
  width: 9px;
  height: 9px;
}

.wrap-icon-behind::before {
  opacity: 0.45;
}

.wrap-icon-behind::after,
.wrap-icon-front::after {
  left: 2px;
  top: 4px;
  width: 18px;
}

.wrap-icon-front::before {
  z-index: 2;
  box-shadow: 0 1px 3px rgba(38, 32, 25, 0.24);
}

.wrap-icon-sticker::before {
  left: 7px;
  top: 5px;
  width: 9px;
  height: 9px;
  box-shadow: 0 2px 3px rgba(38, 32, 25, 0.24);
}

.wrap-icon-sticker::after {
  left: 2px;
  top: 4px;
  width: 18px;
  border-top-style: dashed;
  border-bottom-style: dashed;
}

.wrap-icon-left::before {
  left: 2px;
  top: 4px;
  width: 9px;
  height: 9px;
}

.wrap-icon-left::after {
  right: 1px;
  top: 3px;
  width: 9px;
}

.wrap-icon-right::before {
  right: 2px;
  top: 4px;
  width: 9px;
  height: 9px;
}

.wrap-icon-right::after {
  left: 1px;
  top: 3px;
  width: 9px;
}

.image-context-menu,
.desktop-image-context-menu {
  position: fixed;
  z-index: 12060;
  display: grid;
  gap: 3px;
  min-width: 210px;
  padding: 7px;
  border: 1px solid rgba(52, 47, 42, 0.22);
  border-radius: 7px;
  background: rgba(255, 250, 238, 0.98);
  box-shadow: 0 16px 36px rgba(38, 32, 25, 0.24);
  font-family: "Segoe UI", Arial, sans-serif;
}

.image-context-menu[hidden],
.desktop-image-context-menu[hidden] {
  display: none;
}

.image-context-menu button,
.desktop-image-context-menu button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: 600 13px/1.2 "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.image-context-menu button:hover,
.image-context-menu button.active,
.desktop-image-context-menu button:hover,
.desktop-image-context-menu button.active {
  background: rgba(31, 136, 168, 0.12);
  color: var(--blue-ink);
}

.document-page-editor {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--doc-page-width, 360px);
  height: var(--doc-page-height, 58%);
  display: block;
  resize: none;
  outline: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 11pt;
  line-height: 1.25;
  white-space: pre;
  overflow: hidden;
  overflow-wrap: normal;
  word-break: normal;
  caret-color: var(--photo-red);
  text-shadow: 0 0 0.2px rgba(35, 31, 27, 0.48);
  padding: 0;
}

.document-editor:empty::before {
  content: "Пишите здесь...";
  color: rgba(54, 47, 40, 0.38);
}

.document-editor h1,
.document-editor h2,
.document-editor h3 {
  margin: 0 0 0.25em;
  font-weight: 800;
  line-height: 1.25;
}

.document-editor h1 {
  font-size: 1.9em;
}

.document-editor h2 {
  font-size: 1.45em;
}

.document-editor h3 {
  font-size: 1.18em;
}

.document-page-editor.right {
  left: calc(var(--doc-page-width, 360px) + var(--doc-page-gap, 72px));
}

.document-page-editor::placeholder {
  color: rgba(54, 47, 40, 0.34);
}

.document-page-flow {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--doc-page-width, 360px);
  height: var(--doc-page-height, 58%);
  overflow: hidden;
  pointer-events: auto;
}

.document-page-flow.right {
  left: calc(var(--doc-page-width, 360px) + var(--doc-page-gap, 72px));
}

.document-line {
  position: absolute;
  left: 0;
  width: 100%;
  min-height: var(--doc-line-height, 18px);
  height: var(--doc-line-height, 18px);
  outline: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 11pt;
  line-height: var(--doc-line-height, 18px);
  white-space: pre;
  overflow: visible;
  overflow-wrap: normal;
  word-break: normal;
  caret-color: var(--photo-red);
  text-shadow: 0 0 0.2px rgba(35, 31, 27, 0.48);
  user-select: text;
  box-sizing: border-box;
}

.document-line.line-h1 {
  font-size: clamp(16px, 1.22vw, 24px);
  font-weight: 850;
}

.document-line.line-h2 {
  font-size: clamp(13px, 1vw, 20px);
  font-weight: 820;
}

.document-line.line-h3 {
  font-size: clamp(11px, 0.88vw, 17px);
  font-weight: 780;
}

.document-line.line-bold {
  font-weight: 800;
}

.document-line.line-italic {
  font-style: italic;
}

.document-line.line-underline {
  text-decoration-line: underline;
  text-decoration-thickness: 1.4px;
}

.document-line.line-strike {
  text-decoration-line: line-through;
  text-decoration-thickness: 1.5px;
}

.document-line.line-align-center {
  text-align: center;
}

.document-line.line-align-right {
  text-align: right;
}

.document-line.line-list {
  padding-left: calc(1.55em + var(--list-level, 0) * 1.1em);
}

.document-line.line-continuation {
  padding-left: calc(1.55em + var(--list-level, 0) * 1.1em);
}

.document-line.line-list::before {
  content: attr(data-list-label);
  position: absolute;
  left: calc(var(--list-level, 0) * 1.1em);
  top: 0;
  width: 1.25em;
  height: var(--doc-line-height, 18px);
  color: rgba(35, 31, 27, 0.9);
  text-align: center;
  line-height: var(--doc-line-height, 18px);
  pointer-events: none;
}

.document-line.line-task::before {
  color: #cf4d43;
  cursor: pointer;
  pointer-events: auto;
}

.document-line.line-task-done {
  color: rgba(35, 31, 27, 0.58);
}

.document-line .inline-bold {
  font-weight: 800;
}

.document-line .inline-italic {
  font-style: italic;
}

.document-line .inline-underline {
  text-decoration-line: underline;
  text-decoration-thickness: 1.4px;
}

.document-line .inline-strike {
  text-decoration-line: line-through;
  text-decoration-thickness: 1.5px;
}

.document-line .inline-underline.inline-strike {
  text-decoration-line: underline line-through;
}

.document-line .inline-highlight {
  background: rgba(255, 225, 92, 0.58);
  border-radius: 2px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.page-title-input {
  position: absolute;
  z-index: 4;
  left: 8.8%;
  right: 7.5%;
  top: 5.2%;
  height: 7%;
  border: 0;
  border-bottom: 1px solid rgba(63, 58, 50, 0.28);
  outline: 0;
  background: transparent;
  color: #28231e;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(10px, 0.78vw, 15px);
  line-height: 1;
}

.right-page .page-title-input {
  left: 7.2%;
  right: 8.5%;
}

.text-layer.day-section-layer .page-title-input {
  height: 8.4%;
  font-size: clamp(13px, 1.08vw, 22px);
  font-weight: 800;
}

.day-fixed-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0;
  pointer-events: none;
}

.day-fixed-title strong {
  font-weight: 800;
  text-align: right;
  pointer-events: auto;
  cursor: pointer;
}

.day-fixed-title strong:hover {
  color: rgba(178, 54, 48, 0.86);
}

.right-page .day-title-input {
  border-bottom: 0;
  color: rgba(43, 38, 32, 0.86);
  text-align: left;
}

.planner-fixed-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 0;
  font-weight: 800;
  pointer-events: none;
}

.month-fixed-title {
  justify-content: flex-start;
  font-size: clamp(12px, 0.95vw, 19px);
  font-weight: 900;
}

.week-fixed-title strong {
  font-weight: 900;
  text-align: right;
}

.right-page .week-note-title {
  border-bottom: 0;
  background-image: radial-gradient(circle, rgba(83, 73, 62, 0.38) 1.15px, transparent 1.25px);
  background-size: 7px 2px;
  background-repeat: repeat-x;
  background-position: left calc(100% - 1px);
}

.day-date-link {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.day-date-link:hover {
  color: rgba(178, 54, 48, 0.86);
}

.page-title-input::placeholder {
  color: rgba(64, 56, 48, 0.34);
}

.corner-page-number {
  position: absolute;
  z-index: 4;
  bottom: 4.4%;
  color: rgba(62, 55, 48, 0.64);
  font-size: clamp(10px, 0.82vw, 15px);
  pointer-events: none;
}

.corner-page-number.left {
  left: 11%;
}

.corner-page-number.right {
  right: 11%;
  bottom: 3.8%;
}

.planner-week-footer {
  position: absolute;
  z-index: 8;
  bottom: 3.2%;
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

.planner-week-footer.left {
  left: 10.5%;
}

.planner-week-footer.right {
  left: 7.5%;
  right: 7.4%;
  justify-content: flex-end;
}

.planner-week-day {
  position: relative;
  min-width: 38px;
  height: 24px;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(62, 55, 48, 0.58);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: clamp(9px, 0.66vw, 12px);
  line-height: 1;
  cursor: pointer;
  transition: color 150ms ease, transform 150ms ease, background 150ms ease;
}

.planner-week-day b {
  font-weight: 800;
}

.planner-week-day:hover {
  color: rgba(44, 39, 34, 0.82);
  transform: translateY(-2px);
}

.planner-week-day.today {
  color: rgba(31, 28, 24, 0.96);
  font-weight: 800;
}

.planner-week-day.today b,
.planner-week-day.today span {
  position: relative;
  z-index: 1;
  font-weight: 800;
}

.planner-week-day.selected::after,
.planner-week-day:hover::after {
  content: "";
  position: absolute;
  inset: -1px 1px 4px;
  border: 1.7px solid rgba(49, 43, 36, 0.72);
  border-radius: 48% 54% 43% 57% / 56% 44% 58% 46%;
  transform: rotate(-7deg);
  pointer-events: none;
}

.planner-week-day.selected::before {
  content: "";
  position: absolute;
  inset: 1px -1px 5px;
  border: 1px solid rgba(49, 43, 36, 0.38);
  border-radius: 54% 43% 58% 46% / 47% 57% 43% 55%;
  transform: rotate(5deg);
  pointer-events: none;
}

.planner-week-day:hover::after {
  border-color: rgba(62, 55, 48, 0.58);
}

.planner-week-day.selected:hover::after {
  border-color: rgba(49, 43, 36, 0.72);
}

.page-editor:empty::before {
  content: "Пишите здесь...";
  color: rgba(78, 70, 61, 0.42);
}

.page-editor h2,
.page-editor h3,
.page-editor p,
.page-editor ul,
.page-editor ol {
  margin-block: 0 0.35em;
}

.page-editor div {
  margin-block: 0;
}

.page-editor div:not(.task-line),
.page-editor p {
  min-height: 1.7em;
}

.page-editor:empty::before {
  content: "" !important;
}

.page-editor[data-side="left"]:empty::before {
  content: "Пишите здесь..." !important;
  color: rgba(78, 70, 61, 0.42);
}

.page-editor h1,
.page-editor h2,
.page-editor h3 {
  display: block;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-weight: 800;
  line-height: 1.25;
  min-height: 1.25em;
}

.page-editor h1 {
  font-size: 1.72em;
  color: #2c2823;
}

.page-editor h2 {
  font-size: 1.38em;
  color: var(--blue-ink);
}

.page-editor h3 {
  font-size: 1.14em;
  color: #302b25;
}

.page-editor ul,
.page-editor ol {
  padding-left: 1.35em;
}

.page-editor li {
  padding-left: 0.2em;
  margin-bottom: 0.08em;
}

.page-editor li::marker {
  color: var(--photo-red);
  font-weight: 700;
}

.page-editor s,
.page-editor strike,
.page-editor del {
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(199, 92, 85, 0.74);
}

.note-table-block {
  position: relative;
  display: block;
  float: left;
  width: var(--table-w, 32%);
  max-width: 100%;
  margin: 0.45em 1.05em 0.85em 0;
  transform: translate(var(--table-x, 0), var(--table-y, 0));
  transform-origin: top left;
  clear: none;
}

.note-table-block.selected-table::before {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px dashed rgba(62, 55, 48, 0.36);
  border-radius: 3px;
  pointer-events: none;
}

.note-table-block.table-dragging,
.note-table-block.table-resizing {
  z-index: 8;
}

.note-table {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.08);
}

.note-table td {
  position: relative;
  min-width: 2.8em;
  min-height: 1.75em;
  height: 1.9em;
  padding: 0.18em 0.35em;
  border: 1px solid rgba(82, 72, 61, 0.22);
  vertical-align: top;
  overflow-wrap: anywhere;
  overflow: visible;
  cursor: default;
}

.note-table td.resize-line-active {
  box-shadow:
    inset -2px 0 0 rgba(31, 136, 168, 0.45),
    inset 0 -2px 0 rgba(31, 136, 168, 0.2);
}

.note-table tr.resize-line-active td {
  box-shadow: inset 0 -2px 0 rgba(31, 136, 168, 0.45);
}

.note-table-block.editing .note-table td {
  cursor: text;
}

.note-table-block.editing .note-table td:focus {
  outline: 1px solid rgba(31, 136, 168, 0.34);
  outline-offset: -1px;
}

.table-move,
.table-col-controls,
.table-row-controls {
  position: absolute;
  z-index: 12;
  opacity: 0;
  transition: opacity 130ms ease, transform 130ms ease;
}

.note-table-block:hover .table-move,
.note-table-block:hover .table-col-controls,
.note-table-block:hover .table-row-controls,
.note-table-block:focus-within .table-move,
.note-table-block:focus-within .table-col-controls,
.note-table-block:focus-within .table-row-controls {
  opacity: 1;
}

.table-move {
  left: -1.5em;
  top: -1.25em;
  cursor: grab;
}

.table-dragging .table-move {
  cursor: grabbing;
}

.table-col-controls {
  left: 50%;
  bottom: -1.65em;
  display: flex;
  gap: 0.25em;
  transform: translateX(-50%);
}

.table-row-controls {
  right: -1.55em;
  top: 50%;
  display: grid;
  gap: 0.18em;
  transform: translateY(-50%);
}

.table-control-btn {
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  padding: 0;
  border: 0;
  outline: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(48, 43, 38, 0.72);
  font: 700 1em/1 "Segoe Print", "Comic Sans MS", cursive;
  cursor: pointer;
}

.table-control-btn:hover {
  color: var(--blue-ink);
  transform: translateY(-1px);
}

.table-col-resize,
.table-row-resize {
  position: absolute;
  z-index: 9;
  display: block;
  background: transparent;
  content: "";
}

.table-col-resize {
  top: -1px;
  right: -4px;
  width: 8px;
  height: calc(100% + 2px);
  cursor: col-resize;
}

.table-row-resize {
  left: -1px;
  bottom: -4px;
  width: calc(100% + 2px);
  height: 8px;
  cursor: row-resize;
}

.table-col-resize:hover {
  background: linear-gradient(90deg, transparent 0 42%, rgba(31, 136, 168, 0.45) 43% 57%, transparent 58%);
}

.table-row-resize:hover {
  background: linear-gradient(180deg, transparent 0 42%, rgba(31, 136, 168, 0.45) 43% 57%, transparent 58%);
}

.task-line {
  display: flex;
  align-items: flex-start;
  gap: 0.15em;
  margin-left: calc(var(--task-indent, 0) * 1.45em);
  min-height: 1.7em;
}

.task-check {
  display: inline-block;
  flex: 0 0 1.4em;
  min-width: 1.4em;
  color: var(--photo-red);
  cursor: pointer;
  user-select: none;
  transform-origin: center;
  transition: transform 140ms ease;
}

.task-text {
  display: inline-block;
  min-width: 0.35em;
  flex: 1 1 auto;
}

.task-check:hover {
  transform: scale(1.18) rotate(-4deg);
}

.task-line.done .task-text {
  color: rgba(44, 39, 34, 0.46);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(199, 92, 85, 0.66);
  opacity: 0.68;
}

.paper-note {
  display: inline-block;
  min-width: 8em;
  max-width: 80%;
  margin: 0.35em 0;
  padding: 0.55em 0.7em 0.65em;
  color: #40372f;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.42), transparent 36%),
    #fff7cf;
  clip-path: polygon(0 5%, 8% 0, 18% 4%, 29% 0, 41% 5%, 55% 1%, 70% 4%, 83% 0, 100% 5%, 98% 100%, 2% 100%);
  box-shadow: 0 5px 12px rgba(64, 50, 32, 0.16);
}

.mindmap-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.mindmap-mode .mindmap-layer {
  pointer-events: auto;
}

.mindmap-layer svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.mindmap-layer path {
  fill: none;
  stroke: rgba(74, 70, 63, 0.72);
  stroke-width: 0.55;
  stroke-linecap: round;
}

.mind-node {
  position: absolute;
  max-width: 24%;
  min-width: 52px;
  padding: 0.25em 0.45em;
  border: 1px solid rgba(74, 70, 63, 0.58);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.74);
  color: #3b3630;
  font-size: clamp(8px, 0.58vw, 12px);
  line-height: 1.25;
  text-align: center;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  outline: 0;
}

.draw-mode .mind-node {
  pointer-events: none;
}

.mindmap-spread-layer {
  position: absolute;
  z-index: 24;
  left: 12.5%;
  top: 12.4%;
  width: 74.65%;
  height: 75.8%;
  pointer-events: none;
}

.book.mindmap-mode .mindmap-spread-layer {
  pointer-events: auto;
  cursor: crosshair;
}

.book.select-mode .mindmap-spread-layer {
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.mindmap-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.mindmap-lines path {
  fill: none;
  stroke: rgba(72, 70, 65, 0.76);
  stroke-width: 1.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.spread-mind-node {
  position: absolute;
  --mind-bg: rgba(255, 252, 244, 0.46);
  --mind-border: rgba(74, 68, 60, 0.18);
  --mind-accent: rgba(72, 70, 65, 0.76);
  --mind-node-width: auto;
  min-width: 0;
  max-width: 190px;
  min-height: 0;
  padding: 0;
  color: #37302a;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: auto;
}

.spread-mind-node.sized {
  width: var(--mind-node-width);
  max-width: var(--mind-node-width);
}

.spread-mind-node.root {
  min-width: 0;
  font-weight: 800;
}

.spread-mind-node.selected .mind-node-text {
  outline: 0;
  box-shadow:
    0 0 0 2px rgba(31, 136, 168, 0.24),
    0 4px 12px rgba(38, 32, 25, 0.1);
}

.spread-mind-node.dragging {
  cursor: grabbing;
  filter: none;
}

.mind-node-text {
  display: inline-block;
  min-height: 1.2em;
  max-width: 190px;
  padding: 0.04em 0.24em 0.08em;
  border-radius: 5px;
  border-bottom: 0;
  outline: 0;
  background: var(--mind-bg);
  box-shadow: inset 0 -2px 0 var(--mind-border);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: grab;
}

.spread-mind-node.sized .mind-node-text {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.mind-free-text-draft {
  position: absolute;
  z-index: 7;
  height: 2.1em;
  border: 1px dashed rgba(31, 136, 168, 0.72);
  border-radius: 5px;
  background: rgba(37, 174, 234, 0.08);
  pointer-events: none;
  transform: translateY(-50%);
}

.mind-node-text:empty::before {
  content: attr(data-placeholder);
  color: rgba(74, 68, 60, 0.38);
  font-style: italic;
}

.spread-mind-node.editing .mind-node-text {
  cursor: text;
  background: rgba(255, 255, 255, 0.72);
}

.spread-mind-node[data-color="sky"] {
  --mind-bg: rgba(195, 232, 250, 0.62);
  --mind-border: rgba(31, 136, 168, 0.34);
}

.spread-mind-node[data-color="mint"] {
  --mind-bg: rgba(199, 239, 211, 0.6);
  --mind-border: rgba(71, 140, 87, 0.32);
}

.spread-mind-node[data-color="rose"] {
  --mind-bg: rgba(255, 210, 214, 0.6);
  --mind-border: rgba(199, 92, 85, 0.32);
}

.spread-mind-node[data-color="amber"] {
  --mind-bg: rgba(255, 229, 158, 0.62);
  --mind-border: rgba(184, 129, 35, 0.32);
}

.spread-mind-node[data-color="violet"] {
  --mind-bg: rgba(221, 210, 251, 0.62);
  --mind-border: rgba(112, 91, 183, 0.34);
}

.spread-mind-node.mind-drop-target .mind-node-text {
  box-shadow:
    0 0 0 2px rgba(31, 136, 168, 0.48),
    inset 0 -2px 0 var(--mind-border);
}

.mind-drop-hint {
  position: absolute;
  z-index: 6;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(31, 136, 168, 0.64);
  background: rgba(255, 255, 255, 0.8);
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: mindDropPulse 520ms ease-in-out infinite alternate;
}

.mind-drop-hint::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 3px solid rgba(84, 84, 80, 0.34);
  border-right: 3px solid rgba(84, 84, 80, 0.34);
  transform: translateY(-50%) rotate(45deg);
}

@keyframes mindDropPulse {
  from { opacity: 0.45; }
  to { opacity: 0.82; }
}

.mind-add {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #231f1b;
  font: 800 19px/16px "Segoe Print", "Comic Sans MS", cursive;
  padding: 0;
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 130ms ease, transform 130ms ease;
  cursor: pointer;
}

.spread-mind-node.selected .mind-add {
  opacity: 1;
  transform: scale(1);
}

.mind-add.right {
  right: 0;
  top: 50%;
  transform: translate(70%, -50%) scale(0.86);
}

.spread-mind-node.selected .mind-add.right {
  transform: translate(70%, -50%) scale(1);
}

.mind-add.bottom {
  left: 50%;
  bottom: -18px;
  transform: translate(-50%, 0) scale(0.86);
}

.spread-mind-node.selected .mind-add.bottom {
  transform: translate(-50%, 0) scale(1);
}

.mind-add.toggle {
  left: 50%;
  top: -18px;
  font-size: 15px;
  transform: translate(-50%, 0) scale(0.86);
}

.spread-mind-node.selected .mind-add.toggle,
.spread-mind-node.collapsed .mind-add.toggle {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.mind-selection-box {
  position: absolute;
  z-index: 4;
  border: 1px dashed rgba(33, 145, 178, 0.78);
  background: rgba(37, 174, 234, 0.08);
  pointer-events: none;
}

.mind-context-menu {
  position: fixed;
  z-index: 9500;
  display: grid;
  gap: 3px;
  min-width: 184px;
  padding: 7px;
  border: 1px solid rgba(52, 47, 42, 0.22);
  border-radius: 7px;
  background: rgba(255, 250, 238, 0.98);
  box-shadow: 0 16px 36px rgba(38, 32, 25, 0.24);
  font-family: "Segoe UI", Arial, sans-serif;
}

.mind-context-menu button {
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink);
  font: 600 12px/1.2 "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.mind-context-menu button:hover {
  background: rgba(31, 136, 168, 0.12);
  color: var(--blue-ink);
}

.mind-context-menu button.danger:hover {
  background: rgba(199, 92, 85, 0.12);
  color: #a03d36;
}

.mind-color-menu {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 5px;
  padding: 5px 2px;
}

.mind-context-menu .mind-color-swatch {
  width: 22px;
  height: 22px;
  min-width: 0;
  padding: 0;
  border: 1px solid rgba(52, 47, 42, 0.18);
  border-radius: 999px;
  background: #fffaf0;
}

.mind-context-menu .mind-color-swatch[data-color="sky"] {
  background: #c3e8fa;
}

.mind-context-menu .mind-color-swatch[data-color="mint"] {
  background: #c7efd3;
}

.mind-context-menu .mind-color-swatch[data-color="rose"] {
  background: #ffd2d6;
}

.mind-context-menu .mind-color-swatch[data-color="amber"] {
  background: #ffe59e;
}

.mind-context-menu .mind-color-swatch[data-color="violet"] {
  background: #ddd2fb;
}

.section-sheet {
  width: 100%;
  height: 100%;
  color: rgba(48, 42, 35, 0.88);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  line-height: 1.15;
}

.section-sheet div,
.section-sheet span {
  min-height: 0 !important;
}

.section-heading {
  margin: 0 0 0.35em;
  color: rgba(36, 31, 26, 0.78);
  font-size: 1.08em;
  font-weight: 800;
  text-align: center;
}

.planner-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  background: rgba(255, 255, 255, 0.05);
}

.planner-table th,
.planner-table td {
  border: 1px solid rgba(83, 73, 62, 0.16);
  vertical-align: top;
}

.planner-table th {
  color: rgba(45, 39, 33, 0.72);
  font-size: 0.82em;
  font-weight: 800;
}

.planner-table td {
  min-width: 0;
  padding: 0.22em 0.28em;
  color: rgba(38, 33, 28, 0.86);
  font-size: 0.82em;
  overflow-wrap: anywhere;
}

.week-sheet {
  height: calc(100% - 0.2em);
}

.week-table thead th {
  position: relative;
  height: 2.8em;
  border-top: 0;
  text-align: center;
}

.week-table thead span {
  display: block;
  color: rgba(34, 70, 110, 0.72);
  font-size: 0.72em;
}

.week-table thead b {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  height: 1.7em;
  margin-top: 0.1em;
  border-radius: 50%;
  color: rgba(31, 28, 24, 0.92);
  font-size: 1.28em;
}

.week-date-button {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.week-date-button:hover span,
.week-date-button:hover b {
  color: rgba(31, 28, 24, 0.92);
}

.week-table thead th.weekend-day span,
.week-table thead th.weekend-day b,
.month-weekdays span:nth-child(6),
.month-weekdays span:nth-child(7),
.month-day.weekend-day b,
.mini-month .weekend-day {
  color: rgba(150, 66, 60, 0.78);
}

.week-table tbody th {
  width: 2.72em;
  padding: 0.1em 0.18em 0.1em 0;
  border-left: 0;
  text-align: left;
  white-space: nowrap;
  line-height: 1;
}

.week-time-col {
  width: 2.72em;
}

.week-table tbody tr {
  height: calc((100% - 2.8em) / 18);
}

.week-table tbody td {
  position: relative;
  height: 1.84em;
}

.week-table thead th.today-date,
.week-table tbody td.week-today-column {
  border-left-color: rgba(31, 136, 168, 0.78) !important;
  border-right-color: rgba(31, 136, 168, 0.78) !important;
  background: rgba(31, 136, 168, 0.018);
}

.week-table thead th.today-date::before,
.week-table tbody td.week-today-column::before {
  content: "";
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.week-table thead th.today-date::before {
  left: -2px;
  right: -2px;
  top: -2px;
  bottom: -1px;
  border: 2px solid rgba(31, 136, 168, 0.92);
  border-bottom: 0;
  border-radius: 7px 7px 0 0 / 8px 6px 0 0;
  transform: rotate(-0.35deg);
}

.week-table tbody td.week-today-column::before {
  left: -2px;
  right: -2px;
  top: -1px;
  bottom: -1px;
  border-left: 2px solid rgba(31, 136, 168, 0.92);
  border-right: 2px solid rgba(31, 136, 168, 0.92);
}

.week-table tbody tr:last-child td.week-today-column::after {
  content: "";
  position: absolute;
  z-index: 3;
  left: -2px;
  right: -2px;
  bottom: -2px;
  height: 0.72em;
  border: 2px solid rgba(31, 136, 168, 0.92);
  border-top: 0;
  border-radius: 0 0 7px 7px / 0 0 8px 6px;
  transform: rotate(0.28deg);
  pointer-events: none;
}

.week-table thead th.today-date span,
.week-table thead th.today-date b {
  color: rgba(28, 101, 156, 0.92);
}

.week-table .time-hour {
  display: inline-block;
  min-width: 0.66em;
  font-size: 1.26em;
  font-weight: 700;
  line-height: 0.86;
  vertical-align: -0.08em;
}

.week-table .time-minutes {
  display: inline-block;
  margin-left: 0;
  font-size: 0.78em;
  line-height: 1;
  vertical-align: baseline;
}

.week-day-title {
  height: 1.55em;
  min-height: 1.55em !important;
  margin: 0.22em auto 0;
  max-width: 92%;
  padding: 0.05em 0.18em 0.08em;
  border-bottom: 1px solid rgba(83, 73, 62, 0.18);
  border-radius: 0.18em;
  background: rgba(255, 246, 178, 0.08);
  color: rgba(39, 34, 29, 0.82);
  font-size: 0.76em;
  font-weight: 800;
  line-height: 1.18;
  outline: 0;
  overflow: hidden;
  white-space: nowrap;
  cursor: text;
}

.week-day-title:focus,
.month-day-title:focus {
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(199, 92, 85, 0.34);
}

.week-slot {
  padding: 0 !important;
}

.week-slot-text {
  width: 100%;
  min-height: 1.5em;
  padding: 0.22em 0.28em;
  outline: 0;
  cursor: text;
}

.week-slot-text:focus {
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(199, 92, 85, 0.34);
}

.month-day-title {
  min-height: 1.35em !important;
  margin-top: 0.15em;
  padding: 0.04em 0.12em;
  border-bottom: 1px solid rgba(83, 73, 62, 0.12);
  color: rgba(45, 39, 33, 0.62);
  font-size: 0.72em;
  line-height: 1.15;
  outline: 0;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  cursor: text;
}

.month-day.muted .month-day-title {
  border-bottom-color: transparent;
  color: rgba(45, 39, 33, 0.26);
  cursor: default;
  pointer-events: none;
}

.week-sheet.no-time .week-table tbody td:first-child,
.week-sheet.no-time .week-table thead th:first-child {
  border-left: 1px solid rgba(83, 73, 62, 0.16);
}

.day-sheet .day-table th {
  position: relative;
  width: 5.65em;
  padding: 0.18em 0.48em 0.18em 0;
  border-left: 0;
  color: rgba(45, 39, 33, 0.8);
  font-size: 1.08em;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
}

.day-sheet .day-table {
  position: relative;
  border-collapse: collapse;
  table-layout: auto;
  border-top: 0;
}

.day-sheet .day-table::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: rgba(83, 73, 62, 0.16);
  pointer-events: none;
}

.day-sheet .time-hour {
  display: inline-block;
  min-width: 0.78em;
  font-size: 1.34em;
  font-weight: 400;
  line-height: 0.86;
  vertical-align: -0.08em;
}

.day-sheet .time-minutes {
  display: inline-block;
  margin-left: 0.03em;
  font-size: 0.92em;
  line-height: 1;
  vertical-align: baseline;
}

.day-sheet .day-table tr.marked-time th {
  color: rgba(112, 37, 34, 0.88);
}

.day-sheet .day-table tr.marked-time th::before,
.day-sheet .day-table tr.marked-time th::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.day-sheet .day-table tr.marked-time th::before {
  left: -0.12em;
  right: 0.24em;
  top: 50%;
  height: 1.42em;
  border: 2px solid rgba(178, 54, 48, 0.86);
  border-radius: 56% 44% 50% 48%;
  transform: translateY(-50%) rotate(-7deg);
}

.day-sheet .day-table tr.marked-time th::after {
  left: 0.2em;
  right: 0.54em;
  top: 52%;
  height: 2px;
  background: rgba(178, 54, 48, 0.84);
  border-radius: 999px;
  transform: rotate(-8deg);
}

.day-sheet .day-table td {
  padding: 0.18em 0.18em 0.18em 0.35em;
  font-size: 1.05em;
}

.day-sheet .day-table tbody tr:first-child th,
.day-sheet .day-table tbody tr:first-child td {
  border-top: 0 !important;
}

.day-slot {
  outline: 0;
  cursor: text;
}

.day-slot:focus {
  background: transparent;
  box-shadow: inset 0 -1px 0 rgba(199, 92, 85, 0.34);
}

.day-sheet .day-table tr {
  height: calc(100% / 18);
}

.day-sheet .day-table tbody tr:last-child th,
.day-sheet .day-table tbody tr:last-child td {
  border-bottom-color: transparent;
}

.task-sync-editor {
  cursor: default;
  overflow: visible;
}

.day-task-sheet {
  display: grid;
  grid-template-rows: minmax(0, var(--schedule-share, 50%)) minmax(0, 1fr);
  gap: 0.34em;
  font-size: 0.98em;
}

.day-task-sheet.schedule-medium {
  gap: 0.42em;
}

.day-task-sheet.schedule-crowded {
  gap: 0.48em;
}

.day-task-sheet .section-heading {
  position: relative;
  margin-bottom: 0.42em;
  padding-top: 0.38em;
  border-top: 0;
  font-size: 1.02em;
}

.day-task-sheet .section-heading::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background-image: radial-gradient(circle, rgba(83, 73, 62, 0.38) 1.15px, transparent 1.25px);
  background-size: 7px 2px;
  background-repeat: repeat-x;
  pointer-events: none;
}

.scheduled-zone,
.unscheduled-zone {
  min-height: 0 !important;
  overflow: hidden;
}

.scheduled-zone {
  padding-bottom: 0.28em;
  border-bottom: 0;
}

.unscheduled-zone {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: visible;
  padding-top: 0.42em;
  border-top: 1px solid rgba(83, 73, 62, 0.2);
}

.free-heading {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.3em;
  margin-bottom: 0.35em;
  padding-bottom: 0;
  border-bottom: 0;
  color: rgba(44, 39, 34, 0.68);
  font-size: 1.02em;
  font-weight: 800;
  text-align: center;
}

.free-heading span {
  grid-column: 2;
}

.free-done-toggle {
  grid-column: 3;
  justify-self: start;
  width: 1.45em;
  height: 1.45em;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(62, 55, 48, 0.62);
  cursor: pointer;
  font: 900 1.05em/1 "Segoe Print", "Comic Sans MS", cursive;
  padding: 0;
  transition: color 140ms ease, transform 140ms ease;
}

.free-done-toggle::before {
  content: none;
}

.free-done-toggle:hover,
.day-task-sheet.done-bottom .free-done-toggle {
  color: rgba(28, 24, 20, 0.9);
  transform: translateY(1px);
}

.synced-day-tasks {
  display: grid;
  gap: 0.18em;
  max-height: calc(100% - 2em);
  overflow: hidden;
}

.unscheduled-day-tasks {
  display: grid;
  align-content: start;
  gap: 0.1em;
  overflow: visible;
  counter-reset: free-task;
}

.scheduled-task {
  position: relative;
  align-items: center;
  gap: 0.3em;
  min-height: 1.54em;
  padding-right: 6.8em;
}

.scheduled-task .task-check {
  flex-basis: 1.42em;
  min-width: 1.42em;
  font-size: 1.02em;
}

.scheduled-task .task-time {
  flex: 0 0 3.7em;
  color: rgba(44, 39, 34, 0.62);
  font-size: 0.88em;
  font-weight: 400;
  user-select: none;
}

.scheduled-task .task-text {
  font-size: 0.96em;
}

.scheduled-next-day,
.unscheduled-next-day {
  position: absolute;
  right: 0;
  top: 50%;
  min-width: 6.2em;
  height: 1.45em;
  display: grid;
  place-items: center;
  padding: 0 0.5em;
  border: 0;
  border-radius: 999px;
  background: rgba(198, 50, 45, 0.1);
  color: rgba(177, 38, 35, 0.92);
  cursor: pointer;
  font: 800 0.62em/1 "Segoe Print", "Comic Sans MS", cursive;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(0.25em, -50%);
  transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.scheduled-task:hover .scheduled-next-day,
.unscheduled-task:hover .unscheduled-next-day,
.scheduled-next-day:focus-visible,
.unscheduled-next-day:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

.scheduled-next-day:hover,
.unscheduled-next-day:hover {
  background: rgba(198, 50, 45, 0.18);
}

.scheduled-task.done .task-time {
  opacity: 0.45;
}

.empty-day-tasks {
  margin-top: 0.4em;
  color: rgba(78, 70, 61, 0.36);
  font-size: 1.02em;
  font-style: italic;
}

.unscheduled-task {
  position: relative;
  display: grid;
  grid-template-columns: 2.15em 1.42em 1.05em minmax(0, 1fr);
  column-gap: 0.1em;
  align-items: center;
  min-height: 1.54em;
  padding-right: 4.58em;
  color: rgba(40, 35, 30, 0.88);
}

.unscheduled-task:not(.empty) {
  counter-increment: free-task;
}

.free-task-number {
  grid-column: 3;
  min-width: 1em;
  color: rgba(82, 74, 64, 0.58);
  font-size: 0.86em;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  text-align: right;
}

.free-task-check {
  grid-column: 2;
  width: 1.38em;
  height: 1.38em;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(82, 74, 64, 0.64);
  cursor: pointer;
  font: 900 1.08em/1 "Segoe UI Symbol", "Segoe UI", sans-serif;
  padding: 0;
  opacity: 0.75;
  transition: color 140ms ease, transform 140ms ease, opacity 140ms ease;
}

.free-task-check:hover {
  color: rgba(42, 36, 30, 0.86);
  opacity: 1;
  transform: scale(1.08);
}

.unscheduled-task:not(.empty) .free-task-number::before {
  content: counter(free-task) ".";
}

.thread-handle {
  grid-column: 1;
  width: 4.8em;
  height: 1.35em;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(21, 19, 17, 0.9);
  cursor: grab;
  font: 800 0.68rem/1 "Segoe Print", "Comic Sans MS", cursive;
  margin-left: -2.35em;
  overflow: visible;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-0.28em);
  transition: opacity 140ms ease, transform 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.unscheduled-task:hover .thread-handle,
.thread-handle:focus-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.thread-handle:hover {
  color: rgba(0, 0, 0, 0.98);
  transform: translateX(0);
}

.unscheduled-next-day {
  right: 0;
  min-width: 5.7em;
  padding: 0 0.42em;
}

.thread-handle:active {
  cursor: grabbing;
}

.free-task-text {
  grid-column: 4;
  position: relative;
  min-height: 1.25em !important;
  outline: 0;
  border-bottom: 0;
  background-image: radial-gradient(circle, rgba(72, 70, 65, 0.32) 1px, transparent 1.15px);
  background-size: 7px 2px;
  background-repeat: repeat-x;
  background-position: left calc(100% - 1px);
  cursor: text;
}

.free-task-text:focus {
  background-image: radial-gradient(circle, rgba(199, 92, 85, 0.5) 1px, transparent 1.15px);
  background-color: transparent;
}

.unscheduled-task.done .free-task-text {
  color: rgba(68, 61, 53, 0.44);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(199, 92, 85, 0.62);
}

.unscheduled-task.empty .free-task-check {
  visibility: hidden;
}

.unscheduled-task.empty .thread-handle {
  visibility: hidden;
}

.unscheduled-task.empty .unscheduled-next-day {
  visibility: hidden;
}

.day-thread-line {
  position: fixed;
  z-index: 95;
  height: 2px;
  border-radius: 99px;
  background: rgba(80, 75, 68, 0.72);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.24);
  pointer-events: none;
  transform-origin: left center;
}

.day-table tr.drop-time-target th,
.day-table tr.drop-time-target td {
  background: rgba(37, 174, 234, 0.13);
  box-shadow: inset 0 0 0 1px rgba(37, 174, 234, 0.28);
}

.month-sheet {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
}

.month-weekdays,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-weekdays span {
  padding: 0.1em 0;
  color: rgba(34, 70, 110, 0.72);
  font-size: 0.76em;
  font-weight: 800;
  text-align: center;
}

.month-grid {
  border-top: 1px solid rgba(83, 73, 62, 0.16);
  border-left: 1px solid rgba(83, 73, 62, 0.16);
}

.month-day {
  position: relative;
  min-height: 4.2em !important;
  padding: 0.22em 0.28em;
  border-right: 1px solid rgba(83, 73, 62, 0.16);
  border-bottom: 1px solid rgba(83, 73, 62, 0.16);
  overflow-wrap: anywhere;
}

.month-day.today-date::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0.12em 0.1em 0.1em;
  border: 1.4px solid rgba(199, 68, 60, 0.82);
  border-radius: 9px 7px 10px 6px / 7px 10px 6px 9px;
  transform: rotate(-2.5deg);
  pointer-events: none;
}

.month-day.today-date::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0.2em 0.18em 0.18em 0.16em;
  border: 0.9px solid rgba(199, 68, 60, 0.5);
  border-radius: 7px 10px 6px 9px / 10px 6px 9px 7px;
  transform: rotate(4deg);
  pointer-events: none;
}

.month-day:not(.muted):hover::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0.12em 0.1em 0.1em;
  border: 1.4px solid rgba(45, 39, 33, 0.72);
  border-radius: 9px 7px 10px 6px / 7px 10px 6px 9px;
  transform: rotate(-2.5deg);
  pointer-events: none;
}

.month-day:not(.muted):hover::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0.2em 0.18em 0.18em 0.16em;
  border: 0.9px solid rgba(45, 39, 33, 0.42);
  border-radius: 7px 10px 6px 9px / 10px 6px 9px 7px;
  transform: rotate(4deg);
  pointer-events: none;
}

.month-day b {
  display: inline-grid;
  place-items: center;
  min-width: 1.35em;
  height: 1.35em;
  margin-bottom: 0.08em;
  border-radius: 50%;
  color: rgba(34, 31, 27, 0.86);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.82em;
  cursor: pointer;
}

.month-day.muted {
  color: rgba(72, 66, 58, 0.28);
  background: rgba(60, 50, 40, 0.025);
}

.month-day.muted b {
  opacity: 0.38;
}

.month-day b,
.mini-day {
  position: relative;
}

.month-day.selected-date b::after,
.mini-day.selected-date::after,
.month-day.important-date b::before,
.mini-day.important-date::before,
.week-table th.important-date b::before,
.day-fixed-title.important-date strong::before {
  content: "";
  position: absolute;
  inset: -0.24em -0.3em;
  border: 2px solid rgba(69, 63, 56, 0.74);
  border-radius: 48% 54% 43% 57%;
  transform: rotate(-8deg);
  pointer-events: none;
}

.month-day.important-date b::before,
.mini-day.important-date::before,
.week-table th.important-date b::before,
.day-fixed-title.important-date strong::before {
  border-color: rgba(178, 54, 48, 0.82);
  border-radius: 54% 43% 58% 46%;
  transform: rotate(7deg);
}

.week-table th.important-date b,
.day-fixed-title.important-date strong {
  position: relative;
}

.year-sheet {
  height: 100%;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0.62em 0.8em;
  height: 100%;
}

.mini-month {
  min-height: 0 !important;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0.14em 0.24em 0.22em;
  border-bottom: 1px solid rgba(83, 73, 62, 0.12);
}

.mini-month strong {
  display: block;
  margin-bottom: 0.16em;
  color: rgba(34, 70, 110, 0.74);
  font-size: 0.76em;
  text-align: center;
}

.mini-month-title {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.mini-month-title:hover {
  color: rgba(178, 54, 48, 0.86);
}

.mini-month div {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-content: center;
  gap: 0.08em 0.1em;
}

.mini-month em,
.mini-month span,
.mini-month .mini-day {
  min-height: 1.28em !important;
  color: rgba(38, 33, 28, 0.78);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.65em;
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.mini-month em {
  color: rgba(34, 70, 110, 0.72);
}

.mini-day {
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font: inherit;
  padding: 0;
  cursor: pointer;
}

.mini-day:hover {
  background: rgba(255, 246, 178, 0.22);
}

.mini-empty {
  pointer-events: none;
}

.page-editor b,
.page-editor strong {
  color: #211d19;
}

.page-editor i,
.page-editor em {
  color: #52635f;
}

.top-toolbar {
  position: absolute;
  z-index: 20;
  top: 2.1%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  padding: 8px 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.top-toolbar .tool-btn[data-tool="pen"],
.top-toolbar .tool-btn[data-tool="eraser"] {
  display: none;
}

.desk-drawing-tools {
  position: absolute;
  z-index: 34;
  left: calc(50% - min(116vw, 136vh) * 0.545);
  top: 25.5%;
  width: 225px;
  height: 440px;
  pointer-events: none;
}

.desk-place {
  position: absolute;
  display: grid;
  place-items: center;
  color: rgba(74, 66, 58, 0.5);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0;
  border: 2px solid rgba(64, 58, 50, 0.34);
  background: rgba(255, 255, 255, 0.025);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.13),
    0 1px 0 rgba(255, 255, 255, 0.2);
  pointer-events: auto;
  user-select: none;
  cursor: pointer;
}

.pencil-place {
  left: 88px;
  top: 32px;
  width: 56px;
  height: 318px;
  border-radius: 999px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(0deg);
}

.eraser-place {
  left: 4px;
  top: 175px;
  width: 86px;
  height: 48px;
  border-radius: 18px;
  transform: rotate(0deg);
}

body.pen-tool-active .pencil-place,
body.eraser-tool-active .eraser-place {
  border-style: dashed;
  border-color: rgba(31, 136, 168, 0.38);
  color: rgba(31, 136, 168, 0.58);
}

.desk-tool {
  position: absolute;
  display: block;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 12px 13px rgba(43, 34, 26, 0.2));
  transition: transform 160ms ease, filter 160ms ease;
}

.desk-tool:focus-visible {
  outline: 2px solid rgba(31, 136, 168, 0.55);
  outline-offset: 8px;
}

.desk-tool:hover {
  filter: drop-shadow(0 16px 16px rgba(43, 34, 26, 0.26));
}

.desk-tool.active {
  filter: drop-shadow(0 18px 18px rgba(31, 136, 168, 0.28));
}

.desk-tool.active:not(.desk-pencil):not(.desk-eraser)::before {
  content: "";
  position: absolute;
  inset: -14px;
  border: 2px solid rgba(31, 136, 168, 0.32);
  border-radius: 999px;
  transform: rotate(-5deg);
  pointer-events: none;
}

.desk-pencil {
  left: 68px;
  top: 12px;
  width: 92px;
  height: 360px;
  transform: rotate(-2deg);
  transform-origin: 50% 70%;
}

.desk-pencil:hover {
  transform: translateY(-7px) rotate(1deg) scale(1.018);
}

.desk-pencil.active {
  filter: none;
  transform: rotate(-2deg);
}

.desk-pencil img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  filter:
    drop-shadow(0 14px 10px rgba(34, 28, 22, 0.24))
    drop-shadow(0 2px 1px rgba(255, 255, 255, 0.2));
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(.2,.8,.25,1),
    filter 180ms ease;
}

.desk-pencil:hover img {
  filter:
    drop-shadow(0 18px 13px rgba(34, 28, 22, 0.3))
    drop-shadow(0 2px 1px rgba(255, 255, 255, 0.2));
}

.desk-pencil.active img {
  opacity: 0;
  transform: translate(-16px, -20px) rotate(-13deg) scale(0.84);
  filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0));
}

.desk-eraser {
  left: -1px;
  top: 170px;
  width: 100px;
  height: 58px;
  transform: rotate(0deg);
}

.desk-eraser:hover {
  transform: translateY(-5px) rotate(-2deg) scale(1.025);
}

.desk-eraser.active {
  filter: none;
  transform: rotate(0deg);
}

.desk-eraser span {
  position: absolute;
  inset: 6px 9px;
  border-radius: 9px 13px 10px 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.7), transparent 38%),
    linear-gradient(90deg, #f5a2b1 0 58%, #f5f0e8 59% 100%);
  box-shadow:
    inset 0 0 0 1px rgba(92, 72, 65, 0.26),
    inset -12px -9px 16px rgba(125, 82, 74, 0.12),
    0 8px 15px rgba(45, 36, 26, 0.22);
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(.2,.8,.25,1),
    box-shadow 180ms ease;
}

.desk-eraser:hover span {
  box-shadow:
    inset 0 0 0 1px rgba(92, 72, 65, 0.26),
    inset -12px -9px 16px rgba(125, 82, 74, 0.12),
    0 12px 18px rgba(45, 36, 26, 0.25);
}

.desk-eraser.active span {
  opacity: 0;
  transform: translate(-12px, -14px) rotate(-16deg) scale(0.86);
}

.desk-eraser span::after {
  content: "";
  position: absolute;
  left: 54%;
  top: 5px;
  bottom: 5px;
  width: 1px;
  background: rgba(93, 75, 70, 0.18);
}

.section-tabs {
  position: absolute;
  z-index: auto;
  top: 3.25%;
  left: 14.25%;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 250px;
  height: 86px;
  transform: none;
  pointer-events: auto;
}

.section-tabs.diary-chapter-palette {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  pointer-events: none;
}

.chapter-tab-source {
  position: absolute;
  left: auto;
  right: -8.8%;
  top: 68%;
  z-index: 1;
  width: 314px;
  height: 112px;
  display: grid;
  place-items: end center;
  padding-bottom: 18px;
  border: 2px solid rgba(51, 46, 38, 0.48);
  border-radius: 49% 51% 46% 54% / 55% 43% 57% 45%;
  color: rgba(53, 47, 39, 0.72);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  transform: rotate(-2deg);
  pointer-events: none;
}

.chapter-tab-source::after {
  content: "";
  position: absolute;
  inset: 10px 14px 12px 12px;
  border: 1px solid rgba(51, 46, 38, 0.2);
  border-radius: 46% 54% 49% 51% / 58% 42% 54% 46%;
  transform: rotate(4deg);
}

.diary-chapter-palette.chapter-return-ready .chapter-tab-source {
  border-color: rgba(31, 136, 168, 0.65);
  box-shadow: 0 0 18px rgba(31, 136, 168, 0.18);
}

.section-tab {
  --paper-color: #f4efe7;
  position: relative;
  z-index: 8;
  width: 52px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px 4px 2px 2px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), transparent 52%),
    var(--paper-color);
  color: rgba(38, 32, 25, 0.86);
  box-shadow: 0 5px 10px rgba(45, 36, 26, 0.18);
  clip-path: polygon(0 9%, 11% 0, 25% 8%, 38% 0, 54% 7%, 69% 0, 83% 8%, 100% 2%, 92% 82%, 8% 82%);
  cursor: pointer;
  transform: translateY(1px) rotate(calc((var(--section-index) - 1.5) * 1.4deg));
  transition: transform 150ms ease, filter 150ms ease, box-shadow 150ms ease, clip-path 150ms ease, height 150ms ease;
}

.diary-chapter-palette .section-tab {
  position: absolute;
  width: 54px;
  height: 76px;
  color: rgba(38, 32, 25, 0.9);
  cursor: grab;
  pointer-events: auto;
  white-space: pre-line;
}

.diary-chapter-palette .section-tab:active {
  cursor: grabbing;
}

.diary-chapter-palette .section-tab.source {
  left: var(--source-left);
  top: var(--source-top);
  width: 48px;
  height: 68px;
  border-radius: 2px;
  transform: rotate(var(--source-rotate));
  box-shadow:
    0 12px 20px rgba(36, 28, 18, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.diary-chapter-palette .section-tab.dragging-origin {
  opacity: 0;
  pointer-events: none;
}

.diary-chapter-palette .section-tab.placed {
  left: var(--tab-left);
  top: 4.8%;
  height: 62px;
  clip-path: polygon(0 8%, 10% 0, 25% 8%, 39% 0, 55% 7%, 70% 0, 84% 8%, 100% 3%, 96% 100%, 4% 100%);
  box-shadow: 0 11px 18px rgba(45, 36, 26, 0.28);
  transform: rotate(var(--tab-rotate));
}

.section-tab:nth-child(1) {
  --paper-color: #20bce2;
}

.section-tab:nth-child(2) {
  --paper-color: #fff4df;
}

.section-tab:nth-child(3) {
  --paper-color: #f4efe7;
}

.section-tab:nth-child(4) {
  --paper-color: #fbf6e8;
}

.section-tab:hover {
  filter: saturate(1.08);
  height: 64px;
  clip-path: polygon(0 8%, 10% 0, 25% 8%, 39% 0, 55% 7%, 70% 0, 84% 8%, 100% 3%, 95% 92%, 5% 92%);
  box-shadow: 0 8px 15px rgba(45, 36, 26, 0.24);
  transform: translateY(1px) rotate(0deg);
}

.section-tab.active {
  z-index: 14;
  height: 72px;
  clip-path: polygon(0 8%, 10% 0, 25% 8%, 39% 0, 55% 7%, 70% 0, 84% 8%, 100% 3%, 96% 100%, 4% 100%);
  filter: saturate(1.12);
  transform: translateY(1px) rotate(-1deg);
  box-shadow: 0 11px 18px rgba(45, 36, 26, 0.3);
}

.diary-chapter-palette .section-tab.source:hover {
  height: 76px;
  filter: saturate(1.08);
  box-shadow:
    0 16px 25px rgba(36, 28, 18, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  transform: translateY(-8px) rotate(var(--source-rotate)) scale(1.04);
}

.diary-chapter-palette .section-tab.placed:hover {
  height: 74px;
  top: 4.4%;
  transform: translateY(-3px) rotate(var(--tab-rotate)) scale(1.03);
}

.diary-chapter-palette .section-tab.placed.active {
  height: 92px;
  top: 4.8%;
  transform: rotate(var(--tab-rotate));
}

.book.frame-turning .diary-chapter-palette .section-tab.placed {
  height: 56px;
  top: 6%;
}

.dragging-section-tab {
  position: fixed;
  z-index: 90;
  width: 52px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 4px 4px 2px 2px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), transparent 52%),
    var(--paper-color, #fff4df);
  color: rgba(38, 32, 25, 0.86);
  box-shadow: 0 16px 28px rgba(45, 36, 26, 0.24);
  clip-path: polygon(0 9%, 11% 0, 25% 8%, 38% 0, 54% 7%, 69% 0, 83% 8%, 100% 2%, 96% 100%, 4% 100%);
  font: 800 15px/1 "Segoe Print", "Comic Sans MS", cursive;
  white-space: pre-line;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(-5deg);
}

.notebook-shell.chapter-drop-ready .book::after {
  content: "";
  position: absolute;
  z-index: 18;
  left: 9%;
  right: 9%;
  top: 8%;
  height: 23%;
  border-radius: 18px 18px 8px 8px;
  background: radial-gradient(ellipse at center, rgba(255, 246, 178, 0.35), rgba(255, 246, 178, 0.06) 68%, transparent 72%);
  box-shadow: 0 0 26px rgba(255, 246, 178, 0.28);
  pointer-events: none;
}

.notebook-shell.chapter-drop-ready .book {
  filter: saturate(1.05) drop-shadow(0 0 16px rgba(255, 246, 178, 0.24));
}

.notebook-shell.chapter-drop-full .book {
  filter: saturate(0.95) drop-shadow(0 0 12px rgba(199, 92, 85, 0.2));
}

.section-tab-icon {
  position: absolute;
  top: auto;
  bottom: 14px;
  left: 0;
  right: 0;
  font-size: 25px;
  line-height: 1;
  white-space: pre-line;
  text-shadow: 0 1px rgba(255, 255, 255, 0.36);
}

.section-tab-text {
  display: none;
}

.section-tab.active .section-tab-text {
  display: none;
}

.section-month .section-tab-icon {
  bottom: 17px;
  font-size: 10.5px;
  font-weight: 900;
}

.section-year .section-tab-icon {
  bottom: 17px;
  font-size: 12.5px;
  font-weight: 900;
}

.section-day .section-tab-icon,
.section-week .section-tab-icon {
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-weight: 900;
}

.section-week .section-tab-icon {
  bottom: 17px;
  font-size: 13px;
}

.emoji-popover[hidden] {
  display: none;
}

.emoji-popover {
  position: absolute;
  top: 58px;
  left: 50%;
  z-index: 40;
  width: 312px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 11px;
  background: rgba(255, 250, 239, 0.95);
  box-shadow: 0 12px 30px rgba(44, 36, 27, 0.22);
  transform: translateX(-50%) rotate(-1deg);
}

.emoji-tabs {
  display: flex;
  gap: 4px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(54, 46, 38, 0.12);
}

.emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 32px);
  gap: 4px;
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.emoji-popover button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
  transition: transform 130ms ease, background 130ms ease;
}

.emoji-popover button:hover {
  background: rgba(48, 41, 32, 0.08);
  transform: translateY(-2px) scale(1.08);
}

.emoji-popover button.active {
  background: rgba(255, 214, 56, 0.28);
}

.tool-btn,
.page-arrow {
  border: 0;
  background: transparent;
  color: #2f2921;
  box-shadow: none;
  cursor: pointer;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
}

.tool-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 700;
  transform: rotate(-1deg);
  transition: transform 150ms ease, box-shadow 150ms ease, color 150ms ease;
}

#textMode {
  width: 64px;
  font-size: 15px;
  line-height: 1;
}

.tool-btn:nth-child(even) {
  transform: rotate(1.5deg);
}

.tool-btn:hover,
.page-arrow:hover {
  box-shadow: none;
  transform: translateY(-1px) rotate(0deg);
}

.tool-btn.active {
  background: transparent;
  color: #0f0d0b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.44);
  box-shadow: none;
}

.tool-btn.active::after {
  content: "";
  position: absolute;
  inset: 4px 2px;
  border: 1.6px solid rgba(53, 47, 39, 0.42);
  border-radius: 48% 52% 46% 54% / 53% 45% 55% 47%;
  transform: rotate(-5deg);
  pointer-events: none;
}

.tool-btn.danger {
  color: #be2432;
}

.strike-tool {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.underline-tool {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.tool-btn.mixed {
  opacity: 0.62;
}

.tool-btn.mixed::after {
  content: "";
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 6px;
  border-bottom: 2px dotted rgba(53, 47, 39, 0.72);
  pointer-events: none;
}

.heading-dropdown {
  position: relative;
  z-index: 30;
}

.heading-dropdown-trigger {
  width: 104px;
  grid-template-columns: minmax(0, 1fr) 10px;
  column-gap: 3px;
  justify-items: start;
  padding: 0 7px;
  font-size: 14px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.heading-dropdown-trigger .heading-dropdown-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heading-dropdown-chevron {
  justify-self: end;
  font: 800 13px/1 "Segoe UI Symbol", "Segoe UI", sans-serif;
  transform: translateY(1px);
}

.heading-dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 5px);
  min-width: 142px;
  display: grid;
  gap: 2px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(255, 252, 241, 0.96);
  box-shadow: 0 10px 22px rgba(43, 35, 26, 0.18);
}

.heading-dropdown-menu[hidden] {
  display: none;
}

.heading-dropdown-option {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #2f2921;
  cursor: pointer;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  letter-spacing: 0;
  line-height: 1.15;
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}

.heading-dropdown-option:hover,
.heading-dropdown-option.active {
  background: rgba(255, 214, 56, 0.24);
}

.heading-dropdown-option[data-command="formatParagraph"] {
  font-size: 12px;
  font-weight: 650;
}

.heading-dropdown-option[data-command="formatHeading1"] {
  font-size: 18px;
  font-weight: 900;
}

.heading-dropdown-option[data-command="formatHeading2"] {
  font-size: 14px;
  font-weight: 820;
}

.heading-dropdown-option[data-command="formatHeading3"] {
  font-size: 11px;
  font-weight: 720;
}

.cursor-tool {
  font-size: 31px;
  font-family: "Segoe UI Symbol", "Segoe UI", sans-serif;
  font-weight: 900;
}

.highlighter-tool {
  color: #2f2921;
  text-shadow: 0 0 0 #fff0a8;
}

.align-tool[data-command="justifyLeft"] {
  justify-items: start;
  padding-left: 12px;
}

.align-tool[data-command="justifyCenter"] {
  font-size: 20px;
}

.align-tool[data-command="justifyRight"] {
  justify-items: end;
  padding-right: 12px;
}

.align-cycle-tool .align-icon {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

.table-tool {
  font-family: "Segoe UI", sans-serif;
  font-size: 23px;
}

.image-tool {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.mark-date-btn {
  width: auto;
  min-width: 86px;
  grid-template-columns: auto auto;
  gap: 0.28em;
  padding: 0 0.55em;
  color: rgba(150, 47, 42, 0.86);
  font-size: 15px;
}

.mark-date-btn span {
  font-size: 18px;
  line-height: 1;
}

.mark-date-btn b {
  font-size: 0.82em;
  line-height: 1;
}

.mark-date-btn.active {
  color: rgba(182, 42, 38, 0.96);
  box-shadow: inset 0 3px 7px rgba(162, 47, 43, 0.22);
}

.tool-btn:disabled {
  opacity: 0.28;
  cursor: default;
  box-shadow: none;
  transform: none;
}

.ink-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #414141;
  border: 5px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.13);
  overflow: hidden;
  cursor: pointer;
}

.ink-dot input {
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.size-control {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 252, 246, 0.48);
}

.size-control span {
  min-width: 18px;
  text-align: center;
  font-weight: 800;
}

.size-control input {
  width: 82px;
}

.page-arrow {
  position: absolute;
  z-index: 7900;
  top: 52%;
  width: 48px;
  height: 66px;
  border-radius: 10px;
  font-size: 52px;
  line-height: 1;
  color: rgba(47, 41, 33, 0.74);
  transition: color 160ms ease;
  will-change: transform;
}

.page-arrow.left {
  left: auto;
  right: calc(50% + min(116vw, 136vh) * 0.382 + 4px);
}

.page-arrow.right {
  right: auto;
  left: calc(50% + min(116vw, 136vh) * 0.382 + 4px);
}

.page-arrow:hover {
  color: rgba(47, 41, 33, 0.94);
  box-shadow: none;
}

.page-arrow.left:hover {
  transform: translateX(-6px) scale(1.08);
}

.page-arrow.right:hover {
  transform: translateX(6px) scale(1.08);
}

.sticker-rail {
  position: absolute;
  z-index: auto;
  top: 12.4%;
  height: 75.8%;
  width: 138px;
  pointer-events: none;
}

.book.frame-turning .sticker-rail {
  z-index: 8;
  pointer-events: none;
}

.book.frame-turning .sticker-rail:has(.sticker-tab.active) {
  z-index: 8;
}

.book.frame-turning .sticker-tab {
  pointer-events: none;
  transition: none !important;
}

.book.frame-turning .sticker-tab.active {
  z-index: 8;
}

.sticker-rail.left {
  left: calc(12.5% - 121px);
}

.sticker-rail.right {
  left: calc(50.25% + 36.9% - 17px);
  right: auto;
}

.sticker-tab {
  position: absolute;
  top: var(--top);
  z-index: 8;
  width: 142px;
  height: 41px;
  border: 0;
  border-radius: 4px;
  background: var(--tab-color);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 5px 9px rgba(20, 20, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  color: rgba(31, 31, 36, 0.82);
  font: 700 11px/1.2 "Segoe Print", "Comic Sans MS", cursive;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  padding: 6px 10px;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
  overflow-wrap: anywhere;
  word-break: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  transform: translateY(-50%) rotate(0.6deg);
  filter: saturate(1.06);
  transform-origin: center center;
  transition:
    transform 450ms cubic-bezier(.2, 1.2, .35, 1),
    box-shadow 260ms ease,
    filter 260ms ease,
    clip-path 260ms ease,
    color 180ms ease;
}

.sticker-rail.right .sticker-tab {
  left: auto;
  right: 0;
  width: 142px;
  height: 44px;
  transform-origin: right center;
  transform: translateY(-50%) translateX(0) rotate(0.6deg);
}

.sticker-rail.left .sticker-tab {
  left: 0;
  width: 142px;
  transform-origin: left center;
  transform: translateY(-50%) translateX(0) rotate(-0.6deg);
}

.sticker-rail.right .sticker-tab:not(.active) {
  clip-path: inset(0 round 4px);
  transform: translateY(-50%) translateX(0) rotate(0deg);
}

.sticker-rail.left .sticker-tab:not(.active) {
  clip-path: inset(0 round 4px);
  transform: translateY(-50%) translateX(0) rotate(0deg);
}

.sticker-tab:hover {
  filter: saturate(1.12) brightness(1.02);
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 8px 14px rgba(20, 20, 32, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.sticker-tab.active {
  z-index: 8200;
  width: 142px;
  clip-path: inset(0);
  color: rgba(31, 31, 36, 0.86);
  box-shadow:
    0 6px 10px rgba(20, 20, 32, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.sticker-tab.dragging-origin {
  opacity: 0.18;
}

.sticker-tab:active {
  cursor: grabbing;
}

.sticker-rail.right .sticker-tab.active {
  width: 142px;
  transform: translateY(-53%) translateX(0) rotate(-0.4deg);
}

.sticker-rail.right .sticker-tab:hover {
  clip-path: inset(0 0 0 0 round 4px);
  transform: translateY(-55%) translateX(0) rotate(-0.6deg);
}

.sticker-rail.left .sticker-tab:hover {
  clip-path: inset(0 0 0 0 round 4px);
  transform: translateY(-55%) translateX(0) rotate(0.6deg);
}

.sticker-rail.right .sticker-tab.active:hover {
  transform: translateY(-56%) translateX(0) rotate(-0.8deg);
}

.sticker-rail.left .sticker-tab.active {
  transform: translateY(-53%) translateX(0) rotate(0.4deg);
}

.sticker-rail.left .sticker-tab.active:hover {
  transform: translateY(-56%) translateX(0) rotate(0.8deg);
}

.sticker-tab.press-bend {
  filter: saturate(1.08) brightness(0.98);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 4px 8px rgba(20, 20, 32, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.38),
    inset 0 -7px 12px rgba(31, 31, 36, 0.14);
}

.sticker-rail.right .sticker-tab.press-bend {
  transform: translateY(-52%) translateX(0) rotate(-0.5deg) scaleX(0.99) scaleY(0.965) skewY(-1deg);
}

.sticker-rail.left .sticker-tab.press-bend {
  transform: translateY(-52%) translateX(0) rotate(0.5deg) scaleX(0.99) scaleY(0.965) skewY(1deg);
}

.notebook-dock {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 8500;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.notebook-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  overflow: visible;
  max-width: none;
}

.notebook-plus,
.notebook-item {
  border: 0;
  cursor: pointer;
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  box-shadow: 0 4px 12px rgba(62, 50, 37, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.notebook-plus {
  width: 40px;
  height: 42px;
  border-radius: 7px;
  background: #302920;
  color: #fff8eb;
  font-size: 28px;
  line-height: 1;
}

.notebook-plus:disabled {
  opacity: 0.36;
  cursor: default;
  transform: none;
}

.notebook-item {
  position: relative;
  width: 62px;
  height: 78px;
  padding: 37px 5px 5px 13px;
  border-radius: 7px 9px 9px 7px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.68) 0 5px, transparent 5px 100%),
    linear-gradient(180deg, rgba(255,255,255,0.16), rgba(0,0,0,0.18)),
    var(--notebook-color);
  color: rgba(255, 255, 255, 0.94);
  overflow: hidden;
  text-align: left;
  white-space: normal;
  line-height: 1.05;
  font-weight: 700;
  transform: rotate(-1deg);
  font-size: 9px;
}

.notebook-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 14px;
  height: 60px;
  background:
    radial-gradient(circle, #151515 0 2px, transparent 2.5px) 3px 0 / 9px 10px repeat-y;
}

.notebook-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  background:
    linear-gradient(110deg, rgba(255,255,255,0.2), transparent 45%, rgba(0,0,0,0.12)),
    url("notebook-cover.png") center / cover no-repeat;
  mix-blend-mode: multiply;
  opacity: 0.22;
  pointer-events: none;
}

.notebook-item:nth-child(even) {
  transform: rotate(1.5deg);
}

.notebook-plus:hover,
.notebook-item:hover,
.notebook-item.active {
  transform: translateY(-3px) rotate(0deg);
  box-shadow: 0 8px 16px rgba(62, 50, 37, 0.24);
}

.notebook-item.active {
  transform: translateX(13px) translateY(-3px) rotate(0deg);
}

.notebook-item.active::after {
  content: "▯";
  inset: auto 7px 7px auto;
  width: 22px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.82) 0 48%, rgba(47,41,33,0.28) 49% 51%, rgba(255,255,255,0.78) 52% 100%);
  color: rgba(48, 41, 32, 0.68);
  font-size: 12px;
  line-height: 1;
  mix-blend-mode: normal;
  opacity: 0.96;
}

.notebook-context-menu {
  position: fixed;
  z-index: 120;
  display: flex;
  gap: 6px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255, 250, 239, 0.96);
  box-shadow: 0 14px 32px rgba(43, 35, 26, 0.24);
  transform: translate(8px, -12px) rotate(-2deg);
}

.notebook-context-menu button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(48, 41, 32, 0.08);
  color: #2f2921;
  cursor: pointer;
  font-size: 18px;
  transition: transform 140ms ease, background 140ms ease;
}

.notebook-context-menu button:hover {
  background: rgba(48, 41, 32, 0.14);
  transform: translateY(-2px);
}

.notebook-context-menu button:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.bookmark-context-menu {
  z-index: 10080;
  width: 238px;
  flex-wrap: wrap;
  align-items: center;
}

.notebook-context-menu .bookmark-menu-action {
  width: auto;
  min-width: 100%;
  padding: 0 12px;
  justify-content: center;
  font-size: 18px;
}

.bookmark-color-swatches {
  display: grid;
  grid-template-columns: repeat(6, 28px);
  gap: 6px;
  width: 100%;
}

.notebook-context-menu .bookmark-color-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(49, 41, 32, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.62), transparent 56%),
    var(--swatch-color);
}

.notebook-context-menu .bookmark-color-swatch.active {
  box-shadow:
    0 0 0 2px rgba(47, 41, 33, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.quick-input-popover {
  position: fixed;
  z-index: 12050;
  width: 260px;
  padding: 13px 14px 12px;
  border-radius: 12px 10px 13px 9px;
  background: rgba(255, 250, 239, 0.97);
  box-shadow: 0 18px 34px rgba(43, 35, 26, 0.24);
  transform: translate(-50%, -50%) rotate(-1deg);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
}

.quick-input-popover::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1.6px solid rgba(53, 47, 39, 0.28);
  border-radius: 49% 51% 47% 53% / 52% 48% 56% 44%;
  pointer-events: none;
}

.quick-input-popover form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
}

.quick-input-popover label {
  display: grid;
  gap: 7px;
  color: rgba(49, 42, 34, 0.78);
  font-size: 14px;
  font-weight: 800;
}

.quick-input-popover input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid rgba(53, 47, 39, 0.26);
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 800 17px/1.25 "Segoe Print", "Comic Sans MS", cursive;
}

.quick-input-popover div {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.quick-input-popover button {
  border: 0;
  background: transparent;
  color: rgba(47, 41, 33, 0.82);
  cursor: pointer;
  font: 900 16px/1 "Segoe Print", "Comic Sans MS", cursive;
}

.quick-input-popover button:hover {
  transform: translateY(-1px);
}

.sticker-fan {
  position: fixed;
  z-index: 31;
  right: 18px;
  bottom: 20px;
  width: 260px;
  height: 168px;
  pointer-events: none;
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease;
}

.sticker-fan::before {
  content: "Закладки";
  position: absolute;
  inset: 8px 4px 4px;
  display: grid;
  place-items: start center;
  padding-top: 5px;
  border: 2px solid rgba(51, 46, 38, 0.42);
  border-radius: 48% 52% 45% 55% / 56% 45% 55% 44%;
  color: rgba(51, 46, 38, 0.68);
  font: 800 14px/1 "Segoe Print", "Comic Sans MS", cursive;
  transform: rotate(-2deg);
}

.sticker-fan.return-ready {
  transform: translateY(-7px) scale(1.03);
  filter: drop-shadow(0 0 14px rgba(255, 246, 178, 0.45));
}

.paper-note-btn {
  position: fixed;
  right: 32px;
  bottom: 128px;
  z-index: 33;
  width: 44px;
  height: 42px;
  border: 0;
  border-radius: 8px 8px 3px 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.35), transparent 45%),
    #fff2a6;
  color: #3b3329;
  box-shadow: 0 8px 16px rgba(45, 36, 26, 0.2);
  cursor: pointer;
  font-size: 24px;
  clip-path: polygon(0 8%, 10% 0, 28% 8%, 44% 1%, 61% 8%, 78% 0, 100% 8%, 96% 100%, 0 100%);
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.paper-note-btn:hover {
  transform: translateY(-3px) rotate(-3deg);
  box-shadow: 0 12px 22px rgba(45, 36, 26, 0.24);
}

.notes-place {
  position: fixed;
  z-index: 31;
  right: 96px;
  top: 168px;
  width: 188px;
  height: 142px;
  display: grid;
  place-items: center;
  color: rgba(51, 46, 38, 0.68);
  font: 700 16px/1.15 "Segoe Print", "Comic Sans MS", cursive;
  text-align: center;
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.notes-place::before {
  content: "";
  position: absolute;
  inset: 26px 10px 8px;
  border: 2px solid rgba(51, 46, 38, 0.42);
  border-radius: 48% 52% 46% 54% / 55% 44% 56% 45%;
  transform: rotate(-4deg);
  pointer-events: none;
}

.notes-place span {
  position: relative;
  z-index: 6;
  pointer-events: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 8px rgba(255, 255, 255, 0.45);
}

.notes-source-stack {
  position: absolute;
  left: 50%;
  top: -44px;
  width: 236px;
  height: 94px;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 2;
}

.note-source-card {
  position: absolute;
  left: calc(10px + var(--note-source-index) * 24px);
  top: calc(5px + var(--note-source-index) * 1.5px);
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 1px;
  background: var(--note-source-color, #ffe29a);
  box-shadow:
    0 12px 20px rgba(36, 28, 18, 0.19),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  transform: rotate(calc((var(--note-source-index) - 3) * -2.5deg));
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 150ms ease;
  animation: noteStackPop 180ms ease both;
}

.note-source-card:hover {
  box-shadow:
    0 16px 24px rgba(36, 28, 18, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
  transform: translateY(-7px) rotate(calc((var(--note-source-index) - 3) * -2.5deg));
}

.floating-notes-layer {
  display: contents;
  position: fixed;
  inset: 0;
  z-index: auto;
  pointer-events: none;
}

.floating-note {
  position: fixed;
  width: var(--note-width, 150px);
  height: var(--note-height, 150px);
  padding: 14px 14px 22px;
  border: 0;
  outline: 0;
  border-radius: 1px;
  background: var(--note-color, #ffe29a);
  color: #5f553f;
  box-shadow:
    0 10px 18px rgba(41, 33, 25, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  font: 600 18px/1.34 "Segoe UI", Arial, sans-serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: hidden;
  cursor: grab;
  pointer-events: auto;
  transform: rotate(0deg);
  user-select: none;
  touch-action: none;
  transition: transform 140ms ease, box-shadow 140ms ease, outline-color 140ms ease;
}

.floating-note:empty::before {
  content: "заметка...";
  color: rgba(56, 47, 41, 0.38);
}

.floating-note.selected {
  filter: saturate(1.08);
  box-shadow: 0 16px 28px rgba(41, 33, 25, 0.24);
}

.floating-note.selected::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1.5px solid rgba(50, 44, 38, 0.46);
  border-radius: 47% 52% 48% 55% / 54% 46% 56% 45%;
  pointer-events: none;
}

.floating-note[contenteditable="true"] {
  cursor: text;
}

.floating-note.dragging {
  cursor: grabbing;
  transform: rotate(2deg) scale(1.02);
}

.floating-note:empty::before {
  content: none;
}

.floating-note::after,
.floating-note.selected::after {
  content: none;
  position: absolute;
  inset: auto;
  left: 12px;
  bottom: 8px;
  border: 0;
  border-radius: 0;
  color: rgba(73, 62, 41, 0.58);
  font: 600 8px/1 "Segoe UI", Arial, sans-serif;
  pointer-events: none;
}

.floating-note[data-empty="true"]::before {
  content: "Пишите здесь...";
  white-space: pre-line;
  color: rgba(91, 78, 52, 0.48);
  pointer-events: none;
}

.floating-note.selected {
  outline: 2px solid #82caff;
  filter: none;
  box-shadow:
    0 12px 22px rgba(41, 33, 25, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.note-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8ed0ff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.82);
  pointer-events: none;
}

.note-handle.top {
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
}

.note-handle.right {
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
}

.note-handle.bottom {
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
}

.note-handle.left {
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
}

.floating-note[contenteditable="true"] {
  cursor: text;
  user-select: text;
  outline: 2px solid #2da9ff;
}

.floating-note.dragging {
  transform: rotate(1deg) scale(1.02);
}

.floating-note {
  font: 700 17px/1.34 "Segoe Print", "Comic Sans MS", cursive;
}

.floating-note::after,
.floating-note.selected::after {
  content: none;
}

.floating-note[data-empty="true"]::before {
  content: "Пишите здесь...";
  color: rgba(65, 54, 38, 0.42);
}

.floating-note:not(.selected)[data-empty="true"]::before {
  content: none;
}

.notes-place::after {
  content: none;
}

.notes-source-stack {
  top: -14px;
  width: 330px;
  height: 120px;
}

.notes-place.taking-note[data-taking-index="0"] .note-source-card[data-source-index="0"],
.notes-place.taking-note[data-taking-index="1"] .note-source-card[data-source-index="1"],
.notes-place.taking-note[data-taking-index="2"] .note-source-card[data-source-index="2"],
.notes-place.taking-note[data-taking-index="3"] .note-source-card[data-source-index="3"],
.notes-place.taking-note[data-taking-index="4"] .note-source-card[data-source-index="4"],
.notes-place.taking-note[data-taking-index="5"] .note-source-card[data-source-index="5"],
.notes-place.taking-note[data-taking-index="6"] .note-source-card[data-source-index="6"] {
  opacity: 0;
  transform: scale(0.84) rotate(var(--note-source-r, 0deg));
}

@keyframes noteStackPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.2) rotate(var(--note-source-r, 0deg));
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(var(--note-source-r, 0deg));
  }
}

.note-source-card {
  left: calc(50% - 46px + var(--note-source-x, 0px));
  top: calc(28px + var(--note-source-y, 0px));
  width: 92px;
  height: 92px;
  z-index: var(--note-source-z, 20);
  border-radius: 4px;
  transform-origin: center center;
  transform: rotate(var(--note-source-r, 0deg));
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 10px 18px rgba(20, 20, 32, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition:
    transform 450ms cubic-bezier(.2, 1.2, .35, 1),
    opacity 180ms ease,
    box-shadow 260ms ease,
    filter 260ms ease;
}

.note-source-card:hover {
  transform: translateY(-12px) rotate(var(--note-source-r, 0deg));
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 30px rgba(20, 20, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  filter: saturate(1.05);
}

.floating-note {
  padding: 0;
  border-radius: 4px;
  color: rgba(31, 31, 36, 0.82);
  font: 600 18px/1.42 "Segoe Print", "Comic Sans MS", cursive;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 10px 20px rgba(20, 20, 32, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  overflow: visible;
  transform-origin: center center;
  transform: scale(var(--note-scale, 1)) rotate(var(--note-rotate, 0deg));
  transition:
    width 170ms ease,
    height 170ms ease,
    transform 80ms linear,
    box-shadow 250ms ease,
    outline-color 140ms ease;
}

.floating-note.selected {
  box-shadow:
    0 0 0 2px rgba(106, 152, 255, 0.95),
    0 16px 32px rgba(20, 20, 32, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note.source-sized {
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 30px rgba(20, 20, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note.dragging {
  cursor: grabbing;
  transform: scale(var(--note-scale, 1)) rotate(var(--note-rotate, 0deg));
  box-shadow:
    0 4px 4px rgba(0, 0, 0, 0.06),
    0 30px 60px rgba(20, 20, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note::after,
.floating-note.selected::after,
.floating-note[data-empty="true"]::before {
  content: none;
}

.floating-note-text {
  position: absolute;
  inset: 16px 16px 18px;
  width: calc(100% - 32px);
  height: calc(100% - 34px);
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.42;
  cursor: text;
}

.floating-note-text[readonly] {
  pointer-events: none;
  cursor: grab;
}

.floating-note-text::placeholder {
  color: rgba(65, 54, 38, 0.42);
  opacity: 1;
}

.notebook-item.active::after {
  display: none !important;
}

@property --sticker-drag-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.fan-sticker {
  --angle: 0deg;
  position: absolute;
  z-index: var(--fan-z, 20);
  left: calc(112px + (var(--fan-index) - 2.5) * 22px);
  bottom: 28px;
  width: 46px;
  height: 124px;
  border: 0;
  border-radius: 4px;
  background: var(--sticker-color);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 10px 20px rgba(20, 20, 32, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
  transform: rotate(var(--fan-angle));
  transform-origin: 50% 118%;
  filter: saturate(1.06);
  transition:
    transform 450ms cubic-bezier(.2, 1.2, .35, 1),
    box-shadow 260ms ease,
    filter 260ms ease;
}

.fan-sticker::before {
  content: none;
}

.fan-sticker {
  font-size: 0;
  color: transparent;
}

.fan-sticker:disabled {
  opacity: 0.35;
  cursor: default;
}

.fan-sticker::after,
.dragging-sticker::after,
.sticker-tab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), transparent 45%, rgba(0, 0, 0, 0.06));
  pointer-events: none;
}

.fan-sticker:hover {
  transform: translateY(-12px) rotate(var(--fan-angle)) scale(1.04);
  filter: saturate(1.12) brightness(1.02);
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 30px rgba(20, 20, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.fan-sticker:active {
  cursor: grabbing;
}

.fan-sticker.dragging-origin {
  opacity: 0;
  transform: translateY(18px) scale(0) rotate(var(--fan-angle));
  pointer-events: none;
}

.fan-sticker.press-bend {
  filter: saturate(1.08) brightness(0.98);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(20, 20, 32, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -10px 16px rgba(31, 31, 36, 0.13);
  transform: rotate(var(--fan-angle)) scaleX(0.985) scaleY(0.965) skewY(-1deg);
}

.dragging-sticker {
  position: fixed;
  z-index: 10050;
  width: var(--drag-sticker-width, 46px);
  height: var(--drag-sticker-height, 128px);
  border-radius: 4px;
  background: var(--sticker-color);
  box-shadow:
    0 4px 4px rgba(0, 0, 0, 0.06),
    0 30px 60px rgba(20, 20, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  pointer-events: none;
  color: rgba(31, 31, 36, 0.82);
  font: 700 11px/1.2 "Segoe Print", "Comic Sans MS", cursive;
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  overflow: hidden;
  filter: saturate(1.08);
  transform: rotate(var(--sticker-drag-angle, -4deg)) scale(1.04);
  transform-origin: var(--sticker-drag-origin, center center);
  transition:
    --sticker-drag-angle 380ms cubic-bezier(.18, .86, .28, 1),
    box-shadow 220ms ease,
    filter 220ms ease;
  animation: none;
}

.dragging-sticker.physics-drag {
  transition:
    box-shadow 160ms ease,
    filter 160ms ease;
}

.dragging-sticker.pendulum-drag {
  transition:
    box-shadow 160ms ease,
    filter 160ms ease;
}

@keyframes flySticker {
  from {
    transform: translate(-50%, -50%) rotate(-6deg) scale(1.05);
  }
  to {
    transform: translate(-50%, -55%) rotate(5deg) scale(1.08);
  }
}

.notebook-shell.drop-ready .book {
  filter: saturate(1.04) drop-shadow(0 0 14px rgba(37, 174, 234, 0.22));
}

.page-status {
  position: fixed;
  right: 24px;
  top: 26px;
  bottom: auto;
  z-index: 31;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
}

.page-status strong {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
}

.page-status span {
  display: block;
}

.page-status .spread-status {
  display: none;
}

.autosave-status {
  color: rgba(49, 42, 34, 0.58);
  font-size: 9px;
}

.autosave-status.saving {
  color: #a26626;
}

.right-tools-rail {
  position: fixed;
  right: 24px;
  top: 50%;
  z-index: 70;
  display: none;
  flex-direction: column;
  gap: 18px;
  transform: translateY(-50%);
  pointer-events: auto;
}

.right-tool-circle {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(248, 244, 232, 0.72);
  color: rgba(38, 32, 25, 0.84);
  box-shadow:
    0 10px 18px rgba(42, 35, 27, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font: 900 17px/1 "Segoe Print", "Comic Sans MS", cursive;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.right-tool-circle:hover {
  transform: translateX(-4px) rotate(-3deg);
  background: rgba(255, 248, 224, 0.9);
}

.right-tool-circle.active {
  background: #fff1a8;
  box-shadow:
    0 12px 22px rgba(42, 35, 27, 0.22),
    0 0 0 2px rgba(49, 43, 35, 0.12);
}

.notes-place,
.sheets-place,
.sticker-fan {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.diary-chapter-palette .chapter-tab-source,
.diary-chapter-palette .section-tab.source {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.diary-chapter-palette .chapter-tab-source {
  pointer-events: none;
}

.trash-zone {
  display: grid;
  place-items: center;
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 9200;
  width: 106px;
  height: 106px;
  border: 0;
  border-radius: 0;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  background: url("trash_0.png") center / contain no-repeat;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  box-shadow: none;
  transform: rotate(0deg);
  transition: transform 160ms ease, filter 160ms ease;
}

.trash-zone.has-trash {
  background-image: url("trash_1.png");
}

.trash-zone:hover:not(.trash-ready) {
  transform: translateY(-3px) scale(1.035);
  filter: saturate(1.08) brightness(1.05);
  animation: trashHoverWiggle 560ms ease-in-out infinite alternate;
}

.trash-zone.trash-ready {
  transform: translateY(-6px) scale(1.08);
  filter: saturate(1.12) brightness(1.12);
  box-shadow: none;
  animation: trashWiggle 260ms ease-in-out infinite alternate;
}

@keyframes trashHoverWiggle {
  from { rotate: -0.8deg; }
  to { rotate: 0.8deg; }
}

@keyframes trashWiggle {
  from { rotate: -2deg; }
  to { rotate: 2deg; }
}

.desktop-trash-absorbing {
  pointer-events: none !important;
  transform: translate(var(--trash-drop-x, 0px), var(--trash-drop-y, 0px)) scale(0.08) rotate(7deg) !important;
  opacity: 0 !important;
  filter: saturate(0.8) brightness(0.9);
  transition:
    transform 260ms cubic-bezier(.28, .92, .36, 1),
    opacity 240ms ease,
    filter 240ms ease !important;
}

.trash-context-menu {
  position: fixed;
  z-index: 9400;
  min-width: 152px;
  padding: 6px;
  border: 1px solid rgba(84, 75, 64, 0.18);
  border-radius: 8px;
  background: rgba(255, 251, 240, 0.94);
  box-shadow: 0 16px 32px rgba(32, 28, 24, 0.22);
  backdrop-filter: blur(8px);
}

.trash-context-menu button {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(48, 42, 35, 0.9);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.trash-context-menu button:hover {
  background: rgba(199, 92, 85, 0.12);
}

.trash-context-menu button:disabled {
  opacity: 0.42;
  cursor: default;
}

.trash-dialog {
  position: fixed;
  right: 22px;
  bottom: 132px;
  z-index: 9400;
  width: min(340px, calc(100vw - 28px));
  max-height: min(430px, calc(100vh - 156px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(84, 75, 64, 0.18);
  border-radius: 8px;
  background: rgba(255, 251, 240, 0.96);
  box-shadow: 0 18px 38px rgba(32, 28, 24, 0.22);
  backdrop-filter: blur(10px);
}

.trash-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 8px;
}

.trash-dialog-header h2 {
  margin: 0;
  color: rgba(46, 40, 34, 0.94);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 700;
}

.trash-dialog-close {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(55, 46, 38, 0.72);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.trash-dialog-close:hover {
  background: rgba(84, 75, 64, 0.1);
}

.trash-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px 10px;
  color: rgba(75, 65, 55, 0.7);
  font-size: 12px;
}

.trash-dialog-clear,
.trash-dialog-restore {
  border: 0;
  border-radius: 6px;
  background: rgba(56, 106, 128, 0.14);
  color: rgba(37, 70, 84, 0.96);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.trash-dialog-clear {
  padding: 6px 8px;
}

.trash-dialog-restore {
  flex: 0 0 auto;
  padding: 7px 9px;
}

.trash-dialog-clear:hover,
.trash-dialog-restore:hover {
  background: rgba(56, 106, 128, 0.22);
}

.trash-dialog-clear:disabled,
.trash-dialog-restore:disabled {
  opacity: 0.42;
  cursor: default;
}

.trash-dialog-list {
  display: grid;
  gap: 6px;
  overflow: auto;
  padding: 0 8px 10px;
}

.trash-dialog-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 9px 8px 9px 10px;
  border: 1px solid rgba(84, 75, 64, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
}

.trash-dialog-item.missing-data {
  opacity: 0.74;
}

.trash-dialog-item-body {
  min-width: 0;
}

.trash-dialog-item-name {
  overflow: hidden;
  color: rgba(42, 36, 31, 0.94);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-dialog-item-meta {
  margin-top: 4px;
  overflow: hidden;
  color: rgba(83, 74, 64, 0.68);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trash-dialog-empty {
  padding: 22px 14px 24px;
  color: rgba(75, 65, 55, 0.68);
  font-size: 13px;
  text-align: center;
}

.eraser-cursor {
  position: fixed;
  z-index: 90;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(68, 55, 48, 0.42);
  border-radius: 6px 9px 7px 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.72), transparent 38%),
    linear-gradient(90deg, rgba(245, 160, 174, 0.9) 0 58%, rgba(248, 243, 234, 0.92) 59% 100%);
  box-shadow: 0 4px 10px rgba(45, 36, 26, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  pointer-events: none;
  opacity: 0;
  transform: translate(-48%, -52%) rotate(180deg);
  transition: opacity 90ms ease, width 90ms ease, height 90ms ease;
}

.eraser-cursor::after {
  content: "";
  position: absolute;
  left: 58%;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: rgba(77, 61, 54, 0.16);
}

.eraser-cursor.visible {
  opacity: 1;
}

.notebook-dialog[hidden] {
  display: none;
}

.notebook-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(42, 38, 32, 0.18);
  backdrop-filter: blur(2px);
}

.notebook-card {
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 10px;
  background: rgba(255, 249, 238, 0.96);
  box-shadow: 0 20px 45px rgba(40, 34, 27, 0.28);
  color: #2f2921;
}

.notebook-card h2 {
  margin: 0 0 14px;
  font-size: 21px;
}

.notebook-card label {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.notebook-card input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(51, 43, 33, 0.34);
  outline: 0;
  padding: 8px 0;
  background: transparent;
  color: #2f2921;
}

.notebook-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.notebook-color-choice {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--choice-color);
  box-shadow: 0 4px 12px rgba(53, 44, 34, 0.18);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.notebook-color-choice:hover,
.notebook-color-choice.active {
  transform: translateY(-3px) rotate(-2deg);
  box-shadow: 0 9px 18px rgba(53, 44, 34, 0.25);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  border: 0;
  border-radius: 8px;
  padding: 8px 14px;
  background: rgba(48, 41, 32, 0.1);
  color: #2f2921;
  cursor: pointer;
}

.dialog-actions button[type="submit"] {
  background: #302920;
  color: #fff8eb;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .app {
    min-height: 100svh;
    padding: 0;
  }

  .notebook-shell {
    width: 100vw;
    height: 100svh;
    max-width: 100vw;
  }

  .top-toolbar {
    gap: 8px;
  }

  .tool-btn {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }

  .control-dock {
    display: none;
  }

  .notebook-dock {
    left: 8px;
    bottom: 8px;
    max-width: 50vw;
  }

  .sticker-fan {
    bottom: 6px;
  }

  .page-status {
    right: 8px;
    top: 8px;
    bottom: auto;
  }
}

/* Figma-like sticky notes */
.notes-place {
  right: 22px;
  top: clamp(178px, 33vh, 330px);
  width: 226px;
  height: 156px;
  overflow: visible;
}

.notes-place::before {
  inset: 72px 20px 10px;
  border-color: rgba(51, 46, 38, 0.52);
  background: transparent;
}

.notes-place::after {
  content: none !important;
}

.notes-place span {
  z-index: 12;
  transform: translateY(38px) rotate(-4deg);
  color: rgba(64, 58, 50, 0.74);
}

.notes-source-stack {
  left: 50%;
  top: -28px;
  width: 220px;
  height: 120px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.note-source-card {
  left: calc(50% - 84px + var(--note-source-x, 0px));
  top: calc(22px + var(--note-source-y, 0px));
  width: 168px;
  height: 168px;
  border: 0;
  border-radius: 4px;
  background: var(--note-source-color, #fbe487);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(20, 20, 32, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  cursor: grab;
  pointer-events: auto;
  transform-origin: 50% 70%;
  transform: scale(0.55) rotate(var(--note-source-r, 0deg));
  transition:
    transform 0.45s cubic-bezier(.2, 1.2, .35, 1),
    box-shadow 0.35s ease,
    filter 0.35s ease,
    opacity 0.18s ease;
  animation: none;
  overflow: visible;
}

.note-source-card::before,
.floating-note::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 30%, rgba(0, 0, 0, 0.04));
  pointer-events: none;
}

.note-source-card::after {
  content: none;
}

.floating-note[data-empty="true"]::before {
  content: "";
}

.note-source-card:hover {
  transform: scale(0.6) rotate(calc(var(--note-source-r, 0deg) - 2deg));
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 30px rgba(20, 20, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  filter: saturate(1.05);
}

.note-source-card:hover::after {
  content: none;
}

.notes-place.taking-note[data-taking-index="0"] .note-source-card[data-source-index="0"],
.notes-place.taking-note[data-taking-index="1"] .note-source-card[data-source-index="1"],
.notes-place.taking-note[data-taking-index="2"] .note-source-card[data-source-index="2"],
.notes-place.taking-note[data-taking-index="3"] .note-source-card[data-source-index="3"],
.notes-place.taking-note[data-taking-index="4"] .note-source-card[data-source-index="4"],
.notes-place.taking-note[data-taking-index="5"] .note-source-card[data-source-index="5"] {
  opacity: 0;
  transform: translateY(18px) scale(0) rotate(var(--note-source-r, 0deg));
}

.note-source-card.spawning {
  animation: noteStackPop 0.62s cubic-bezier(.34, 1.5, .5, 1) both;
}

.note-source-card.taking-source {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateY(18px) scale(0) rotate(var(--note-source-r, 0deg)) !important;
}

@keyframes noteStackPop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0) rotate(var(--note-source-r, 0deg));
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(0.55) rotate(var(--note-source-r, 0deg));
  }
}

.floating-note {
  box-sizing: border-box;
  padding: 16px 16px 28px 16px;
  border-radius: 4px;
  color: rgba(20, 20, 24, 0.85);
  font: 500 14px/1.45 "Segoe UI", Arial, sans-serif;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 14px 18px -10px rgba(20, 20, 32, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  overflow: hidden;
  transform-origin: center center;
  transform: scale(var(--note-scale, 1)) rotate(var(--note-rotate, 0deg));
  transition:
    width 170ms ease,
    height 170ms ease,
    transform 80ms linear,
    box-shadow 250ms ease,
    outline-color 140ms ease;
}

.floating-note:hover {
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 22px -9px rgba(20, 20, 32, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note.selected {
  outline: 2px solid #82caff;
  box-shadow:
    0 0 0 2px rgba(106, 152, 255, 0.88),
    0 16px 24px -10px rgba(20, 20, 32, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note.dragging {
  cursor: grabbing;
  transform: scale(var(--note-scale, 1)) rotate(var(--note-rotate, 0deg));
  box-shadow:
    0 4px 4px rgba(0, 0, 0, 0.06),
    0 30px 60px rgba(20, 20, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note.source-sized {
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 30px rgba(20, 20, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.floating-note-body {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  outline: none;
  resize: none;
  scrollbar-width: none;
  user-select: none;
  pointer-events: none;
  cursor: grab;
}

.floating-note.editing .floating-note-body {
  pointer-events: auto;
  user-select: text;
  cursor: text;
  overflow: hidden;
  caret-color: rgba(24, 21, 18, 0.92);
}

.floating-note-body::-webkit-scrollbar {
  display: none;
}

.floating-note-body::placeholder {
  color: transparent;
}

.floating-note.selected .floating-note-body::placeholder,
.floating-note.editing .floating-note-body::placeholder {
  color: rgba(20, 20, 24, 0.42);
}

.floating-note-resize {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 4;
  width: 18px;
  height: 18px;
  border-radius: 0 0 3px 0;
  cursor: nwse-resize;
  opacity: 0;
  pointer-events: auto;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(35, 35, 38, 0.42) 48% 52%, transparent 54%),
    linear-gradient(135deg, transparent 0 63%, rgba(35, 35, 38, 0.36) 65% 69%, transparent 71%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.floating-note:hover .floating-note-resize,
.floating-note.selected .floating-note-resize,
.floating-note.resizing .floating-note-resize {
  opacity: 0.72;
}

.floating-note-resize:hover {
  opacity: 1;
  transform: translate(1px, 1px) scale(1.08);
}

.floating-note.resizing {
  cursor: nwse-resize;
}

.floating-note.selected .floating-note-body:empty::before {
  content: "Пишите здесь...";
  color: rgba(20, 20, 24, 0.42);
}

.floating-note:not(.selected) .floating-note-body:empty::before {
  content: none;
}

.floating-note-text {
  display: none;
}

.sheets-place {
  position: fixed;
  z-index: 70;
  right: 22px;
  top: clamp(328px, 51vh, 500px);
  width: 226px;
  height: 172px;
  display: grid;
  place-items: center;
  color: rgba(64, 58, 50, 0.74);
  font: 800 16px/1.15 "Segoe Print", "Comic Sans MS", cursive;
  text-align: center;
  pointer-events: auto;
  cursor: grab;
  overflow: visible;
}

.sheets-place::before {
  content: "";
  position: absolute;
  inset: 76px 18px 10px;
  border: 2px solid rgba(51, 46, 38, 0.52);
  border-radius: 50% 48% 52% 46% / 54% 46% 55% 43%;
  transform: rotate(3deg);
  pointer-events: none;
}

.sheets-place span {
  position: relative;
  z-index: 12;
  transform: translateY(40px) rotate(3deg);
  pointer-events: none;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75),
    0 0 8px rgba(255, 255, 255, 0.45);
}

.sheet-source-stack {
  position: absolute;
  left: 50%;
  top: -30px;
  width: 220px;
  height: 128px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: auto;
}

.sheet-source-card {
  position: absolute;
  left: calc(50% - 195px + var(--sheet-source-x, 0px));
  top: calc(-4px + var(--sheet-source-y, 0px));
  width: var(--sheet-source-width, 240px);
  height: var(--sheet-source-height, 340px);
  border: 0;
  border-radius: 18px 20px 16px 18px;
  background:
    radial-gradient(120% 92% at 50% 0%, rgba(255, 255, 255, 0.7), transparent 54%),
    #fbf7ec;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(20, 20, 32, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  cursor: grab;
  pointer-events: auto;
  transform-origin: 50% 72%;
  transform: scale(0.22) rotate(var(--sheet-source-r, 0deg));
  transition:
    transform 0.45s cubic-bezier(.2, 1.2, .35, 1),
    box-shadow 0.35s ease,
    filter 0.35s ease,
    opacity 0.18s ease;
}

.sheets-place .sheet-source-size-label {
  position: absolute;
  z-index: 3;
  left: 20px;
  top: 18px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: rgba(69, 53, 37, 0.58);
  font: 700 38px/1 "Segoe Print", "Comic Sans MS", cursive;
  letter-spacing: 0;
  pointer-events: none;
  transform: none;
  transform-origin: left top;
}

.sheet-source-card::before,
.floating-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), transparent 34%, rgba(0, 0, 0, 0.035));
  pointer-events: none;
}

.sheet-source-card::after,
.floating-sheet::after {
  content: "";
  position: absolute;
  top: 44px;
  left: 30px;
  right: 26px;
  height: 1px;
  background: rgba(150, 100, 50, 0.22);
  opacity: 0.9;
  pointer-events: none;
}

.floating-sheet::after {
  display: none;
}

.sheet-source-card:hover {
  transform: translateY(-6px) scale(0.24) rotate(calc(var(--sheet-source-r, 0deg) + 1deg));
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 18px 30px rgba(20, 20, 32, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  filter: saturate(1.03);
}

.sheets-place.taking-sheet[data-taking-index="0"] .sheet-source-card[data-source-index="0"],
.sheets-place.taking-sheet[data-taking-index="1"] .sheet-source-card[data-source-index="1"],
.sheets-place.taking-sheet[data-taking-index="2"] .sheet-source-card[data-source-index="2"],
.sheets-place.taking-sheet[data-taking-index="3"] .sheet-source-card[data-source-index="3"] {
  opacity: 0;
  transform: translateY(18px) scale(0) rotate(var(--sheet-source-r, 0deg));
}

.sheet-source-card.spawning {
  animation: sheetStackPop 0.62s cubic-bezier(.34, 1.5, .5, 1) both;
}

.sheet-source-card.taking-source {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateY(18px) scale(0) rotate(var(--sheet-source-r, 0deg)) !important;
}

@keyframes sheetStackPop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0) rotate(var(--sheet-source-r, 0deg));
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(0.22) rotate(var(--sheet-source-r, 0deg));
  }
}

.floating-sheets-layer {
  display: contents;
  position: fixed;
  inset: 0;
  z-index: auto;
  pointer-events: none;
}

.floating-images-layer {
  display: contents;
  position: fixed;
  inset: 0;
  z-index: auto;
  pointer-events: none;
}

.desktop-stickers-layer {
  display: contents;
  position: fixed;
  inset: 0;
  z-index: auto;
  pointer-events: none;
}

.desktop-connections-layer {
  position: fixed;
  inset: 0;
  z-index: 7700;
  width: 100vw;
  height: 100vh;
  overflow: visible;
  pointer-events: none;
}

.desktop-selection-rect {
  position: fixed;
  z-index: 8800;
  border: 1px solid rgba(47, 132, 224, 0.88);
  background: rgba(69, 154, 246, 0.16);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.42) inset;
  pointer-events: none;
}

.desktop-connections-layer path {
  pointer-events: none;
}

.desktop-connections-layer marker path {
  fill: rgba(92, 89, 82, 0.72);
}

.desktop-connection-object {
  pointer-events: auto;
}

.desktop-connection-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 12;
  stroke-linecap: round;
  stroke-linejoin: round;
  cursor: pointer;
}

.desktop-connection-path {
  fill: none;
  stroke: rgba(92, 89, 82, 0.72);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.46));
  cursor: pointer;
}

.desktop-connections-layer .desktop-connection-hit,
.desktop-connections-layer .desktop-connection-path {
  pointer-events: stroke;
}

.desktop-connection-object.selected .desktop-connection-path {
  stroke: rgba(36, 121, 207, 0.92);
  stroke-width: 3;
  filter:
    drop-shadow(0 0 0 rgba(255, 255, 255, 0.8))
    drop-shadow(0 3px 5px rgba(30, 69, 110, 0.18));
}

.desktop-connection-draft {
  fill: none;
  stroke: rgba(48, 123, 188, 0.86);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 8 6;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
}

.desktop-connection-target-dot {
  fill: rgba(255, 255, 255, 0.96);
  stroke: rgba(36, 121, 207, 0.92);
  stroke-width: 2.2;
  pointer-events: none;
  filter:
    drop-shadow(0 2px 5px rgba(30, 69, 110, 0.22))
    drop-shadow(0 0 0 rgba(255, 255, 255, 0.88));
}

.desktop-connection-target-dot-magnet {
  fill: #eaf6ff;
  stroke-width: 2.8;
}

.desktop-connection-endpoint {
  fill: rgba(255, 255, 255, 0.98);
  stroke: rgba(36, 121, 207, 0.94);
  stroke-width: 2.4;
  pointer-events: auto;
  cursor: grab;
  filter:
    drop-shadow(0 2px 4px rgba(30, 69, 110, 0.26))
    drop-shadow(0 0 0 rgba(255, 255, 255, 0.92));
}

.desktop-connection-endpoint:hover {
  fill: #eaf6ff;
  stroke-width: 3;
}

.desktop-connectable {
  --connection-dot-size: 12px;
  overflow: visible !important;
}

.desktop-connection-handle {
  position: absolute;
  z-index: 30;
  width: var(--connection-dot-size);
  height: var(--connection-dot-size);
  padding: 0;
  border: 2px solid rgba(35, 108, 170, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 1px 4px rgba(30, 55, 70, 0.22),
    0 0 0 3px rgba(130, 202, 255, 0.14);
  cursor: crosshair;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.72);
  transition: opacity 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.desktop-connectable:hover .desktop-connection-handle,
.desktop-connectable.selected .desktop-connection-handle,
.desktop-connect-mode .desktop-connectable.selected .desktop-connection-handle,
.desktop-connection-handle.desktop-connection-magnet {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.desktop-connection-handle:hover {
  box-shadow:
    0 2px 7px rgba(30, 55, 70, 0.3),
    0 0 0 7px rgba(130, 202, 255, 0.2);
}

.desktop-connection-handle-top {
  left: 50%;
  top: -14px;
}

.desktop-connection-handle-right {
  left: calc(100% + 14px);
  top: 50%;
}

.desktop-connection-handle-bottom {
  left: 50%;
  top: calc(100% + 14px);
}

.desktop-connection-handle-left {
  left: -14px;
  top: 50%;
}

.desktop-connection-magnet {
  border-color: rgba(25, 126, 212, 0.98) !important;
  box-shadow:
    0 2px 8px rgba(30, 55, 70, 0.34),
    0 0 0 8px rgba(130, 202, 255, 0.24) !important;
  transform: translate(-50%, -50%) scale(1.18) !important;
}

body.desktop-connecting,
body.desktop-connecting * {
  cursor: crosshair !important;
}

.desktop-toolbar {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 930;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(130, 118, 96, 0.32);
  border-radius: 8px;
  background: rgba(255, 250, 239, 0.78);
  box-shadow:
    0 12px 28px rgba(32, 28, 24, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.desktop-toolbar button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(122, 103, 78, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.55);
  color: rgba(54, 43, 32, 0.84);
  cursor: pointer;
  line-height: 1;
  transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.desktop-toolbar button:hover,
.desktop-toolbar button.active {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 8px rgba(43, 36, 28, 0.15);
  transform: translateY(-1px);
}

.desktop-bg-swatches {
  display: flex;
  gap: 5px;
  margin-left: 3px;
  padding-left: 7px;
  border-left: 1px solid rgba(116, 103, 88, 0.22);
}

.desktop-bg-swatches button {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  padding: 0;
}

.desktop-bg-swatches [data-desktop-bg="neutral"] {
  background: #dfe2dd;
}

.desktop-bg-swatches [data-desktop-bg="warm"] {
  background: #ead7bc;
}

.desktop-bg-swatches [data-desktop-bg="blue"] {
  background: #c8dde5;
}

.desktop-bg-swatches [data-desktop-bg="green"] {
  background: #d4e4cd;
}

.return-to-notebook {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 9100;
  min-width: 190px;
  padding: 11px 18px 12px;
  border: 1px solid rgba(119, 104, 82, 0.28);
  border-radius: 999px;
  background: rgba(255, 251, 242, 0.88);
  color: rgba(56, 47, 38, 0.86);
  box-shadow:
    0 14px 34px rgba(30, 28, 24, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0);
  transition:
    opacity 180ms ease,
    background 140ms ease,
    box-shadow 140ms ease;
}

.return-to-notebook.visible {
  opacity: 1;
  pointer-events: auto;
}

.return-to-notebook:hover,
.return-to-notebook.return-ready {
  background: rgba(255, 253, 248, 0.96);
  box-shadow:
    0 18px 38px rgba(30, 28, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.return-to-notebook.return-ready {
  border-color: rgba(76, 139, 255, 0.46);
  box-shadow:
    0 0 0 8px rgba(76, 139, 255, 0.14),
    0 18px 38px rgba(30, 28, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.desktop-sticker {
  position: fixed;
  width: 150px;
  height: 150px;
  padding: 12px;
  border-radius: 2px;
  background: var(--sticker-color, #fbe487);
  box-shadow:
    2px 2px 6px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: rgba(42, 34, 25, 0.88);
  font-family: "Caveat", "Segoe Print", "Comic Sans MS", cursive;
  font-size: 16px;
  line-height: 1.25;
  pointer-events: auto;
  cursor: move;
  overflow: hidden;
  transition: box-shadow 160ms ease, outline-color 140ms ease, transform 140ms ease;
}

.desktop-sticker::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.38), transparent 38%),
    repeating-linear-gradient(180deg, transparent 0 23px, rgba(70, 50, 30, 0.08) 24px 25px);
}

.desktop-sticker.selected,
.desktop-sticker.desktop-connection-source,
.desktop-image.desktop-connection-source,
.floating-sheet.desktop-connection-source,
.floating-note.desktop-connection-source {
  outline: 2px solid #82caff;
  outline-offset: 2px;
}

.desktop-sticker.dragging,
.desktop-sticker.resizing {
  box-shadow:
    0 18px 34px rgba(20, 20, 32, 0.28),
    2px 2px 8px rgba(0, 0, 0, 0.18);
  transform: rotate(-0.4deg);
}

.desktop-sticker-text {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  resize: none;
  border: 0;
  outline: 0;
  padding: 4px 2px;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: move;
  overflow: hidden;
}

.desktop-sticker.editing .desktop-sticker-text {
  cursor: text;
}

.desktop-sticker-close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 4;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(83, 54, 43, 0.78);
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
}

.desktop-sticker:hover .desktop-sticker-close,
.desktop-sticker.selected .desktop-sticker-close {
  opacity: 1;
}

.desktop-sticker-close:hover {
  background: rgba(255, 236, 226, 0.94);
  color: rgba(139, 45, 35, 0.96);
}

.desktop-sticker-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 4;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  opacity: 0;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(35, 35, 38, 0.42) 48% 52%, transparent 54%),
    linear-gradient(135deg, transparent 0 63%, rgba(35, 35, 38, 0.36) 65% 69%, transparent 71%);
  transition: opacity 120ms ease;
}

.desktop-sticker:hover .desktop-sticker-resize,
.desktop-sticker.selected .desktop-sticker-resize {
  opacity: 0.72;
}

.desktop-image {
  position: fixed;
  box-sizing: border-box;
  border: 0;
  border-radius: 5px;
  background: transparent;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.96),
    0 18px 34px rgba(20, 20, 32, 0.2),
    0 2px 4px rgba(20, 20, 32, 0.12);
  overflow: hidden;
  pointer-events: auto;
  cursor: move;
  transition: box-shadow 160ms ease, outline-color 140ms ease;
}

.desktop-image.no-frame {
  box-shadow:
    0 18px 34px rgba(20, 20, 32, 0.2),
    0 2px 4px rgba(20, 20, 32, 0.12);
}

.desktop-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
  user-select: none;
  -webkit-user-drag: none;
}

.desktop-image.selected {
  outline: 2px solid #82caff;
  outline-offset: 2px;
}

.desktop-image.dragging,
.desktop-image.resizing {
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.96),
    0 26px 50px rgba(20, 20, 32, 0.28),
    0 4px 7px rgba(20, 20, 32, 0.16);
}

.desktop-image.no-frame.dragging,
.desktop-image.no-frame.resizing {
  box-shadow:
    0 26px 50px rgba(20, 20, 32, 0.28),
    0 4px 7px rgba(20, 20, 32, 0.16);
}

.desktop-image-close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.78);
  color: rgba(90, 58, 46, 0.86);
  font: 700 16px/1 "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  opacity: 0;
  transition: opacity 120ms ease, background 120ms ease;
}

.desktop-image:hover .desktop-image-close,
.desktop-image.selected .desktop-image-close {
  opacity: 1;
}

.desktop-image-close:hover {
  background: rgba(255, 230, 222, 0.96);
  color: rgba(139, 45, 35, 0.96);
}

.desktop-image-resize {
  position: absolute;
  right: 3px;
  bottom: 3px;
  z-index: 2;
  width: 20px;
  height: 20px;
  cursor: nwse-resize;
  opacity: 0;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(35, 35, 38, 0.48) 48% 52%, transparent 54%),
    linear-gradient(135deg, transparent 0 63%, rgba(35, 35, 38, 0.42) 65% 69%, transparent 71%);
  transition: opacity 120ms ease;
}

.desktop-image:hover .desktop-image-resize,
.desktop-image.selected .desktop-image-resize {
  opacity: 0.82;
}

.sheet-group-arrows {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.sheet-group-arrows path {
  pointer-events: none;
}

.sheet-group-arrows marker path {
  fill: rgba(104, 98, 88, 0.72);
}

.group-arrow-path {
  fill: none;
  stroke: rgba(104, 98, 88, 0.72);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 7 6;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.44));
}

.floating-sheet {
  position: fixed;
  box-sizing: border-box;
  width: var(--sheet-width, 240px);
  min-height: 200px;
  height: var(--sheet-height, 320px);
  padding: 12px;
  border-radius: 16px 18px 14px 16px;
  border: 1px solid rgba(183, 170, 143, 0.62);
  color: rgba(20, 20, 24, 0.86);
  background:
    radial-gradient(120% 92% at 50% 0%, rgba(255, 255, 255, 0.74), transparent 54%),
    #fbf7ec;
  box-shadow:
    2px 2px 8px rgba(0, 0, 0, 0.15),
    0 18px 28px -12px rgba(20, 20, 32, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  overflow: visible;
  pointer-events: auto;
  cursor: move;
  transform-origin: center center;
  transform:
    translate(var(--sheet-stack-fan-x, 0px), var(--sheet-stack-fan-y, 0px))
    scale(var(--sheet-scale, 1))
    rotate(calc(var(--sheet-rotate, 0deg) + var(--sheet-stack-fan-rotate, 0deg)));
  transition:
    transform 220ms cubic-bezier(.2, 1.2, .35, 1),
    opacity 180ms ease,
    box-shadow 250ms ease,
    outline-color 140ms ease;
}

.detached-sheet {
  position: fixed;
}

.floating-sheet.stacked {
  transition:
    transform 260ms cubic-bezier(.2, 1.22, .35, 1),
    opacity 180ms ease,
    box-shadow 250ms ease,
    outline-color 140ms ease;
}

.floating-sheet.stacked:not(.stack-top) {
  box-shadow:
    1px 1px 3px rgba(0, 0, 0, 0.1),
    0 10px 18px -14px rgba(20, 20, 32, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.floating-sheets-layer:has(.floating-sheet.stacked:hover) .floating-sheet.stacked {
  --sheet-stack-fan-x: var(--sheet-stack-hover-x, 0px);
  --sheet-stack-fan-y: var(--sheet-stack-hover-y, 0px);
  --sheet-stack-fan-rotate: var(--sheet-stack-hover-rotate, 0deg);
}

.floating-sheet.stack-fan {
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 22px 30px -12px rgba(20, 20, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.floating-sheet:hover {
  box-shadow:
    0 2px 2px rgba(0, 0, 0, 0.05),
    0 22px 30px -12px rgba(20, 20, 32, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.floating-sheet.selected {
  outline: 2px solid #82caff;
  box-shadow:
    0 0 0 2px rgba(106, 152, 255, 0.88),
    0 20px 32px -12px rgba(20, 20, 32, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.floating-sheet.dragging {
  cursor: grabbing;
  box-shadow:
    0 4px 4px rgba(0, 0, 0, 0.06),
    0 34px 66px rgba(20, 20, 32, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.floating-sheet.editing {
  cursor: default;
}

.floating-sheet.removing {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96) rotate(var(--sheet-rotate, 0deg));
}

.sheet-header {
  position: relative;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 28px;
  margin: 2px 2px 10px;
  padding-right: 32px;
  cursor: move;
  user-select: none;
}

.sheet-name {
  flex: 1;
  min-width: 0;
  min-height: 19px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  color: rgba(41, 33, 24, 0.86);
  border-bottom: 1px solid rgba(150, 100, 50, 0.22);
  cursor: text;
}

.sheet-name-input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid rgba(150, 100, 50, 0.35);
  outline: 0;
  background: rgba(255, 255, 255, 0.42);
  color: rgba(41, 33, 24, 0.92);
  font: inherit;
}

.sheet-copy {
  position: absolute;
  right: 0;
  top: -1px;
  z-index: 9;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.52);
  color: rgba(73, 56, 42, 0.74);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.64;
  transition:
    transform 160ms ease,
    opacity 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.sheet-copy:hover,
.sheet-copy.copied {
  background: rgba(235, 248, 255, 0.92);
  color: rgba(28, 91, 132, 0.96);
  opacity: 1;
  transform: translateY(-1px);
}

.floating-sheet.attaching-to-book {
  pointer-events: none;
  opacity: 0;
  transform:
    translate(var(--sheet-attach-x, 0px), var(--sheet-attach-y, 0px))
    scale(0.28)
    rotate(9deg);
  transition:
    transform 360ms cubic-bezier(.2, .9, .28, 1),
    opacity 320ms ease;
}

.loose-sheet-grip {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  right: 0;
  height: 28px;
  cursor: grab;
  touch-action: none;
}

.loose-sheet-grip:active {
  cursor: grabbing;
}

.loose-sheet-editor-container {
  position: absolute;
  z-index: 2;
  left: 44px;
  right: 14px;
  top: 48px;
  bottom: 14px;
  overflow: visible;
  color: var(--ink, #2b2722);
  font-family: "Segoe Print", "Comic Sans MS", cursive;
  font-size: 13px;
  line-height: 22px;
  caret-color: var(--photo-red, #9d342e);
  text-shadow: 0 0 0.2px rgba(35, 31, 27, 0.48);
  pointer-events: none;
}

.floating-sheet.editing .loose-sheet-editor-container {
  pointer-events: auto;
}

.loose-sheet-preview {
  min-height: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
  color: rgba(42, 36, 30, 0.86);
  font: inherit;
}

.loose-sheet-preview[data-empty="true"]::before {
  content: "";
}

.loose-sheet-preview p {
  font-size: 11pt;
  line-height: 1.45;
  margin: 0 0 5px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.loose-sheet-preview h1,
.loose-sheet-preview h2,
.loose-sheet-preview h3 {
  color: var(--text-primary, #1a1a1a);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.loose-sheet-preview h1 {
  font-size: 24pt;
  margin-top: 24pt;
  margin-bottom: 12pt;
}

.loose-sheet-preview h2 {
  font-size: 18pt;
  margin-top: 18pt;
  margin-bottom: 8pt;
}

.loose-sheet-preview h3 {
  font-size: 14pt;
  margin-top: 12pt;
  margin-bottom: 6pt;
}

.loose-sheet-preview ul,
.loose-sheet-preview ol,
.loose-sheet-preview blockquote {
  margin: 0 0 6pt;
}

.loose-sheet-preview ul,
.loose-sheet-preview ol {
  padding-left: 1.55em;
}

.loose-sheet-preview ul[data-type="taskList"] {
  list-style: none;
  padding: 0;
  margin: 0;
}

.loose-sheet-preview ul[data-type="taskList"] li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0;
}

.loose-sheet-preview ul[data-type="taskList"] li > label {
  flex-shrink: 0;
  margin-top: 4px;
}

.loose-sheet-preview ul[data-type="taskList"] li > label input[type="checkbox"] {
  pointer-events: none;
}

.loose-sheet-preview mark {
  border-radius: 3px;
  padding: 0 2px;
}

.loose-sheet-tiptap-editor {
  min-height: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  overflow-x: visible;
  overflow-y: visible;
  padding-right: 0;
  scrollbar-width: none;
  font-size: 13px;
}

.loose-sheet-tiptap-editor::-webkit-scrollbar {
  display: none;
}

.loose-sheet-tiptap-editor p {
  line-height: 1.45;
  margin-bottom: 5px;
}

.loose-sheet-tiptap-editor h1,
.loose-sheet-tiptap-editor h2,
.loose-sheet-tiptap-editor h3 {
  color: rgba(34, 29, 24, 0.92);
}

.loose-sheet-ghost-lines {
  position: absolute;
  inset: 48px 14px 14px 44px;
  display: none;
  opacity: 0;
  background: none;
  pointer-events: none;
}

.loose-sheet-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 6;
  width: 20px;
  height: 20px;
  border-radius: 0 0 3px 0;
  cursor: nwse-resize;
  opacity: 0;
  pointer-events: auto;
  background:
    linear-gradient(135deg, transparent 0 46%, rgba(35, 35, 38, 0.42) 48% 52%, transparent 54%),
    linear-gradient(135deg, transparent 0 63%, rgba(35, 35, 38, 0.36) 65% 69%, transparent 71%);
  transition: opacity 140ms ease, transform 140ms ease;
}

.floating-sheet:hover .loose-sheet-resize,
.floating-sheet.selected .loose-sheet-resize,
.floating-sheet.resizing .loose-sheet-resize {
  opacity: 0.72;
}

.loose-sheet-resize:hover {
  opacity: 1;
  transform: translate(1px, 1px) scale(1.08);
}

.floating-sheet.resizing {
  cursor: nwse-resize;
}

/* Edge-pinned desktop tools and side palettes */
.desk-drawing-tools {
  position: fixed;
  z-index: 72;
  left: -18px;
  top: clamp(210px, 33vh, 360px);
  width: 122px;
  height: 382px;
  pointer-events: none;
}

.desk-place {
  display: none !important;
}

.desk-pencil {
  left: 18px;
  top: 0;
  width: 72px;
  height: 318px;
  transform: rotate(-2deg);
}

.desk-pencil:hover {
  transform: translateX(7px) translateY(-4px) rotate(1deg) scale(1.018);
}

.desk-pencil.active {
  transform: rotate(-2deg);
}

.desk-eraser {
  left: 0;
  top: 308px;
  width: 92px;
  height: 54px;
  transform: rotate(0deg);
}

.desk-eraser:hover {
  transform: translateX(7px) translateY(-3px) rotate(-2deg) scale(1.025);
}

.desk-eraser.active {
  transform: rotate(0deg);
}

.notes-place,
.sheets-place,
.sticker-fan {
  transform: none;
  transform-origin: 100% 50%;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.notes-place {
  right: -80px;
  top: clamp(180px, 25vh, 250px);
  z-index: 8000;
}

.sheets-place {
  right: -136px;
  top: clamp(180px, 25vh, 250px);
  z-index: 8000;
}

.sticker-fan {
  right: -130px;
  top: clamp(500px, 61vh, 560px);
  bottom: auto;
  z-index: 8000;
}

.notes-place::before,
.sheets-place::before,
.sticker-fan::before,
.chapter-tab-source,
.chapter-tab-source::after {
  content: none !important;
  display: none !important;
}

.notes-place > span,
.sheets-place > span,
.chapter-tab-source span {
  display: none !important;
}

.diary-chapter-palette .section-tab.placed,
.diary-chapter-palette .chapter-tab-add {
  left: var(--tab-left);
  top: 4.4%;
  width: 54px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 4px 4px 2px 2px;
  clip-path: polygon(0 8%, 10% 0, 25% 8%, 39% 0, 55% 7%, 70% 0, 84% 8%, 100% 3%, 96% 100%, 4% 100%);
  transform: rotate(var(--tab-rotate));
  transition:
    transform 180ms ease,
    height 160ms ease,
    top 160ms ease,
    filter 160ms ease,
    box-shadow 160ms ease,
    opacity 120ms ease;
}

.diary-chapter-palette .section-tab.placed:hover,
.diary-chapter-palette .chapter-tab-add:hover {
  top: 4.0%;
  height: 84px;
  filter: saturate(1.08);
  transform: translateY(-3px) rotate(var(--tab-rotate)) scale(1.025);
}

.diary-chapter-palette .section-tab.placed.active {
  top: 4.0%;
  height: 86px;
  filter: saturate(1.12);
  transform: translateY(-4px) rotate(var(--tab-rotate));
  box-shadow: 0 13px 22px rgba(45, 36, 26, 0.31);
}

.diary-chapter-palette .section-tab.dragging-origin {
  opacity: 0.72;
  filter: saturate(1.18);
  transform: translateY(-8px) rotate(var(--tab-rotate)) scale(1.04);
  pointer-events: auto;
}

.book.frame-turning .diary-chapter-palette .section-tab.placed,
.book.frame-turning .diary-chapter-palette .chapter-tab-add {
  top: 4.4%;
  height: 78px;
}

.diary-chapter-palette .section-tab-icon {
  top: 11px;
  bottom: auto;
  left: 4px;
  right: 4px;
  display: block;
  min-height: 26px;
  font-size: 27px;
  line-height: 1;
  text-align: center;
}

.diary-chapter-palette .section-tab-text {
  position: absolute;
  top: 43px;
  left: 5px;
  right: 5px;
  display: block;
  overflow: hidden;
  color: rgba(47, 39, 31, 0.9);
  font: 900 11px/1.05 "Segoe Print", "Comic Sans MS", cursive;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary-chapter-palette .chapter-tab-add {
  opacity: 0;
  background: transparent !important;
  box-shadow: none !important;
  clip-path: none;
  color: rgba(52, 44, 34, 0.76);
  font: 900 34px/1 "Segoe Print", "Comic Sans MS", cursive;
  text-shadow: 0 2px 4px rgba(255, 255, 255, 0.75);
}

.diary-chapter-palette .chapter-tab-add:hover,
.diary-chapter-palette .chapter-tab-add:focus-visible {
  top: 4.4%;
  height: 78px;
  opacity: 1;
  filter: none;
  transform: rotate(var(--tab-rotate)) scale(1.1);
}

.chapter-context-menu {
  width: 282px;
  flex-wrap: wrap;
  align-items: center;
}

.notebook-context-menu .chapter-menu-action {
  width: auto;
  min-width: 126px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.notebook-context-menu .chapter-menu-emoji {
  font-size: 20px;
}

.notebook-context-menu .chapter-menu-delete {
  color: #9b302b;
  background: rgba(210, 68, 60, 0.12);
}

.chapter-color-swatches {
  display: grid;
  grid-template-columns: repeat(6, 26px);
  gap: 5px;
  width: 100%;
}

.notebook-context-menu .chapter-color-swatch {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(49, 41, 32, 0.16);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.62), transparent 55%),
    var(--swatch-color);
}

.chapter-emoji-grid {
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  width: 100%;
  max-height: 170px;
  overflow: auto;
  padding-top: 4px;
}

.chapter-context-menu.show-emoji .chapter-emoji-grid {
  display: grid;
}

.notebook-context-menu .chapter-emoji-grid button {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 18px;
}

.notes-source-stack,
.sheet-source-stack {
  left: auto;
  right: 0;
  transform: none;
  pointer-events: none;
}

.notes-source-stack {
  top: 0;
}

.sheet-source-stack {
  top: 0;
}

.note-source-card {
  left: auto;
  right: calc(152px - var(--note-source-x, 0px) * 0.32);
  top: calc(44px + var(--note-source-y, 0px) * 0.2);
  pointer-events: auto;
  transform-origin: 100% 50%;
  transform: scale(0.55) rotate(calc(90deg + var(--note-source-r, 0deg)));
}

.note-source-card:hover {
  transform: translateX(-10px) scale(0.58) rotate(calc(90deg + var(--note-source-r, 0deg)));
}

.notes-place.source-drag-active {
  z-index: 9000;
}

.note-source-card.source-live-dragging {
  z-index: 9999 !important;
  pointer-events: none;
  transition: none !important;
  transform-origin: 100% 50%;
  transform:
    translate(var(--note-drag-x, 0px), var(--note-drag-y, 0px))
    scale(var(--note-scale, 0.55))
    rotate(var(--note-rotate, calc(90deg + var(--note-source-r, 0deg)))) !important;
}

.sheet-source-card {
  left: auto;
  right: calc(160px - var(--sheet-source-x, 0px) * 0.16);
  top: calc(70px + var(--sheet-source-y, 0px) * 1);
  width: var(--sheet-source-width, 240px);
  height: var(--sheet-source-height, 340px);
  z-index: var(--sheet-source-z, 20);
  pointer-events: auto;
  transform-origin: 100% 50%;
  transform: scale(0.22) rotate(var(--sheet-source-r, 0deg));
}

.sheet-source-card:hover {
  transform: translateX(-7px) translateY(-2px) scale(0.235) rotate(var(--sheet-source-r, 0deg));
}

.sheets-place.source-drag-active {
  z-index: 9000;
}

.sheet-source-card.source-live-dragging {
  width: var(--sheet-drag-width, var(--sheet-source-width, 240px));
  height: var(--sheet-drag-height, var(--sheet-source-height, 340px));
  z-index: 9999 !important;
  pointer-events: none;
  transition: none !important;
  transform-origin: 100% 50%;
  transform:
    translate(var(--sheet-drag-x, 0px), var(--sheet-drag-y, 0px))
    scale(var(--sheet-scale, 0.28))
    rotate(var(--sheet-rotate, var(--sheet-source-r, 0deg))) !important;
}

.fan-sticker {
  left: auto;
  right: var(--fan-right, calc(166px - var(--fan-index) * 18px));
  top: var(--fan-top, calc(74px + var(--fan-index) * 7px));
  bottom: auto;
  pointer-events: auto;
  transform-origin: 100% 64%;
  transform: rotate(var(--fan-angle));
}

.fan-sticker:hover {
  transform: translateX(-10px) translateY(-2px) rotate(var(--fan-angle)) scale(1.03);
}

.fan-sticker.press-bend,
.fan-sticker.press-bend:hover {
  filter: saturate(1.08) brightness(0.98);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 8px 16px rgba(20, 20, 32, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -10px 16px rgba(31, 31, 36, 0.13);
  transform: translateX(-4px) rotate(var(--fan-angle)) scaleX(0.985) scaleY(0.965) skewY(-1deg);
}

.sticker-fan.source-drag-active {
  z-index: 9000;
}

.fan-sticker.source-live-dragging {
  z-index: 9999 !important;
  pointer-events: none;
  transform-origin: var(--sticker-drag-origin, 100% 64%);
  transition:
    --sticker-drag-angle 380ms cubic-bezier(.18, .86, .28, 1),
    box-shadow 180ms ease,
    filter 180ms ease !important;
  transform:
    translate(var(--sticker-drag-x, 0px), var(--sticker-drag-y, 0px))
    rotate(var(--sticker-drag-angle, var(--fan-angle)))
    scale(1.03) !important;
}

.fan-sticker.spawning {
  animation: edgeStickerFanSettle 0.42s cubic-bezier(.24, 1.48, .38, 1) both !important;
}

.page-arrow {
  transform: translate(var(--desktop-pan-x), var(--desktop-pan-y));
}

.page-arrow.left:hover {
  transform: translate(calc(var(--desktop-pan-x) - 6px), var(--desktop-pan-y)) scale(1.08);
}

.page-arrow.right:hover {
  transform: translate(calc(var(--desktop-pan-x) + 6px), var(--desktop-pan-y)) scale(1.08);
}

.notebook-dock {
  z-index: 8500;
}

.notes-place.taking-note[data-taking-index="0"] .note-source-card[data-source-index="0"],
.notes-place.taking-note[data-taking-index="1"] .note-source-card[data-source-index="1"],
.notes-place.taking-note[data-taking-index="2"] .note-source-card[data-source-index="2"],
.notes-place.taking-note[data-taking-index="3"] .note-source-card[data-source-index="3"],
.notes-place.taking-note[data-taking-index="4"] .note-source-card[data-source-index="4"],
.notes-place.taking-note[data-taking-index="5"] .note-source-card[data-source-index="5"],
.note-source-card.taking-source {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateX(-10px) scale(0) rotate(calc(90deg + var(--note-source-r, 0deg))) !important;
}

.note-source-card.spawning {
  animation: edgeNoteSourcePop 0.62s cubic-bezier(.34, 1.5, .5, 1) both !important;
}

.sheets-place.taking-sheet[data-taking-index="0"] .sheet-source-card[data-source-index="0"],
.sheets-place.taking-sheet[data-taking-index="1"] .sheet-source-card[data-source-index="1"],
.sheets-place.taking-sheet[data-taking-index="2"] .sheet-source-card[data-source-index="2"],
.sheets-place.taking-sheet[data-taking-index="3"] .sheet-source-card[data-source-index="3"],
.sheet-source-card.taking-source {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateX(-10px) scale(0) rotate(var(--sheet-source-r, 0deg)) !important;
}

.sheet-source-card.spawning {
  animation: edgeSheetSourcePop 0.62s cubic-bezier(.34, 1.5, .5, 1) both !important;
}

.fan-sticker.dragging-origin {
  opacity: 0 !important;
  pointer-events: none;
  transform: translateX(-10px) scale(0) rotate(var(--fan-angle)) !important;
}

.floating-note.source-sized.dragging,
.floating-sheet.source-sized.dragging {
  transform-origin: 0 0;
}

.dragging-sticker.from-source {
  width: var(--drag-sticker-width, 46px);
  height: var(--drag-sticker-height, 124px);
  padding: 0;
  color: transparent;
  font-size: 0;
  animation: none;
  transform: rotate(var(--sticker-drag-angle, 0deg)) scale(1.04);
  transform-origin: var(--sticker-drag-origin, 100% 64%);
}

@keyframes edgeNoteSourcePop {
  0% {
    opacity: 0;
    transform: translateX(-10px) scale(0) rotate(calc(90deg + var(--note-source-r, 0deg)));
  }
  36% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: scale(0.55) rotate(calc(90deg + var(--note-source-r, 0deg)));
  }
}

@keyframes edgeSheetSourcePop {
  0% {
    opacity: 1;
    transform: translateX(-12px) scale(0) rotate(var(--sheet-source-r, 0deg));
  }
  36% {
    opacity: 1
	;
  }
  100% {
    opacity: 1;
    transform: scale(0.22) rotate(var(--sheet-source-r, 0deg));
  }
}

@keyframes edgeStickerFanSettle {
  0% {
    opacity: 0;
    transform: translateX(-8px) scale(0) rotate(var(--fan-angle));
  }
  45% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: rotate(var(--fan-angle));
  }
}

.loose-sheet-tabs {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.loose-sheet-tab {
  position: absolute;
  top: var(--top, 32%);
  width: 142px;
  height: 44px;
  border-radius: 3px;
  background: var(--tab-color, #ffd21f);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.05),
    0 8px 14px rgba(20, 20, 32, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  pointer-events: auto;
  cursor: grab;
  user-select: none;
  touch-action: none;
  -webkit-user-drag: none;
}

.loose-sheet-tab.left {
  left: -121px;
  transform: translateY(-50%) rotate(-1deg);
}

.loose-sheet-tab.right {
  right: -121px;
  transform: translateY(-50%) rotate(1deg);
}

.loose-sheet-tab.press-bend {
  filter: saturate(1.08) brightness(0.98);
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.05),
    0 6px 12px rgba(20, 20, 32, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -7px 12px rgba(31, 31, 36, 0.14);
}

.loose-sheet-tab.left.press-bend {
  transform: translateY(-50%) rotate(-1deg) scaleX(0.99) scaleY(0.965) skewY(-1deg);
}

.loose-sheet-tab.right.press-bend {
  transform: translateY(-50%) rotate(1deg) scaleX(0.99) scaleY(0.965) skewY(1deg);
}

.loose-sheet-tab.dragging-origin {
  opacity: 0.18;
}

.floating-note::before {
  background: transparent !important;
  box-shadow: none !important;
}

.floating-note:not([data-empty="true"])::before {
  content: none !important;
}

.floating-note:not(.selected):not(.dragging):not(:hover) {
  filter: none;
  box-shadow:
    0 1px 1px rgba(0, 0, 0, 0.04),
    0 10px 20px rgba(20, 20, 32, 0.13),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
