:root {
  --flax: #bda77f;
  --flax-light: #d4c29e;
  --parchment: #eee2c8;
  --walnut: #47372d;
  --walnut-soft: #6d5948;
  --brass: #967342;
  --ivory: #f5eddd;
  --shadow: rgba(54, 39, 26, 0.28);
  --safe-top: max(22px, env(safe-area-inset-top));
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
  color-scheme: light;
  font-family: "Songti SC", "Noto Serif CJK SC", "STSong", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--walnut);
  background: var(--flax);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(70, 55, 45, 0.76);
  outline-offset: 3px;
}

.hidden {
  display: none !important;
}

.svg-defs {
  position: fixed;
  width: 0;
  height: 0;
}

.login-screen,
.app,
.canvas {
  position: fixed;
  inset: 0;
}

.login-screen,
.canvas {
  background-color: var(--flax);
  background-image:
    radial-gradient(circle at 18% 10%, rgba(255, 249, 226, 0.31), transparent 34%),
    linear-gradient(118deg, rgba(255, 244, 214, 0.14), transparent 42%, rgba(58, 40, 23, 0.17)),
    url("/assets/flax-linen.webp");
  background-size: cover, cover, 1080px 605px;
  background-position: center, center, var(--cloth-x, 50%) var(--cloth-y, 50%);
  background-repeat: no-repeat, no-repeat, repeat;
}

.login-screen::before,
.canvas::before,
.note::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.32 .018' numOctaves='3' seed='8' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.27'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  opacity: 0.14;
}

.login-screen::after,
.canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 180px rgba(45, 31, 19, 0.34);
  background: linear-gradient(112deg, rgba(255, 246, 220, 0.24), transparent 36%, rgba(51, 35, 21, 0.12));
}

.login-screen {
  z-index: 20;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.login-light {
  position: absolute;
  width: 68vw;
  height: 120vh;
  left: -12vw;
  top: -48vh;
  transform: rotate(-15deg);
  background: linear-gradient(90deg, transparent, rgba(255, 249, 226, 0.35), transparent);
  filter: blur(28px);
}

.login-card {
  position: relative;
  z-index: 3;
  width: min(430px, calc(100vw - 42px));
  padding: 62px 54px 38px;
  background:
    linear-gradient(rgba(249, 241, 222, 0.93), rgba(225, 210, 179, 0.94)),
    var(--parchment);
  border: 1px solid rgba(92, 70, 45, 0.24);
  box-shadow: 0 34px 70px rgba(44, 31, 19, 0.34), 0 8px 20px rgba(44, 31, 19, 0.2);
  transform: rotate(-0.55deg);
  clip-path: polygon(0.5% 1.2%, 99.1% 0, 100% 97.8%, 97% 100%, 0 98.7%);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.3;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='f'%3E%3CfeTurbulence baseFrequency='.65' numOctaves='4' seed='12'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)' opacity='.16'/%3E%3C/svg%3E");
  pointer-events: none;
}

.login-pin,
.note-pin {
  position: absolute;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #d8bd77 0 7%, #aa8040 26%, #785529 62%, #4e351d 100%);
  box-shadow: 0 5px 7px rgba(50, 30, 16, 0.35), inset 0 1px 2px rgba(255, 245, 194, 0.64);
}

.login-pin {
  width: 30px;
  height: 30px;
  left: calc(50% - 15px);
  top: -8px;
}

.eyebrow {
  margin: 0 0 7px;
  color: #8e7659;
  font: 600 10px/1.2 Georgia, serif;
  letter-spacing: 0.28em;
}

.login-card h1 {
  position: relative;
  margin: 0;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
  font-size: clamp(42px, 8vw, 58px);
  font-weight: 400;
  letter-spacing: 0.08em;
}

.login-intro {
  margin: 12px 0 35px;
  color: var(--walnut-soft);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.login-card form,
.login-card label {
  position: relative;
  display: grid;
}

.login-card form {
  gap: 18px;
}

.login-card label span {
  margin-bottom: 7px;
  font-size: 12px;
  letter-spacing: 0.2em;
}

.login-card input {
  width: 100%;
  padding: 12px 3px;
  color: var(--walnut);
  font: 17px/1.2 "Kaiti SC", "STKaiti", serif;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(70, 55, 45, 0.44);
  border-radius: 0;
}

.login-card input:focus-visible {
  outline: none;
  border-bottom-color: rgba(54, 40, 31, 0.88);
  box-shadow: 0 1px rgba(54, 40, 31, 0.32);
}

.login-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  padding: 13px 17px;
  color: #f9f1df;
  letter-spacing: 0.13em;
  background: #4f4035;
  border: 0;
  cursor: pointer;
  box-shadow: 0 7px 16px rgba(52, 37, 24, 0.2);
  transition: transform 160ms ease, background 160ms ease;
}

.login-button:hover {
  transform: translateY(-2px);
  background: #3e3129;
}

.login-button:disabled {
  cursor: wait;
  opacity: 0.66;
}

.form-error {
  min-height: 1.2em;
  margin: -7px 0 0;
  color: #8b4335;
  font-size: 12px;
}

.login-version {
  position: relative;
  margin: 22px 0 0;
  color: #8b755c;
  font: 10px/1 Georgia, serif;
  letter-spacing: 0.15em;
  text-align: center;
}

.login-scrap {
  position: absolute;
  z-index: 2;
  width: 250px;
  padding: 45px 32px;
  color: rgba(68, 52, 40, 0.72);
  background: rgba(237, 225, 198, 0.8);
  box-shadow: 0 18px 30px rgba(45, 32, 19, 0.22);
  font: 20px/1.8 "Kaiti SC", "STKaiti", serif;
}

.login-scrap-one {
  left: 9vw;
  top: 14vh;
  transform: rotate(-6deg);
}

.login-scrap-two {
  right: 8vw;
  bottom: 12vh;
  transform: rotate(5deg);
}

.app {
  z-index: 1;
  isolation: isolate;
}

.canvas {
  z-index: 0;
  cursor: grab;
  touch-action: none;
}

.canvas.panning {
  cursor: grabbing;
}

.world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  transform-origin: 0 0;
  will-change: transform;
}

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

.ambient-piece {
  position: absolute;
  margin: 0;
  color: rgba(65, 49, 37, 0.76);
  background:
    url("/assets/paper-fibers.webp") center / 310px 310px,
    linear-gradient(145deg, rgba(248, 240, 218, 0.92), rgba(215, 199, 166, 0.92));
  background-blend-mode: multiply, normal;
  border: 1px solid rgba(88, 64, 43, 0.12);
  box-shadow: 0 18px 30px rgba(50, 34, 21, 0.23), 0 4px 8px rgba(50, 34, 21, 0.14);
  clip-path: polygon(1% 2%, 25% 0.5%, 53% 2%, 79% 0, 99% 2%, 100% 97%, 78% 99%, 49% 98%, 24% 100%, 0 98%);
  font: 19px/1.7 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 0.04em;
  opacity: 0.94;
}

.ambient-botanical {
  left: -115px;
  top: -640px;
  width: 275px;
  height: 250px;
  transform: rotate(-4deg);
}

.ambient-botanical svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(70, 55, 43, 0.47);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ambient-tag {
  left: -760px;
  top: -75px;
  display: grid;
  gap: 5px;
  width: 105px;
  padding: 37px 24px 29px;
  transform: rotate(-7deg);
  text-align: center;
  border-radius: 0 0 20px 20px;
}

.ambient-tag::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 45px;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(86, 65, 43, 0.45);
  border-radius: 50%;
}

.ambient-tag::after {
  content: "";
  position: absolute;
  left: 50px;
  top: -47px;
  width: 70px;
  height: 65px;
  border-left: 2px solid rgba(103, 75, 42, 0.55);
  border-radius: 50%;
  transform: rotate(44deg);
}

.ambient-poem {
  left: -820px;
  top: 390px;
  width: 330px;
  min-height: 205px;
  padding: 42px 39px;
  transform: rotate(-4deg);
  font-size: 18px;
  line-height: 2.05;
}

.ambient-plan {
  left: 665px;
  top: -190px;
  width: 260px;
  padding: 38px 34px;
  transform: rotate(4deg);
  line-height: 1.9;
}

.ambient-plan::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 28%, #ddc37d, #9c7338 42%, #53391f 100%);
  box-shadow: 0 5px 8px rgba(47, 31, 18, 0.36);
}

.ambient-taped {
  left: 585px;
  top: 370px;
  width: 230px;
  min-height: 220px;
  padding: 47px 30px 30px;
  transform: rotate(5deg);
}

.ambient-taped i {
  position: absolute;
  left: calc(50% - 44px);
  top: -13px;
  width: 88px;
  height: 31px;
  background: rgba(196, 157, 94, 0.45);
  border-left: 1px dashed rgba(91, 67, 43, 0.16);
  border-right: 1px dashed rgba(91, 67, 43, 0.16);
  box-shadow: 0 3px 6px rgba(62, 43, 27, 0.13);
  transform: rotate(-2deg);
}

.ambient-taped svg {
  position: absolute;
  right: 8px;
  bottom: 4px;
  width: 105px;
  fill: none;
  stroke: rgba(70, 55, 43, 0.38);
  stroke-width: 1.5;
}

.ambient-coffee {
  left: -855px;
  top: -455px;
  width: 230px;
  padding: 35px 31px;
  transform: rotate(5deg);
  font-size: 16px;
}

.note {
  --note-paper: #eee2c8;
  --note-ink: #44352b;
  position: absolute;
  display: flex;
  min-width: 180px;
  min-height: 140px;
  padding: 43px 30px 26px;
  transform-origin: center;
  color: var(--note-ink);
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), transparent 45%),
    url("/assets/paper-fibers.webp"),
    linear-gradient(var(--note-paper), var(--note-paper));
  background-size: cover, 360px 360px, cover;
  background-blend-mode: screen, multiply, normal;
  border: 1px solid rgba(83, 61, 41, 0.14);
  box-shadow: 0 22px 32px rgba(54, 39, 25, 0.3), 0 5px 9px rgba(54, 39, 25, 0.18);
  clip-path: polygon(0.2% 1.2%, 27% 0.4%, 51% 1.1%, 78% 0.1%, 99.6% 1.4%, 100% 97%, 77% 99.8%, 49% 98.9%, 22% 100%, 0 98.5%);
  transition: box-shadow 160ms ease, filter 160ms ease;
  filter: url(#paper-warp) drop-shadow(0 14px 12px rgba(48, 32, 19, 0.26));
  touch-action: none;
}

.note::before {
  opacity: 0.13;
  clip-path: inherit;
}

.note::after {
  content: "";
  position: absolute;
  right: 9px;
  bottom: 9px;
  width: 18px;
  height: 18px;
  opacity: 0.35;
  background-image: radial-gradient(circle, currentColor 1.4px, transparent 1.8px);
  background-size: 6px 6px;
}

.note[data-color="clay"] { --note-paper: #bd7e61; }
.note[data-color="sage"] { --note-paper: #a7ad91; }
.note[data-color="blue"] { --note-paper: #9cafb7; }
.note[data-color="butter"] { --note-paper: #dec481; }
.note[data-color="rose"] { --note-paper: #c98f82; }
.note[data-color="vellum"] {
  --note-paper: rgba(231, 220, 192, 0.72);
  backdrop-filter: blur(1.2px);
}

.note[data-attachment="tape"] {
  clip-path: polygon(0 3%, 22% 1%, 48% 2.5%, 73% 0.8%, 100% 2.8%, 99% 97%, 77% 99%, 51% 97.8%, 23% 100%, 1% 97%);
}

.note[data-attachment="tape"] .note-pin {
  top: -13px;
  left: calc(50% - 47px);
  width: 94px;
  height: 31px;
  border-radius: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.06) 0 4px, transparent 4px 7px),
    rgba(191, 151, 90, 0.52);
  border-left: 1px dashed rgba(90, 63, 37, 0.16);
  border-right: 1px dashed rgba(90, 63, 37, 0.16);
  box-shadow: 0 4px 8px rgba(53, 36, 20, 0.16);
  transform: rotate(-2deg);
}

.note[data-attachment="heart"] .note-pin {
  top: -4px;
  left: calc(50% - 13px);
  width: 26px;
  height: 24px;
  border-radius: 0;
  background: linear-gradient(145deg, #d9aa91, #9f6754);
  clip-path: polygon(50% 100%, 7% 58%, 0 37%, 5% 16%, 21% 3%, 39% 5%, 50% 19%, 61% 5%, 79% 3%, 95% 16%, 100% 37%, 93% 58%);
  transform: none;
}

.botanical-mark {
  position: absolute;
  z-index: 1;
  right: 9px;
  bottom: 7px;
  display: none;
  width: 90px;
  height: 90px;
  fill: none;
  stroke: rgba(65, 50, 39, 0.26);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.note[data-color="sage"] .botanical-mark,
.note[data-color="rose"] .botanical-mark,
.note[data-color="vellum"] .botanical-mark {
  display: block;
}

.fold-corner {
  position: absolute;
  z-index: 3;
  right: -1px;
  bottom: -1px;
  display: none;
  width: 62px;
  height: 62px;
  background: linear-gradient(135deg, rgba(242, 222, 170, 0.15) 47%, #f0d898 49%, #b49a62 100%);
  filter: drop-shadow(-4px -3px 4px rgba(71, 49, 27, 0.14));
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

.note[data-color="butter"] .fold-corner {
  display: block;
}

.note.selected {
  box-shadow: 0 28px 44px rgba(47, 33, 21, 0.38);
  z-index: 999999 !important;
}

.note.dragging {
  box-shadow: 0 32px 50px rgba(47, 33, 21, 0.36);
  filter: brightness(1.03);
}

.note-pin {
  z-index: 4;
  width: 24px;
  height: 24px;
  left: calc(50% - 12px);
  top: -6px;
  cursor: grab;
  touch-action: none;
}

.note-pin:active {
  cursor: grabbing;
}

.note-text {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 72px;
  padding: 0;
  resize: none;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
  font: 24px/1.64 "Kaiti SC", "STKaiti", "KaiTi", serif;
  letter-spacing: 0.04em;
  white-space: pre-wrap;
}

.note-text::placeholder {
  color: rgba(70, 55, 45, 0.46);
}

.note-text:focus-visible {
  outline: none;
}

.selection-frame {
  position: absolute;
  z-index: 5;
  inset: 3px;
  display: none;
  border: 2px solid rgba(255, 248, 230, 0.96);
  box-shadow: 0 0 0 1px rgba(70, 54, 43, 0.68);
  pointer-events: none;
}

.note.selected .selection-frame {
  display: block;
}

.resize-handle {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  width: 19px;
  height: 19px;
  display: none;
  border-radius: 50%;
  background: var(--ivory);
  border: 2px solid rgba(71, 55, 45, 0.7);
  cursor: nwse-resize;
}

.selection-dot {
  position: absolute;
  z-index: 6;
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(71, 55, 45, 0.65);
  border-radius: 50%;
  background: var(--ivory);
  pointer-events: none;
}

.note.selected .selection-dot {
  display: block;
}

.selection-dot.nw { left: 0; top: 0; }
.selection-dot.ne { right: 0; top: 0; }
.selection-dot.sw { left: 0; bottom: 0; }

.note.selected .resize-handle {
  display: block;
}

.brand-bar {
  position: fixed;
  z-index: 12;
  top: var(--safe-top);
  left: 30px;
  right: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.wordmark {
  padding: 5px 9px;
  color: rgba(253, 247, 232, 0.95);
  font: 29px/1 "Kaiti SC", "STKaiti", serif;
  letter-spacing: 0.09em;
  text-shadow: 0 2px 6px rgba(43, 29, 18, 0.4);
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
}

.account {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  pointer-events: auto;
}

.account-name-inline {
  margin-left: 2px;
  color: rgba(250, 243, 226, 0.94);
  font: 15px/1 Georgia, "Songti SC", serif;
  letter-spacing: 0.03em;
  text-shadow: 0 2px 5px rgba(43, 29, 18, 0.44);
}

.sync-state {
  display: flex;
  gap: 8px;
  align-items: center;
  color: rgba(250, 243, 226, 0.92);
  text-shadow: 0 2px 5px rgba(43, 29, 18, 0.44);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.sync-state i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #187e49;
  box-shadow: 0 0 0 3px rgba(24, 126, 73, 0.13);
}

.sync-state.saving i {
  background: #b6843e;
  animation: pulse 1s infinite ease-in-out;
}

.sync-state.error i {
  background: #923e32;
}

@keyframes pulse {
  50% { opacity: 0.35; }
}

.avatar {
  width: 42px;
  height: 42px;
  padding: 0;
  color: #f3ead9;
  font: 19px/1 Georgia, serif;
  background: linear-gradient(145deg, #705944, #3e3027);
  border: 2px solid rgba(249, 240, 219, 0.72);
  border-radius: 50%;
  box-shadow: 0 5px 13px rgba(45, 31, 20, 0.26);
  cursor: pointer;
}

.account-menu {
  position: absolute;
  top: 54px;
  right: 0;
  width: 190px;
  padding: 17px;
  background: rgba(245, 237, 220, 0.94);
  border: 1px solid rgba(78, 60, 45, 0.18);
  box-shadow: 0 18px 35px rgba(45, 31, 20, 0.25);
  backdrop-filter: blur(12px);
}

.account-menu strong,
.account-menu small {
  display: block;
}

.account-menu small {
  margin: 5px 0 15px;
  color: #8b745c;
  font: 10px/1 Georgia, serif;
  letter-spacing: 0.13em;
}

.account-menu button {
  width: 100%;
  padding: 8px 0;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(78, 60, 45, 0.16);
  cursor: pointer;
  text-align: left;
}

.dock,
.note-toolbar,
.color-picker,
.minimap,
.search-panel {
  background: rgba(245, 237, 220, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 14px 34px rgba(49, 34, 21, 0.25), inset 0 1px rgba(255, 255, 255, 0.44);
  backdrop-filter: blur(16px) saturate(0.75);
}

.dock {
  position: fixed;
  z-index: 11;
  left: 50%;
  bottom: var(--safe-bottom);
  display: flex;
  gap: 2px;
  padding: 9px 12px;
  transform: translateX(-50%);
  border-radius: 28px;
}

.dock button,
.note-toolbar button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 18px;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.note-toolbar button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dock button:hover,
.dock button.active,
.note-toolbar button:hover {
  background: rgba(111, 88, 64, 0.12);
}

.dock button:hover,
.note-toolbar button:hover {
  transform: translateY(-2px);
}

.dock svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fit-view-button {
  position: fixed;
  z-index: 10;
  left: 30px;
  bottom: 88px;
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  padding: 0;
  color: rgba(65, 49, 37, 0.88);
  background: rgba(245, 237, 220, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.43);
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(49, 34, 21, 0.22);
  backdrop-filter: blur(12px);
  cursor: pointer;
}

.fit-view-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.quick-add {
  position: fixed;
  z-index: 11;
  right: 34px;
  bottom: calc(var(--safe-bottom) + 10px);
  width: 55px;
  height: 55px;
  padding: 0 0 4px;
  color: #43342a;
  font: 39px/1 Georgia, serif;
  background: rgba(247, 239, 220, 0.91);
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  box-shadow: 0 13px 25px rgba(47, 32, 19, 0.25);
  cursor: pointer;
}

.note-toolbar {
  position: fixed;
  z-index: 13;
  display: flex;
  padding: 5px 7px;
  border-radius: 14px;
  transform: translate(-50%, -100%);
}

.note-toolbar::after {
  content: "";
  position: absolute;
  left: calc(50% - 7px);
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: rgba(239, 230, 210, 0.94);
  transform: rotate(45deg);
}

.note-toolbar button {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 36px;
  border-radius: 10px;
  font: 19px/1 Georgia, serif;
}

.note-toolbar .danger {
  color: #8a3e32;
}

.color-button span {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #c98f82;
  border: 1px solid rgba(67, 49, 36, 0.22);
}

.color-picker {
  position: fixed;
  z-index: 14;
  display: flex;
  gap: 9px;
  padding: 10px;
  border-radius: 18px;
}

.color-picker button {
  width: 25px;
  height: 25px;
  padding: 0;
  border: 1px solid rgba(64, 46, 33, 0.24);
  border-radius: 50%;
  cursor: pointer;
}

.color-picker [data-color="parchment"] { background: #eee2c8; }
.color-picker [data-color="rose"] { background: #c98f82; }
.color-picker [data-color="sage"] { background: #a7ad91; }
.color-picker [data-color="blue"] { background: #9cafb7; }
.color-picker [data-color="clay"] { background: #bd7e61; }
.color-picker [data-color="butter"] { background: #dec481; }
.color-picker [data-color="vellum"] { background: rgba(231, 220, 192, 0.7); }

.minimap {
  position: fixed;
  z-index: 10;
  right: 30px;
  bottom: 95px;
  width: 150px;
  height: 105px;
  overflow: hidden;
  border-radius: 14px;
}

.minimap-world,
.minimap-viewport {
  position: absolute;
  inset: 0;
}

.minimap-dot {
  position: absolute;
  width: 8px;
  height: 6px;
  transform: translate(-50%, -50%);
  background: #80684d;
  border-radius: 1px;
  opacity: 0.74;
}

.minimap-viewport {
  left: 50%;
  top: 50%;
  width: 52px;
  height: 34px;
  border: 1px dashed rgba(65, 48, 35, 0.68);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.minimap > span {
  position: absolute;
  right: 7px;
  bottom: 5px;
  font: 9px/1 Georgia, serif;
  letter-spacing: 0.08em;
}

.gesture-hint {
  position: fixed;
  z-index: 8;
  left: 28px;
  bottom: 32px;
  color: rgba(246, 237, 216, 0.76);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 4px rgba(49, 34, 21, 0.42);
  transition: opacity 500ms ease;
  pointer-events: none;
}

.gesture-hint span {
  font-size: 21px;
  vertical-align: -2px;
}

.gesture-hint.fade {
  opacity: 0;
}

.search-panel {
  position: fixed;
  z-index: 15;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100vw - 34px));
  max-height: min(520px, calc(100vh - 100px));
  padding: 18px;
  overflow: auto;
  transform: translate(-50%, -50%);
  border-radius: 20px;
}

.search-panel > div {
  display: flex;
  border-bottom: 1px solid rgba(72, 55, 42, 0.25);
}

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

.search-panel > div button {
  padding: 0 8px;
  font-size: 29px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.search-panel ol {
  display: grid;
  gap: 7px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.search-panel li button {
  width: 100%;
  padding: 13px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-hint {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(245, 236, 215, 0.72);
  letter-spacing: 0.13em;
  text-shadow: 0 2px 6px rgba(50, 34, 20, 0.33);
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 21px;
  padding: 9px 16px;
  color: #f7eedc;
  background: rgba(65, 49, 38, 0.88);
  border-radius: 18px;
  transform: translate(-50%, -60px);
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
  pointer-events: none;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

@media (max-width: 760px) {
  .login-scrap {
    display: none;
  }

  .login-card {
    padding: 55px 35px 34px;
  }

  .brand-bar {
    top: var(--safe-top);
    left: 14px;
    right: 14px;
  }

  .wordmark {
    font-size: 24px;
  }

  .sync-state b {
    font-size: 11px;
  }

  .account-name-inline {
    display: none;
  }

  .avatar {
    width: 37px;
    height: 37px;
  }

  .note-text {
    font-size: 22px;
  }

  .note-toolbar {
    max-width: calc(100vw - 18px);
  }

  .note-toolbar button {
    width: 36px;
    height: 38px;
  }

  .dock {
    bottom: calc(var(--safe-bottom) + 3px);
    padding: 7px 9px;
  }

  .dock button {
    width: 50px;
    height: 48px;
  }

  .quick-add {
    right: 18px;
    bottom: calc(var(--safe-bottom) + 80px);
  }

  .minimap {
    right: 15px;
    bottom: calc(var(--safe-bottom) + 150px);
    width: 104px;
    height: 75px;
  }

  .gesture-hint {
    left: 16px;
    bottom: calc(var(--safe-bottom) + 92px);
    width: 140px;
    line-height: 1.5;
  }

  .fit-view-button {
    left: 15px;
    bottom: calc(var(--safe-bottom) + 150px);
  }
}

@media (max-height: 650px) {
  .gesture-hint,
  .minimap {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
