/* =========================================================
   TWO OF US — 两个人的桌面
   Neo-brutalist desktop OS · romantic palette
   ========================================================= */

:root {
  --ink: #1d1720;
  --ink-2: #4d3d46;
  --ink-3: #8b737e;
  --paper: #f8ece7;
  --paper-deep: #ecd7d0;
  --card: #fffaf4;
  --card-2: #fdf3ec;
  --rose: #e4577b;
  --rose-deep: #c93b63;
  --rose-soft: #f9d3dc;
  --plum: #5b2a45;
  --lilac: #cbb6ee;
  --lilac-soft: #e9def8;
  --butter: #f5d98b;
  --butter-soft: #fbeec8;
  --peach: #f7c3a6;
  --sage: #b8d8c0;
  --sky: #a9c7e8;

  --font-ui: "Segoe UI Variable Text", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --font-display: "Arial Black", "Segoe UI Black", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", "Consolas", "SFMono-Regular", "Microsoft YaHei UI", monospace;

  --border: 2px solid var(--ink);
  --shadow-md: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius: 11px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(29, 23, 32, 0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(29, 23, 32, 0.05) 1px, transparent 1px),
    linear-gradient(to right, rgba(29, 23, 32, 0.075) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(29, 23, 32, 0.075) 1px, transparent 1px),
    radial-gradient(1100px 700px at 85% 6%, rgba(228, 87, 123, 0.12), transparent 62%),
    radial-gradient(900px 620px at 4% 96%, rgba(203, 182, 238, 0.28), transparent 66%);
  background-size: 20px 20px, 20px 20px, 100px 100px, 100px 100px, 100%, 100%;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--rose-soft);
  color: var(--ink);
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6, p {
  margin: 0;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 2px;
}

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

.mono {
  font-family: var(--font-mono);
}

/* =========================
   Desktop background & decor
   ========================= */

.desktop {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.desktop__glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(640px 440px at 76% 28%, rgba(228, 87, 123, 0.09), transparent 65%),
    radial-gradient(520px 420px at 22% 76%, rgba(245, 217, 139, 0.16), transparent 70%);
}

.brand {
  position: fixed;
  top: 20px;
  left: 24px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 9px;
  border: var(--border);
  border-radius: 10px;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}

.brand__mark {
  display: block;
  width: 52px;
  height: 26px;
  object-fit: contain;
}

.brand__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.2;
}

.brand__text strong {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.brand__text span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.today {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  padding: 7px 12px;
  border: var(--border);
  border-radius: 10px;
  background: rgba(255, 250, 244, 0.94);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(4px);
}

.today__time {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.today__date {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.today__days {
  margin-top: 2px;
  padding: 1px 5px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--rose-soft);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  white-space: nowrap;
}

.decor-eyes {
  position: absolute;
  top: 3.8%;
  left: 50%;
  z-index: 0;
  width: clamp(392px, 34vw, 572px);
  height: auto;
  overflow: visible;
  opacity: 0.95;
  transform: translateX(-50%) rotate(-1.5deg);
  pointer-events: none;
  user-select: none;
}

.decor-eyes .eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: eyeBlink 7.6s infinite;
}

.decor-eyes .eye--right {
  animation-delay: 0.16s;
}

.decor-eyes .eye__socket {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.6;
  vector-effect: non-scaling-stroke;
}

.decor-eyes .eye__pupil circle {
  fill: var(--ink);
}

@keyframes eyeBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(0.08); }
  96% { transform: scaleY(1); }
}

.heart-layer {
  position: fixed;
  inset: 0;
  z-index: 500;
  overflow: hidden;
  pointer-events: none;
}

.trail-heart {
  position: absolute;
  width: var(--size, 14px);
  height: var(--size, 14px);
  margin-top: calc(var(--size, 14px) / -2);
  margin-left: calc(var(--size, 14px) / -2);
  color: var(--rose);
  opacity: 0;
  filter: drop-shadow(0 1px 0 rgba(29, 23, 32, 0.12));
  animation: heartRise var(--dur, 1s) cubic-bezier(0.16, 0.7, 0.3, 1) forwards;
  will-change: transform, opacity;
}

.trail-heart svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.window__body h1,
.window__body h2,
.window__body h3,
.window__body h4,
.window__body h5,
.window__body .eyebrow,
.lightbox__copy h3,
.editor__body h3,
.editor__body .eyebrow {
  cursor: pointer;
}

@keyframes heartRise {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(0.5) rotate(var(--rot, 0deg));
  }
  12% {
    opacity: var(--opacity, 0.96);
  }
  68% {
    opacity: var(--opacity, 0.96);
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 0px), var(--dy, -30px), 0) scale(var(--scale, 1)) rotate(var(--rot, 0deg));
  }
}

.desk-note {
  position: absolute;
  top: 47%;
  right: 5%;
  z-index: 0;
  width: 166px;
  padding: 22px 16px 14px;
  border: var(--border);
  border-radius: 8px;
  background: var(--butter);
  box-shadow: var(--shadow-md);
  transform: rotate(3.2deg);
  pointer-events: none;
  user-select: none;
}

.desk-note__tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 70px;
  height: 20px;
  background: rgba(255, 250, 244, 0.78);
  border: 1.5px solid rgba(29, 23, 32, 0.22);
  transform: translateX(-50%) rotate(-3deg);
}

.desk-note__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.desk-note p {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.desk-note__from {
  display: block;
  margin-top: 8px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-2);
}

.desk-frame {
  position: absolute;
  top: 60%;
  left: 31%;
  z-index: 0;
  width: clamp(450px, 37vw, 600px);
  margin: 0;
  padding: 16px 16px 18px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 12px 12px 0 var(--ink);
  transform: translate(-50%, -50%) rotate(-2.6deg);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.desk-frame:hover {
  box-shadow: 14px 14px 0 var(--ink);
  transform: translate(-50%, -50%) translate(-2px, -2px) rotate(-1.4deg);
}

.desk-frame__tape {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 2;
  width: 100px;
  height: 26px;
  border: 2px solid rgba(29, 23, 32, 0.22);
  background: rgba(255, 250, 244, 0.8);
  transform: translateX(-50%) rotate(-3deg);
  pointer-events: none;
}

.desk-frame__hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.desk-frame__hit:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
}

.desk-frame__edit {
  position: absolute;
  top: -18px;
  right: -16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  background: var(--rose-soft);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  transform: rotate(3deg);
  cursor: pointer;
  transition: background 0.12s ease, transform 0.12s ease;
}

.desk-frame__edit:hover {
  background: var(--butter);
  transform: rotate(1deg) translate(-1px, -1px);
}

.desk-frame__mat {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(228, 87, 123, 0.18), transparent 55%),
    var(--paper);
}

.desk-frame__photo {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  object-fit: cover;
  transition: opacity 0.28s ease;
}

.desk-frame__photo.is-loading {
  opacity: 0;
}

.desk-frame__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-3);
  text-align: center;
}

.desk-frame__empty[hidden] {
  display: none;
}

.desk-frame__caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px 0;
}

.desk-frame__title {
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desk-frame__count {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.desk-frame.is-empty .desk-frame__photo {
  display: none;
}

/* =========================
   Windows
   ========================= */

.desktop__windows {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.window {
  position: absolute;
  display: none;
  flex-direction: column;
  max-height: calc(100vh - 186px);
  max-height: calc(100dvh - 186px);
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 8px 8px 0 var(--ink);
  pointer-events: auto;
  will-change: left, top;
}

.window.is-open {
  display: flex;
  animation: windowIn 0.2s cubic-bezier(0.2, 0.85, 0.25, 1) both;
}

.window.is-dragging {
  cursor: grabbing;
  user-select: none;
  box-shadow: 12px 12px 0 var(--ink);
}

.window--home { width: min(700px, calc(100vw - 48px)); }
.window--story { width: min(620px, calc(100vw - 48px)); }
.window--gallery { width: min(790px, calc(100vw - 48px)); }
.window--places { width: min(830px, calc(100vw - 48px)); }
.window--diary { width: min(880px, calc(100vw - 48px)); }
.window--addtag { width: min(690px, calc(100vw - 48px)); }
.window--tag { width: min(650px, calc(100vw - 48px)); }

.window__bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 9px 8px 14px;
  border-bottom: 2.5px solid var(--ink);
  background: var(--card);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.window.is-dragging .window__bar {
  cursor: grabbing;
}

.window__dots {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(2, 3px);
  gap: 2.5px;
  opacity: 0.7;
}

.window__dots i {
  display: block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink);
}

.window__title {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.window__title span {
  overflow: hidden;
  max-width: 180px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 400;
  letter-spacing: 0.13em;
  text-overflow: ellipsis;
  color: var(--ink-3);
}

.window__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 29px;
  height: 29px;
  margin-left: auto;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.window__close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.window__close:hover {
  background: var(--rose);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.window__close:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(1px, 1px);
}

.window__edit {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: auto;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.window__edit svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.window__edit:hover {
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.window__edit:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(1px, 1px);
}

.window__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 24px;
  scrollbar-color: var(--rose-soft) transparent;
  scrollbar-width: thin;
}

.window__body::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.window__body::-webkit-scrollbar-track {
  background: transparent;
}

.window__body::-webkit-scrollbar-thumb {
  border: 2px solid var(--card);
  border-radius: 99px;
  background: var(--rose-soft);
}

.window__body::-webkit-scrollbar-thumb:hover {
  background: var(--rose);
}

/* =========================
   Shared type & controls
   ========================= */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--ink);
}

.display {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.025em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: var(--border);
  border-radius: 8px;
  background: var(--ink);
  box-shadow: 3px 3px 0 var(--rose);
  color: var(--card);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.btn:hover {
  box-shadow: 4px 4px 0 var(--rose);
  transform: translate(-1px, -1px);
}

.btn:active {
  box-shadow: 1px 1px 0 var(--rose);
  transform: translate(2px, 2px);
}

.btn--ghost {
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
}

.btn--ghost:hover {
  box-shadow: 4px 4px 0 var(--ink);
}

.btn--ghost:active {
  box-shadow: 1px 1px 0 var(--ink);
}

.btn--small {
  padding: 5px 9px;
  font-size: 11px;
  box-shadow: 2px 2px 0 var(--rose);
}

.btn--small.btn--ghost {
  box-shadow: 2px 2px 0 var(--ink);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--butter);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pill--lilac { background: var(--lilac-soft); }
.pill--rose { background: var(--rose-soft); }
.pill--sage { background: var(--sage); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: var(--border);
  border-radius: 6px;
  background: var(--rose);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.35;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.chip:nth-child(2n) { background: var(--peach); }
.chip:nth-child(3n) { background: var(--lilac); }
.chip:nth-child(4n) { background: var(--butter); }

.chip:hover {
  box-shadow: 3px 3px 0 var(--ink);
  transform: translate(-1px, -1px);
}

.chip:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(1px, 1px);
}

.chip--ghost {
  background: var(--card) !important;
}

.icon-btn {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  transition: background 0.12s ease, transform 0.12s ease;
}

.icon-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.2;
}

.icon-btn:hover {
  background: var(--rose-soft);
  transform: translate(-1px, -1px);
}

.text-btn {
  border-bottom: 1.5px solid var(--ink-3);
  padding-bottom: 1px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink-3);
  transition: color 0.12s ease, border-color 0.12s ease;
}

.text-btn:hover {
  border-color: var(--rose);
  color: var(--rose-deep);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 5px;
  min-height: 110px;
  padding: 18px;
  border: 2px dashed var(--ink-3);
  border-radius: 9px;
  background: rgba(255, 250, 244, 0.5);
  color: var(--ink-3);
  font-size: 12px;
  text-align: center;
}

.empty-state strong {
  color: var(--ink-2);
  font-size: 13px;
}

.progress {
  height: 11px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
}

.progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--rose);
  transition: width 0.3s ease;
}

/* =========================
   Home
   ========================= */

.home {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.home__title {
  margin: 5px 0 2px;
  font-family: var(--font-display);
  font-size: clamp(42px, 4.4vw, 58px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.home__title .amp {
  display: inline-block;
  margin: 0 0.1em;
  color: var(--rose);
  transform: rotate(-4deg);
}

.home__subtitle {
  max-width: 54ch;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
}

.home__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  border: var(--border);
  border-radius: 9px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
}

.home__stat {
  min-width: 0;
  padding: 9px 12px;
  border-right: 2px solid var(--ink);
}

.home__stat:last-child {
  border-right: 0;
}

.home__stat-value {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.home__stat-value small {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink-3);
}

.home__stat-label {
  overflow: hidden;
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home__grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 13px;
  align-items: stretch;
}

.note-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 15px 13px;
  border: var(--border);
  border-radius: 9px;
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-1.1deg);
}

.note-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 50%;
  width: 62px;
  height: 16px;
  border: 1.5px solid rgba(29, 23, 32, 0.22);
  background: rgba(255, 250, 244, 0.8);
  transform: translateX(-50%) rotate(-2.5deg);
}

.note-card__label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}

.note-card__text {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.65;
}

.note-card__text.is-placeholder {
  color: var(--ink-2);
  font-weight: 600;
}

.note-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: auto;
  padding-top: 2px;
}

.note-card__from {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-2);
}

.note-card__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.note-card__nav button {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  box-shadow: 1px 1px 0 var(--ink);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.note-card__nav button:hover {
  background: var(--rose-soft);
}

.note-card__count {
  min-width: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--ink-2);
}

.count-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 7px;
  padding: 13px 15px;
  border: var(--border);
  border-radius: 9px;
  background: var(--lilac-soft);
  box-shadow: 4px 4px 0 var(--ink);
}

.count-card__label {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.count-card__number {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
}

.count-card__number small {
  margin-left: 3px;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-2);
}

.count-card__hint {
  font-family: var(--font-mono);
  font-size: 8.5px;
  line-height: 1.5;
  color: var(--ink-2);
}

.home__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.home__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
  padding-top: 10px;
  border-top: 2px dashed var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 8.5px;
  color: var(--ink-3);
}

.home__foot kbd {
  padding: 0 3px;
  border: 1px solid var(--ink-3);
  border-radius: 3px;
  background: var(--card);
  font-family: inherit;
  font-size: 8px;
}

/* =========================
   Story
   ========================= */

.story__head {
  margin-bottom: 16px;
}

.story__head h3 {
  margin: 5px 0 4px;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.story__head p {
  color: var(--ink-2);
  font-size: 12.5px;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-left: 6px;
  padding-left: 23px;
  border-left: 2.5px dashed var(--paper-deep);
}

.timeline__item {
  position: relative;
  padding: 11px 14px;
  border: var(--border);
  border-radius: 9px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
}

.timeline__item::before {
  content: "";
  position: absolute;
  top: 16px;
  left: -32px;
  width: 10px;
  height: 10px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 3px var(--paper);
}

.timeline__item:nth-child(2n)::before { background: var(--butter); }
.timeline__item:nth-child(3n)::before { background: var(--lilac); }
.timeline__item:nth-child(4n)::before { background: var(--sage); }

.timeline__meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline__date {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.timeline__tag {
  margin-left: auto;
  padding: 1px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--lilac-soft);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.timeline__title {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.timeline__text {
  margin-top: 3px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.timeline__end {
  position: relative;
  padding: 13px 14px;
  border: 2px dashed var(--ink-3);
  border-radius: 9px;
  background: rgba(249, 211, 220, 0.35);
  text-align: center;
}

.timeline__end::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -32px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--ink-3);
  border-radius: 50%;
  background: var(--card);
  transform: translateY(-50%);
}

.timeline__end strong {
  display: block;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
}

.timeline__end span {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

/* =========================
   Gallery
   ========================= */

.gallery__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  margin-bottom: 13px;
}

.gallery__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter {
  padding: 3px 9px;
  border: var(--border);
  border-radius: 5px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.5;
  transition: transform 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.filter:hover {
  transform: translate(-1px, -1px);
}

.filter.is-active {
  background: var(--ink);
  color: var(--card);
}

.gallery__count {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-3);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.photo-card {
  position: relative;
  overflow: hidden;
  border: var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  text-align: left;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.photo-card:hover {
  box-shadow: 5px 5px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.photo-card__media {
  position: relative;
  display: block;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-deep);
  aspect-ratio: 1;
}

.photo-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-card:hover .photo-card__media img {
  transform: scale(1.035);
}

.photo-card__cat {
  position: absolute;
  top: 7px;
  left: 7px;
  padding: 1px 5px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: rgba(255, 250, 244, 0.92);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
}

.photo-card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
}

.photo-card__title {
  overflow: hidden;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card__date {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--ink-3);
}

.gallery__empty {
  grid-column: 1 / -1;
}

/* =========================
   Lightbox
   ========================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 18px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 23, 32, 0.66);
  backdrop-filter: blur(3px);
}

.lightbox__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(800px, 100%);
  max-height: 92vh;
  max-height: 92dvh;
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 10px 10px 0 rgba(29, 23, 32, 0.9);
  animation: windowIn 0.2s ease both;
}

.lightbox__stage {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  background: var(--paper);
}

.lightbox__frame {
  display: grid;
  place-items: center;
  min-width: 0;
}

.lightbox__frame img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 56vh;
  max-height: 56dvh;
  border: 2px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
  object-fit: contain;
}

.lightbox__nav {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 17px;
  font-weight: 900;
  transition: transform 0.12s ease, background 0.12s ease;
}

.lightbox__nav:hover {
  background: var(--butter);
  transform: translate(-1px, -1px);
}

.lightbox__foot {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 14px;
  border-top: 2.5px solid var(--ink);
}

.lightbox__copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.lightbox__copy h3 {
  width: 100%;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.lightbox__copy p {
  max-width: 64ch;
  font-family: var(--font-ui);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--ink-2);
}

.lightbox__count {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--ink-3);
}

/* =========================
   Places
   ========================= */

.places__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}

.places__head h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.places__head p {
  max-width: 44ch;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 12px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 13px;
  border: var(--border);
  border-radius: 9px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
}

.mini-stat {
  padding: 8px 12px;
  border-right: 2px solid var(--ink);
}

.mini-stat:last-child {
  border-right: 0;
}

.mini-stat__value {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
}

.mini-stat__value small {
  font-family: var(--font-ui);
  font-size: 8.5px;
  color: var(--ink-3);
}

.mini-stat__label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.map-card {
  position: relative;
  overflow: hidden;
  border: var(--border);
  border-radius: 10px;
  background: var(--card-2);
  box-shadow: 4px 4px 0 var(--ink);
}

.map-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.map-card__caption {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 2px 6px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: rgba(255, 250, 244, 0.92);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.map-pin {
  cursor: pointer;
}

.map-pin circle.pin-dot {
  transition: transform 0.15s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.map-pin:hover circle.pin-dot {
  transform: scale(1.12);
}

.places__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 9px;
}

.places__section-head h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
}

.places__section-head span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

.stamps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stamp-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 9px 11px;
  border: var(--border);
  border-radius: 9px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
}

.stamp-card:nth-child(2n) { background: var(--butter-soft); }
.stamp-card:nth-child(3n) { background: var(--lilac-soft); }

.stamp-card.is-highlight {
  animation: stampPulse 1.3s ease;
}

.stamp-card__seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  border: 2px dashed var(--ink);
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px rgba(29, 23, 32, 0.25);
  transform: rotate(-8deg);
}

.stamp-card__city {
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
}

.stamp-card__date {
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--ink-3);
}

.stamp-card__body {
  min-width: 0;
}

.stamp-card__body h5 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.stamp-card__body p {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 10.5px;
  line-height: 1.55;
}

.wishlist {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 2px dashed var(--paper-deep);
}

.wishlist__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wishlist__card {
  padding: 8px 10px;
  border: 2px dashed var(--ink);
  border-radius: 7px;
  background: var(--card);
}

.wishlist__name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
}

.wishlist__name::before {
  content: "✈";
  font-size: 10px;
}

.wishlist__memo {
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 9.5px;
  line-height: 1.5;
}

/* =========================
   Diary
   ========================= */

.diary__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 13px;
}

.diary__toolbar h3 {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.diary {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  overflow: hidden;
  min-height: 380px;
  border: var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 4px 4px 0 var(--ink);
}

.diary__list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 438px;
  overflow: auto;
  padding: 9px;
  border-right: 2px solid var(--ink);
  background: var(--card-2);
  scrollbar-color: var(--rose-soft) transparent;
  scrollbar-width: thin;
}

.diary__list::-webkit-scrollbar { width: 9px; }
.diary__list::-webkit-scrollbar-thumb {
  border: 2px solid var(--card-2);
  border-radius: 99px;
  background: var(--rose-soft);
}

.diary__item {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 2px solid transparent;
  border-radius: 7px;
  text-align: left;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.diary__item:hover {
  border-color: var(--ink);
  background: var(--card);
}

.diary__item.is-active {
  border-color: var(--ink);
  background: var(--rose-soft);
  box-shadow: 2px 2px 0 var(--ink);
}

.diary__item-top {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.diary__item-mood {
  margin-left: auto;
  font-size: 12px;
}

.diary__item-title {
  display: block;
  max-width: 100%;
  margin-top: 3px;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary__item-excerpt {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diary__detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 438px;
  overflow: auto;
  padding: 16px 18px 18px;
  scrollbar-color: var(--rose-soft) transparent;
  scrollbar-width: thin;
}

.diary__detail::-webkit-scrollbar { width: 9px; }
.diary__detail::-webkit-scrollbar-thumb {
  border: 2px solid var(--card);
  border-radius: 99px;
  background: var(--rose-soft);
}

.diary__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.diary__meta time {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
}

.diary__title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.diary__body {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}

.diary__detail-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 2px dashed var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.diary__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.diary__form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.diary__form-head h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field > label,
.field__label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-2);
  text-transform: uppercase;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 7px 9px;
  border: var(--border);
  border-radius: 6px;
  background: var(--card);
  box-shadow: 2px 2px 0 rgba(29, 23, 32, 0.13);
  font-family: var(--font-ui);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
  transition: box-shadow 0.12s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--rose);
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.75;
}

.mood-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mood-choice {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 15px;
  line-height: 1;
  transition: transform 0.12s ease, background 0.12s ease;
}

.mood-choice:hover {
  transform: translate(-1px, -1px);
}

.mood-choice.is-active {
  background: var(--rose-soft);
  box-shadow: 3px 3px 0 var(--ink);
}

.diary__form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

/* =========================
   Make-a-tag window
   ========================= */

.addtag {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.addtag__lead {
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

.addtag__form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.addtag__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  gap: 10px;
  align-items: start;
}

.icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.icon-choice {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  border: var(--border);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s ease, background 0.12s ease;
}

.icon-choice svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.icon-choice:hover {
  transform: translate(-1px, -1px);
}

.icon-choice.is-active {
  background: var(--rose);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--card);
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.type-choice {
  padding: 7px 9px;
  border: var(--border);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  text-align: left;
  transition: transform 0.12s ease, background 0.12s ease;
}

.type-choice strong {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
}

.type-choice span {
  display: block;
  margin-top: 1px;
  color: var(--ink-3);
  font-size: 9px;
  line-height: 1.4;
}

.type-choice:hover {
  transform: translate(-1px, -1px);
}

.type-choice.is-active {
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--ink);
}

.addtag__submit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.addtag__hint {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.tag-manager {
  margin-top: 3px;
  padding-top: 13px;
  border-top: 2px dashed var(--paper-deep);
}

.tag-manager__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tag-manager__head h4 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 900;
}

.tag-manager__head span {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.tag-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: var(--border);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
}

.tag-row__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--rose-soft);
}

.tag-row__icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.tag-row__name {
  overflow: hidden;
  flex: 1 1 auto;
  font-size: 11.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-row__type {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.tag-row__open {
  flex: 0 0 auto;
}

/* =========================
   Custom tag windows
   ========================= */

.tag-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tag-view__head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 11px;
  border-bottom: 2px dashed var(--paper-deep);
}

.tag-view__icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  flex: 0 0 auto;
  border: var(--border);
  border-radius: 9px;
  background: var(--rose-soft);
  box-shadow: 3px 3px 0 var(--ink);
}

.tag-view__icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.tag-view__title {
  min-width: 0;
}

.tag-view__title h3 {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-view__title span {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}

.tag-view__intro {
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.7;
}

.tag-view__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  padding-top: 10px;
  border-top: 2px dashed var(--paper-deep);
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border: var(--border);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
}

.check-item input[type="checkbox"] {
  position: relative;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  appearance: none;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--card);
  cursor: pointer;
}

.check-item input[type="checkbox"]:checked {
  background: var(--rose);
}

.check-item input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--ink);
}

.check-item__text {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 1px;
  font-size: 12px;
  line-height: 1.55;
  word-break: break-word;
  cursor: pointer;
}

.check-item.is-done .check-item__text {
  color: var(--ink-3);
  text-decoration: line-through;
}

.check-item .icon-btn {
  width: 22px;
  height: 22px;
  box-shadow: 1px 1px 0 var(--ink);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.check-item .icon-btn svg {
  width: 11px;
  height: 11px;
}

.check-item:hover .icon-btn,
.check-item:focus-within .icon-btn {
  opacity: 1;
}

.inline-form {
  display: flex;
  gap: 7px;
  margin-top: 2px;
}

.inline-form .input {
  flex: 1 1 auto;
  min-width: 0;
}

.inline-form .btn,
.notes-form .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}

.inline-form--links {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr) auto;
}

.countdown-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 18px;
  border: var(--border);
  border-radius: 11px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 250, 244, 0.75), transparent 55%),
    linear-gradient(135deg, var(--lilac-soft), var(--rose-soft));
  box-shadow: 4px 4px 0 var(--ink);
  text-align: center;
}

.countdown-card__label {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  color: var(--ink-2);
}

.countdown-card__number {
  font-family: var(--font-display);
  font-size: clamp(46px, 8vw, 66px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
}

.countdown-card__number small {
  margin-left: 4px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}

.countdown-card__date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--ink-2);
}

.countdown__edit {
  margin-top: 2px;
  padding-top: 10px;
  border-top: 2px dashed var(--paper-deep);
}

.notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sticky-note {
  position: relative;
  min-height: 118px;
  padding: 13px 11px 25px;
  border: var(--border);
  border-radius: 7px;
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 11.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  transform: rotate(-0.7deg);
}

.sticky-note:nth-child(3n + 2) {
  background: var(--rose-soft);
  transform: rotate(0.9deg);
}

.sticky-note:nth-child(3n + 3) {
  background: var(--sage);
  transform: rotate(-1.2deg);
}

.sticky-note .icon-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 21px;
  height: 21px;
  box-shadow: 1px 1px 0 var(--ink);
  opacity: 0;
  transition: opacity 0.12s ease;
}

.sticky-note:hover .icon-btn,
.sticky-note:focus-within .icon-btn {
  opacity: 1;
}

.sticky-note__date {
  position: absolute;
  right: 8px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 7px;
  color: var(--ink-2);
}

.notes-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: end;
}

.notes-form .textarea {
  min-height: 58px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: var(--border);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
}

.link-row__mark {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--butter);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.link-row__body {
  min-width: 0;
  flex: 1 1 auto;
}

.link-row__body a {
  display: block;
  overflow: hidden;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-row__body a:hover {
  color: var(--rose-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-row__host {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 7.5px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================
   Dock
   ========================= */

.dock {
  position: fixed;
  bottom: 22px;
  left: 50%;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border: 2.5px solid var(--ink);
  border-radius: 15px;
  background: var(--card);
  box-shadow: 7px 7px 0 var(--ink);
  transform: translateX(-50%);
}

.dock__item {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 47px;
  height: 47px;
  border: var(--border);
  border-radius: 9px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.dock__item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dock__item:hover {
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.dock__item:active {
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(1px, 1px);
}

.dock__item.is-active {
  background: var(--rose-soft);
  outline: 2.5px solid var(--rose);
  outline-offset: 2px;
}

.dock__item::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 11px);
  left: 50%;
  padding: 4px 8px;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  background: var(--ink);
  box-shadow: 2px 2px 0 var(--rose);
  color: var(--card);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(3px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.dock__item:hover::after,
.dock__item:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.dock__extras {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dock__actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dock__divider {
  width: 2px;
  height: 29px;
  margin: 0 2px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.85;
}

.dock__item--command {
  background: var(--ink);
  color: var(--card);
}

.dock__item--command:hover {
  background: var(--plum);
}

.dock__item--command svg {
  stroke-width: 1.7;
}

/* =========================
   Command palette
   ========================= */

.palette {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 11vh 16px 16px;
}

.palette[hidden] {
  display: none;
}

.palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 23, 32, 0.48);
  backdrop-filter: blur(2px);
}

.palette__panel {
  position: relative;
  width: min(600px, 100%);
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 10px 10px 0 var(--ink);
  animation: paletteIn 0.16s ease both;
}

.palette__search {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 14px;
  border-bottom: 2px solid var(--ink);
}

.palette__search-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-2);
  stroke-linecap: round;
  stroke-width: 2;
}

.palette__search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
}

.palette__search input::placeholder {
  color: var(--ink-3);
}

.palette__search kbd,
.palette__foot kbd {
  display: inline-block;
  padding: 0 4px;
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  background: var(--card);
  box-shadow: 1px 1px 0 var(--ink);
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
}

.palette__results {
  max-height: 480px;
  max-height: min(480px, calc(100dvh - 190px));
  overflow: auto;
  padding: 6px;
  scrollbar-color: var(--rose-soft) transparent;
  scrollbar-width: thin;
}

.palette__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
  transition: background 0.12s ease, transform 0.12s ease;
}

.palette__close svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 2.4;
}

.palette__close:hover {
  background: var(--rose-soft);
  transform: translate(-1px, -1px);
}

.palette__group-label {
  padding: 6px 8px 3px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.palette__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 2px solid transparent;
  border-radius: 7px;
  text-align: left;
  font-size: 12.5px;
}

.palette__item svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.palette__item-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.palette__item-hint {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.palette__item:hover,
.palette__item.is-active {
  border-color: var(--ink);
  background: var(--rose-soft);
}

.palette__empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--ink-3);
  font-size: 12px;
}

.palette__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 7px 12px;
  border-top: 2px solid var(--ink);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-2);
}

.palette__foot span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* =========================
   Toast
   ========================= */

.toast {
  position: fixed;
  bottom: 112px;
  left: 50%;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--rose);
  color: var(--card);
  font-size: 12px;
  font-weight: 600;
  transform: translateX(-50%);
  animation: toastIn 0.18s ease both;
}

.toast[hidden] {
  display: none;
}

.toast__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--rose);
}

/* =========================
   Content editor
   ========================= */

.editor {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 18px;
}

.editor[hidden] {
  display: none;
}

.editor__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 23, 32, 0.52);
  backdrop-filter: blur(3px);
}

.editor__panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 36px));
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  border: 2.5px solid var(--ink);
  border-radius: 13px;
  background: var(--card);
  box-shadow: 10px 10px 0 var(--ink);
  animation: windowIn 0.18s ease both;
}

.editor__panel .window__bar {
  cursor: default;
}

.editor__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 22px;
  scrollbar-color: var(--rose-soft) transparent;
  scrollbar-width: thin;
}

.editor__body::-webkit-scrollbar {
  width: 10px;
}

.editor__body::-webkit-scrollbar-thumb {
  border: 2px solid var(--card);
  border-radius: 99px;
  background: var(--rose-soft);
}

.editor__lead {
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}

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

.editor__form {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.editor__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.editor__section {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 2px dashed var(--paper-deep);
}

.editor__section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}

.editor__section-head h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.editor__section-head span {
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
}

.editor__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 3px;
}

.editor__hint {
  margin-right: auto;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  color: var(--ink-3);
}

.editor__empty {
  padding: 13px;
  border: 2px dashed var(--ink-3);
  border-radius: 7px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
}

.edit-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 10px 0;
}

.edit-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: var(--border);
  border-radius: 7px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--ink);
}

.edit-row--photo {
  align-items: center;
}

.edit-row__thumb {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 5px;
  background: var(--paper-deep);
  object-fit: cover;
}

.edit-row__mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 2px dashed var(--ink);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-2);
  transform: rotate(-5deg);
}

.edit-row__body {
  min-width: 0;
  flex: 1 1 auto;
}

.edit-row__body strong {
  display: block;
  overflow: hidden;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-row__body span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  font-family: var(--font-mono);
  font-size: 8px;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-row .text-btn {
  flex: 0 0 auto;
}

.editor__divider {
  height: 2px;
  margin: 14px 0;
  border-radius: 2px;
  background: var(--paper-deep);
}

.input[type="file"] {
  padding: 5px 8px;
  font-size: 11px;
}

.editor__photo-hint {
  margin-top: -3px;
  font-family: var(--font-mono);
  font-size: 8px;
  line-height: 1.6;
  color: var(--ink-3);
}

.editor__body .field-row {
  gap: 9px;
}

.editor__body .textarea {
  min-height: 74px;
}

.editor__body .btn[disabled] {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

@media (max-width: 860px) {
  .editor {
    padding: 8px;
  }

  .editor__panel {
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-width: 2px;
    border-radius: 11px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .editor__body {
    padding: 14px 14px 18px;
  }

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

  .edit-row__thumb {
    width: 36px;
    height: 36px;
  }

  .edit-row .text-btn {
    font-size: 10px;
  }
}

/* =========================
   Motion
   ========================= */

@keyframes windowIn {
  from { opacity: 0; transform: translateY(9px) scale(0.987); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes paletteIn {
  from { opacity: 0; transform: translateY(-7px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 7px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes stampPulse {
  0%, 100% { box-shadow: 3px 3px 0 var(--ink); }
  25% { box-shadow: 3px 3px 0 var(--ink), 0 0 0 4px var(--rose); }
  60% { box-shadow: 3px 3px 0 var(--ink), 0 0 0 2px var(--rose); }
}

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

/* =========================
   Responsive
   ========================= */

@media (max-width: 1180px) {
  .desk-note,
  .desk-frame {
    display: none;
  }
}

@media (max-width: 960px) {
  .home__title {
    font-size: clamp(36px, 5.2vw, 48px);
  }
}

@media (max-height: 820px) and (min-width: 1181px) {
  .desk-frame {
    display: none;
  }
}

@media (max-width: 860px) {
  .brand {
    top: calc(env(safe-area-inset-top) + 10px);
    left: 10px;
    gap: 7px;
    padding: 5px 8px 5px 6px;
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--ink);
  }
  .brand__mark {
    width: 40px;
    height: 20px;
  }
  .brand__text strong {
    font-size: 9px;
  }
  .brand__text span {
    font-size: 7px;
  }

  .today {
    top: calc(env(safe-area-inset-top) + 10px);
    right: 10px;
    padding: 5px 8px;
    border-radius: 8px;
    box-shadow: 2px 2px 0 var(--ink);
  }
  .today__time {
    font-size: 12px;
  }
  .today__date {
    font-size: 7px;
  }
  .today__days {
    font-size: 6.5px;
    border-width: 1px;
  }

  .decor-eyes {
    top: 58px;
    left: 50%;
    right: auto;
    width: 220px;
    opacity: 0.85;
    transform: translateX(-50%) rotate(-1.5deg);
  }
  .desk-note {
    display: none;
  }

  .desktop__windows {
    pointer-events: none;
  }

  .window {
    position: fixed;
    top: 64px !important;
    right: 10px;
    bottom: calc(var(--dock-space, 84px) + env(safe-area-inset-bottom));
    left: 10px !important;
    display: none;
    width: auto !important;
    max-height: none;
    border-width: 2px;
    border-radius: 11px;
    box-shadow: 5px 5px 0 var(--ink);
  }

  .window.is-open {
    display: flex;
  }

  .window.is-open:not(.is-mobile-active) {
    display: none;
  }

  .window.is-dragging {
    box-shadow: 5px 5px 0 var(--ink);
  }

  .window__bar {
    min-height: 41px;
    padding: 6px 7px 6px 11px;
    touch-action: auto;
    cursor: default;
  }

  .window__title {
    font-size: 13.5px;
  }

  .window__title span {
    display: none;
  }

  .window__close {
    width: 27px;
    height: 27px;
  }

  .window__edit {
    width: 27px;
    min-width: 27px;
    height: 27px;
    padding: 0;
  }

  .window__edit span {
    display: none;
  }

  .window__body {
    padding: 16px 15px 20px;
  }

  .home {
    gap: 12px;
  }

  .home__title {
    font-size: clamp(31px, 8.5vw, 40px);
  }

  .home__subtitle {
    font-size: 12.5px;
  }

  .home__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    box-shadow: 3px 3px 0 var(--ink);
  }

  .home__stat {
    padding: 7px 10px;
  }

  .home__stat:nth-child(2) {
    border-right: 0;
  }

  .home__stat:nth-child(-n + 2) {
    border-bottom: 2px solid var(--ink);
  }

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

  .note-card {
    transform: none;
  }

  .home__actions {
    gap: 9px;
  }

  .story__head h3 {
    font-size: 21px;
  }

  .timeline {
    padding-left: 17px;
    margin-left: 3px;
  }

  .timeline__item::before {
    left: -26px;
    width: 9px;
    height: 9px;
  }

  .timeline__end::before {
    left: -26px;
  }

  .gallery__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .photo-card__meta {
    padding: 5px 6px;
  }

  .photo-card__title {
    font-size: 10px;
  }

  .photo-card__date {
    font-size: 7px;
  }

  .lightbox {
    padding: 10px;
  }

  .lightbox__stage {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: 10px;
  }

  .lightbox__nav {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .lightbox__frame img {
    max-height: 45vh;
    max-height: 45dvh;
  }

  .lightbox__foot {
    padding: 10px 12px;
  }

  .lightbox__copy h3 {
    font-size: 17px;
  }

  .places__head h3 {
    font-size: 21px;
  }

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

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

  .diary__toolbar h3 {
    font-size: 20px;
  }

  .diary {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .diary__list {
    flex-direction: row;
    gap: 6px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px;
    border-right: 0;
    border-bottom: 2px solid var(--ink);
  }

  .diary__item {
    width: auto;
    min-width: 0;
    flex: 0 0 150px;
  }

  .diary__detail {
    max-height: none;
    padding: 13px 14px 15px;
  }

  .diary__title {
    font-size: 20px;
  }

  .diary__body {
    font-size: 12.5px;
  }

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

  .notes-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inline-form--links {
    grid-template-columns: 1fr;
  }

  .palette {
    padding: 7vh 10px 10px;
  }

  .palette__panel {
    width: 100%;
  }

  .palette__results {
    max-height: 54vh;
  }

  .palette__foot {
    gap: 8px;
  }

  .dock {
    right: 8px;
    bottom: calc(9px + env(safe-area-inset-bottom));
    left: 8px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    overflow: visible;
    max-width: none;
    padding: 7px;
    border-radius: 13px;
    box-shadow: 5px 5px 0 var(--ink);
    transform: none;
  }

  .dock__extras {
    display: contents;
  }

  .dock__extras:empty {
    display: none;
  }

  .dock__actions {
    flex: 0 0 100%;
    order: 1;
    justify-content: center;
    gap: 6px;
  }

  .dock__item {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }

  .tag-row__type {
    display: none;
  }

  .dock__item svg {
    width: 20px;
    height: 20px;
  }

  .dock__item::after {
    display: none;
  }

  .dock__divider {
    height: 25px;
    margin: 0 1px;
  }

  .dock__actions {
    gap: 6px;
  }

  .toast {
    bottom: calc(var(--dock-space, 86px) + 8px + env(safe-area-inset-bottom));
  }
}

@media (hover: none) {
  .check-item .icon-btn,
  .sticky-note .icon-btn {
    opacity: 1;
  }
}

@media (max-width: 520px) {
  .window {
    top: 60px !important;
    bottom: calc(var(--dock-space, 78px) + env(safe-area-inset-bottom));
  }
  .dock {
    gap: 5px;
    padding: 6px;
  }
  .dock__item {
    width: 39px;
    height: 39px;
  }
  .dock__divider {
    height: 23px;
  }
  .home__stat-value {
    font-size: 18px;
  }
  .home__foot {
    font-size: 7.5px;
  }
  .gallery__filters {
    gap: 5px;
  }
  .filter {
    padding: 3px 7px;
    font-size: 9.5px;
  }
  .gallery__toolbar {
    margin-bottom: 10px;
  }
  .notes-grid {
    grid-template-columns: 1fr;
  }
  .lightbox__nav {
    width: 27px;
    height: 27px;
  }
  .lightbox__frame img {
    max-height: 38vh;
    max-height: 38dvh;
  }
  .stamp-card__seal {
    width: 44px;
    height: 44px;
  }
  .type-grid {
    grid-template-columns: 1fr;
  }
  .diary__item {
    flex-basis: 138px;
  }
}

@media (max-height: 720px) and (min-width: 861px) {
  .window {
    max-height: calc(100vh - 150px);
    max-height: calc(100dvh - 150px);
  }
  .dock {
    bottom: 13px;
  }
  .brand,
  .today {
    top: 12px;
  }
}

@media (max-height: 560px) {
  .window {
    top: 54px !important;
    bottom: calc(var(--dock-space, 84px) + env(safe-area-inset-bottom));
  }
  .brand,
  .today {
    display: none;
  }
  .decor-eyes {
    display: none;
  }
}
