:root {
  --paper: #f4efe1;
  --paper-deep: #e3d8bd;
  --paper-light: #fffdf6;
  --ink: #243127;
  --ink-soft: #667066;
  --line: rgba(54, 63, 50, 0.2);
  --moss: #4d6a55;
  --moss-deep: #294638;
  --gold: #c8974b;
  --red: #9b4c43;
  --blue: #6f8e98;
  --lavender: #827996;
  --shadow: 0 16px 42px rgba(30, 38, 28, 0.16);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  letter-spacing: 0;
  overflow-x: hidden;
}

button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(200, 151, 75, 0.58);
  outline-offset: 2px;
}

svg { display: block; flex: 0 0 auto; }

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--moss-deep);
  background: var(--paper);
}

.boot-screen p { margin: 0; font-family: var(--serif); font-size: 18px; }
.boot-mark, .title-seal, .dialog-seal {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff8e6;
  background: var(--red);
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 0 0 4px var(--red);
  font-family: var(--serif);
  font-size: 27px;
}

.map-page {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #839899;
}

.scene-filter {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(91, 112, 103, 0.14);
  box-shadow: inset 0 -190px 160px rgba(31, 46, 36, .46), inset 0 130px 120px rgba(255, 235, 187, .22);
  backdrop-filter: saturate(.78) sepia(.12) contrast(.94);
}

.paper-grain {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 8;
  opacity: .12;
  mix-blend-mode: multiply;
  background-image:
    repeating-linear-gradient(17deg, transparent 0 3px, rgba(48, 55, 43, .08) 4px 5px),
    repeating-linear-gradient(91deg, transparent 0 8px, rgba(255, 255, 255, .2) 9px 10px);
}

.map-titlebar {
  position: relative;
  z-index: 10;
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(20px, 4vw, 62px);
  color: #fff9eb;
  text-shadow: 0 2px 18px rgba(17, 27, 20, .72);
}

.map-title { display: flex; align-items: center; gap: 18px; min-width: 0; }
.map-title .title-seal { width: 48px; height: 48px; font-size: 24px; flex: 0 0 auto; text-shadow: none; }
.map-title small, .room-heading small, .index-heading small, .scenic-empty small, .helper-card small, .project-card small, .resource-card small {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.map-title h1 { margin: 3px 0 0; font-family: var(--serif); font-size: clamp(30px, 4vw, 52px); line-height: .95; letter-spacing: 0; }

.map-summary { display: flex; align-items: center; gap: 18px; font-size: 12px; }
.map-summary span { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.map-summary strong { font-family: var(--serif); font-size: 22px; }
.map-menu { position: relative; pointer-events: auto; }
.map-menu summary {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 50%;
  color: #fff;
  background: rgba(31, 46, 36, .36);
  cursor: pointer;
  list-style: none;
}
.map-menu summary::-webkit-details-marker { display: none; }
.map-menu summary:hover,
.map-menu summary:focus-visible,
.map-menu[open] summary { background: rgba(247, 237, 207, .24); }
.map-menu summary:focus-visible { outline: 2px solid #f4d991; outline-offset: 2px; }
.map-menu-panel {
  position: absolute;
  top: 44px;
  right: 0;
  width: 230px;
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid rgba(255, 247, 217, .32);
  border-radius: 5px;
  color: #fff9e7;
  background: rgba(22, 45, 36, .96);
  box-shadow: 0 18px 38px rgba(15, 28, 22, .32);
  backdrop-filter: blur(12px);
}
.map-menu-panel button {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 11px;
  border: 0;
  border-radius: 3px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.map-menu-panel button:hover,
.map-menu-panel button:focus-visible { background: rgba(255, 248, 220, .12); outline: none; }
.map-menu-panel button em {
  min-width: 24px;
  padding: 3px 6px;
  border-radius: 12px;
  color: #2c4538;
  background: #f0d997;
  font-style: normal;
  font-size: 10px;
  text-align: center;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 253, 246, .82);
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, color .18s ease;
}
.icon-button:hover { transform: translateY(-2px); background: var(--paper-light); }
.map-refresh { color: #fff; background: rgba(31, 46, 36, .36); border-color: rgba(255,255,255,.38); }

.map-canvas { position: relative; min-height: calc(100dvh - 108px); }
.map-locations { position: absolute; inset: 0; z-index: 5; }

.map-location {
  position: absolute;
  min-width: 168px;
  min-height: 64px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(58, 52, 38, .45);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(247, 237, 207, .91);
  box-shadow: 0 7px 0 rgba(61, 51, 35, .42), 0 15px 26px rgba(28, 36, 27, .22);
  cursor: pointer;
  text-align: left;
  transform: rotate(var(--tilt, 0deg));
  transition: transform .22s ease, box-shadow .22s ease;
}
.map-location::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(75, 72, 54, .18);
  pointer-events: none;
}
.map-location:hover, .map-location:focus-visible { transform: translateY(-5px) rotate(var(--tilt, 0deg)); box-shadow: 0 10px 0 rgba(61, 51, 35, .45), 0 23px 32px rgba(28,36,27,.26); }
.location-icon { width: 36px; height: 36px; display: grid; place-items: center; color: #f8edcf; background: var(--moss-deep); border-radius: 50%; }
.location-copy { min-width: 0; display: grid; }
.location-copy strong { font-family: var(--serif); font-size: 18px; white-space: nowrap; }
.location-copy small { color: var(--ink-soft); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.map-location em { min-width: 24px; padding: 4px 6px; border-radius: 12px; color: #fff; background: var(--red); font-style: normal; font-size: 11px; text-align: center; }

.location-notebook { left: 48%; top: 34%; --tilt: -1deg; }
.location-projects { left: 8%; top: 55%; --tilt: 1.5deg; }
.location-collections { right: 14%; top: 50%; --tilt: -1.2deg; }
.location-helpers { right: 18%; top: 9%; --tilt: 1deg; }
.location-inbox { left: 32%; top: 68%; --tilt: .8deg; }

.quick-capture {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: 24px;
  width: min(660px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 52px auto minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 10px;
  border: 1px solid rgba(38, 52, 41, .4);
  border-radius: 6px;
  background: rgba(255, 251, 239, .94);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
.quick-capture label { font-family: var(--serif); font-size: 17px; white-space: nowrap; }
.quick-capture input { min-width: 0; height: 38px; border: 0; border-left: 1px solid var(--line); padding: 0 12px; background: transparent; color: var(--ink); outline: 0; }
.quick-capture input::placeholder { color: #8d9188; }
.quick-spirit { position: relative; width: 48px; height: 42px; border-radius: 45% 50% 42% 48%; background: #e5d2a6; box-shadow: inset -5px -6px 0 rgba(88, 104, 83, .16); }
.quick-spirit::before, .quick-spirit::after { content: ""; position: absolute; top: 15px; width: 4px; height: 5px; border-radius: 50%; background: var(--ink); }
.quick-spirit::before { left: 15px; }.quick-spirit::after { right: 15px; }
.quick-spirit i { position: absolute; left: 9px; top: -8px; width: 10px; height: 16px; border-radius: 80% 20%; background: var(--moss); transform: rotate(-26deg); }
.quick-spirit b { position: absolute; right: 8px; bottom: 8px; width: 9px; height: 3px; border-radius: 50%; background: var(--red); }

.firefly { position: absolute; z-index: 3; left: var(--left); top: var(--top); width: 4px; height: 4px; border-radius: 50%; background: #fff4a8; box-shadow: 0 0 9px 3px rgba(255, 236, 130, .65); animation: drift-firefly 5s ease-in-out var(--delay) infinite; }
@keyframes drift-firefly { 0%,100% { transform: translate(0,0); opacity: .28; } 35% { transform: translate(16px,-20px); opacity: 1; } 70% { transform: translate(-10px,-8px); opacity: .55; } }

.mist { position: absolute; z-index: 2; left: -10%; width: 120%; height: 80px; background: rgba(238, 242, 226, .16); filter: blur(14px); animation: mist-move 16s linear infinite; }
.mist-one { top: 28%; }.mist-two { top: 62%; animation-duration: 21s; animation-direction: reverse; }
@keyframes mist-move { from { transform: translateX(-5%); } to { transform: translateX(7%); } }

.room-page { position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate; background: var(--paper); }
.room-backdrop { position: absolute; inset: 0; z-index: -2; background: center / cover fixed no-repeat; filter: saturate(.68) sepia(.16) contrast(.92); opacity: .3; }
.room-page::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(244, 239, 225, .72); }
.room-header {
  position: relative;
  z-index: 12;
  min-height: 88px;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
  align-items: center;
  gap: 18px;
  padding: 13px clamp(16px, 3vw, 42px);
  color: #f9efd5;
  background: #4e3928;
  border-bottom: 6px solid #7a5a39;
  box-shadow: 0 8px 24px rgba(40, 34, 24, .22);
}
.room-header::before { content: ""; position: absolute; inset: 6px 14px; border: 1px solid rgba(243, 215, 154, .22); pointer-events: none; }
.room-heading { display: flex; align-items: center; gap: 12px; grid-column: 2; }
.room-heading > span { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #d2ad69; border-radius: 50%; color: #3d3325; background: #eed9a6; }
.room-heading small { color: #d9bc85; }
.room-heading h1 { margin: 1px 0 0; font-family: var(--serif); font-size: 28px; white-space: nowrap; }
.room-actions { grid-column: 3; display: flex; justify-content: flex-end; gap: 8px; min-width: 0; }
.room-actions .icon-button { flex: 0 0 auto; color: var(--ink); }
.room-actions .new-note-button { border-color: #e4c681; color: #2c3e31; background: #eddaa7; }

.back-button, .primary-button, .secondary-button, .text-button, .danger-button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 700;
}
.back-button { justify-self: start; z-index: 1; border: 1px solid rgba(246, 229, 194, .4); color: #f8e9c7; background: rgba(22, 24, 18, .15); }
.primary-button { border: 1px solid #e4c681; color: #2c3e31; background: #eddaa7; }
.secondary-button { border: 1px solid rgba(255,255,255,.26); color: inherit; background: rgba(255,255,255,.08); }
.text-button { border: 1px solid var(--line); background: transparent; }
.danger-button { border: 1px solid #873c35; color: #fff; background: var(--red); }

.notebook-workspace {
  position: relative;
  z-index: 9;
  height: calc(100dvh - 88px);
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(230px, 300px) minmax(500px, 1fr);
  background: rgba(250, 247, 238, .86);
  backdrop-filter: blur(8px);
}
.notebook-sidebar, .note-index, .editor-shell { min-width: 0; min-height: 0; overflow: hidden; }
.notebook-sidebar { padding: 18px 14px; border-right: 1px solid var(--line); overflow-y: auto; background: rgba(230, 221, 197, .5); }
.note-index { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: rgba(250, 247, 238, .72); }
.editor-shell { background: rgba(255, 253, 247, .9); }

.search-field, .header-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: rgba(255,255,255,.6); }
.search-field { height: 40px; padding: 0 10px; }
.search-field input, .header-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: inherit; background: transparent; }
.header-search { width: min(260px, 100%); height: 38px; padding: 0 10px; color: var(--ink); background: #f7edcf; }

.filter-stack { display: grid; gap: 4px; margin-top: 14px; }
.filter-button { min-height: 38px; display: grid; grid-template-columns: 20px minmax(0,1fr) auto; align-items: center; gap: 7px; padding: 7px 9px; border: 0; border-radius: 5px; color: var(--ink-soft); background: transparent; cursor: pointer; text-align: left; }
.filter-button:hover { color: var(--ink); background: rgba(255,255,255,.46); }
.filter-button.active { color: #fff; background: var(--moss-deep); }
.filter-button em { min-width: 22px; font-style: normal; font-size: 10px; text-align: right; }
.sidebar-caption { margin: 20px 8px 6px; color: #808378; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.domain-stack { margin-top: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--line); border-radius: 14px; padding: 5px 8px; color: var(--ink-soft); background: rgba(255,255,255,.4); cursor: pointer; font-size: 10px; }
.tag-chip.active { color: #fff; background: var(--red); border-color: var(--red); }

.index-heading { min-height: 67px; display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.index-heading > div { display: grid; gap: 2px; }
.index-heading small { color: var(--red); }
.index-heading strong { font-family: var(--serif); font-size: 18px; }
.note-list { min-height: 0; overflow-y: auto; }
.note-row { width: 100%; min-height: 128px; display: grid; align-content: start; gap: 6px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; }
.note-row:hover { background: rgba(255,255,255,.58); }
.note-row.active { box-shadow: inset 4px 0 var(--red); background: var(--paper-light); }
.note-row-top, .note-row-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); }
.note-row-top small { display: flex; align-items: center; gap: 4px; font-size: 10px; }
.note-row-top > svg { color: var(--gold); fill: var(--gold); }
.note-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 17px; }
.note-row p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-row-meta { align-self: end; font-size: 9px; }
.note-row-meta em { overflow: hidden; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.note-empty { min-height: 300px; display: grid; place-content: center; justify-items: center; gap: 7px; padding: 28px; color: var(--ink-soft); text-align: center; }
.note-empty strong { color: var(--ink); font-family: var(--serif); font-size: 20px; }.note-empty p { margin: 0; font-size: 11px; }
.empty-spirit { position: relative; width: 58px; height: 46px; border: 1px solid #9ca48e; border-radius: 55% 45% 50% 45%; background: #d9dfc8; }
.empty-spirit::before, .empty-spirit::after { content: ""; position: absolute; top: 18px; width: 4px; height: 5px; border-radius: 50%; background: var(--ink); }.empty-spirit::before { left: 18px; }.empty-spirit::after { right: 18px; }
.empty-spirit i { position: absolute; left: 6px; bottom: -9px; width: 46px; height: 16px; border-radius: 50%; border-bottom: 2px solid #8e987f; }

.editor-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; text-align: center; }
.editor-empty small { color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .14em; }.editor-empty h2 { margin: 0; font-family: var(--serif); font-size: 24px; }
.ink-creature { position: relative; width: 72px; height: 64px; margin-bottom: 12px; border-radius: 46% 54% 42% 58%; background: var(--moss-deep); box-shadow: inset -9px -8px 0 rgba(255,255,255,.08); }
.ink-creature::before, .ink-creature::after { content: ""; position: absolute; top: 25px; width: 6px; height: 7px; border-radius: 50%; background: #f7e7b3; }.ink-creature::before { left: 22px; }.ink-creature::after { right: 22px; }
.ink-creature i { position: absolute; left: 8px; top: -18px; width: 14px; height: 28px; border-radius: 70% 20%; background: var(--moss); transform: rotate(-30deg); }.ink-creature b { position: absolute; right: 5px; bottom: 3px; width: 23px; height: 16px; border: 3px solid #f7e7b3; border-top: 0; border-left: 0; border-radius: 50%; }

.editor-head { min-height: 58px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.editor-mode { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.editor-mode button { min-width: 55px; border: 0; border-radius: 3px; padding: 6px 8px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 11px; }
.editor-mode button.active { color: #fff; background: var(--moss-deep); }
.save-status { justify-self: center; color: var(--ink-soft); font-size: 10px; }.save-status.saving { color: var(--red); }
.editor-actions { display: flex; gap: 5px; }.editor-actions .icon-button { width: 32px; height: 32px; }
.is-favorite { color: var(--gold); }.is-favorite svg { fill: var(--gold); }.danger-icon { color: var(--red); }

.editor-meta { padding: 14px 18px 10px; }
.title-input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 10px; color: var(--ink); background: transparent; outline: 0; font-family: var(--serif); font-size: 29px; font-weight: 700; }
.title-input:disabled { color: var(--ink); opacity: 1; }
.meta-row { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 12px; margin-top: 10px; }
.meta-row label { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 8px; color: var(--ink-soft); font-size: 10px; }
.meta-row input, .meta-row select { width: 100%; min-width: 0; height: 32px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; color: var(--ink); background: rgba(255,255,255,.62); }

.format-toolbar { min-height: 39px; display: flex; align-items: center; gap: 4px; padding: 4px 18px; border-block: 1px solid var(--line); background: rgba(232, 224, 203, .3); }
.format-toolbar.hidden { visibility: hidden; }
.format-toolbar button { width: 30px; height: 29px; display: grid; place-items: center; border: 0; border-radius: 3px; background: transparent; cursor: pointer; }
.format-toolbar button:hover { background: var(--paper-deep); }.format-toolbar > span { flex: 1; }
.editor-body { height: calc(100% - 58px - 121px - 39px); min-height: 260px; }
.editor-body textarea, .markdown-preview { width: 100%; height: 100%; min-height: 0; overflow-y: auto; }
.editor-body textarea { resize: none; border: 0; padding: 20px clamp(18px, 4vw, 52px) 60px; color: #283229; background: transparent; outline: 0; font-family: "Cascadia Code", "Microsoft YaHei UI", monospace; font-size: 14px; line-height: 1.8; }
.markdown-preview { padding: 20px clamp(18px, 4vw, 52px) 60px; color: #2d352e; font-family: var(--serif); font-size: 16px; line-height: 1.8; }
.markdown-preview > :first-child { margin-top: 0; }.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { color: var(--moss-deep); line-height: 1.3; }.markdown-preview h1 { font-size: 30px; }.markdown-preview h2 { font-size: 24px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }.markdown-preview img { max-width: 100%; height: auto; border: 8px solid #fff; box-shadow: 0 6px 20px rgba(31,40,31,.15); }.markdown-preview blockquote { margin-inline: 0; border-left: 4px solid var(--gold); padding: 4px 16px; color: var(--ink-soft); background: rgba(226,216,186,.26); }.markdown-preview code { font-family: "Cascadia Code", monospace; font-size: .88em; background: #e8e3d5; padding: 2px 4px; }.markdown-preview pre { overflow-x: auto; padding: 14px; color: #f5efdf; background: #29362e; }.markdown-preview pre code { background: transparent; }

.destination-panel { position: relative; z-index: 9; width: min(1180px, calc(100% - 40px)); min-height: calc(100dvh - 130px); margin: 22px auto; padding: 20px 0 60px; }
.project-grid, .helper-grid { display: grid; gap: 12px; }
.project-card, .helper-card { display: grid; align-items: center; gap: 18px; border: 1px solid rgba(66,57,40,.28); border-radius: 7px; background: rgba(255,251,235,.88); box-shadow: 0 8px 24px rgba(46,42,30,.1); }
.project-card { grid-template-columns: 60px minmax(0,1fr) 46px; padding: 18px; }.project-card > span { font-family: var(--serif); font-size: 34px; color: var(--red); }.project-card h2, .helper-card h2 { margin: 3px 0 4px; font-family: var(--serif); }.project-card p, .helper-card p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.project-tech { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }.project-tech em { border-radius: 12px; padding: 4px 8px; color: #fff; background: var(--moss); font-style: normal; font-size: 9px; }
.resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.resource-card { position: relative; min-height: 150px; display: grid; align-content: end; gap: 6px; padding: 18px; border: 1px solid rgba(64,55,40,.25); border-radius: 7px; color: var(--ink); background: rgba(255,251,235,.9); text-decoration: none; box-shadow: 0 8px 24px rgba(46,42,30,.09); }.resource-card small { color: var(--red); }.resource-card strong { font-family: var(--serif); font-size: 20px; }.resource-card span { overflow: hidden; color: var(--ink-soft); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.resource-card > svg { position: absolute; right: 16px; top: 16px; }
.helper-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }.helper-card { grid-template-columns: 60px minmax(0,1fr) auto; padding: 16px; }.helper-glyph { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50% 44% 52% 46%; color: #f7e6bb; background: var(--moss-deep); font-family: var(--serif); font-size: 24px; }
.helper-card .secondary-button { color: #fff; background: var(--moss-deep); }

.scenic-empty { min-height: calc(100dvh - 190px); display: grid; grid-template-columns: 64px minmax(0, 520px) 86px; place-content: center; align-items: center; gap: 20px; padding: 28px; border: 1px solid rgba(73,63,46,.28); border-radius: 7px; background: rgba(255,250,232,.86); box-shadow: var(--shadow); }
.scenic-empty > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: #f6e6bd; background: var(--moss-deep); }.scenic-empty small { color: var(--red); }.scenic-empty h2 { margin: 3px 0 5px; font-family: var(--serif); font-size: 27px; }.scenic-empty p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.paper-spirit { position: relative; width: 78px; height: 58px; border: 2px solid #b7a879; border-radius: 48% 52% 44% 56%; background: #eee2b7; animation: spirit-float 3s ease-in-out infinite; }.paper-spirit::before, .paper-spirit::after { content: ""; position: absolute; top: 22px; width: 5px; height: 6px; border-radius: 50%; background: var(--ink); }.paper-spirit::before { left: 24px; }.paper-spirit::after { right: 24px; }
@keyframes spirit-float { 50% { transform: translateY(-8px) rotate(2deg); } }

.transition-veil {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: #111813;
  transition: opacity .28s ease, visibility .28s step-end;
}
.transition-veil.active { visibility: visible; opacity: 1; transition: opacity .28s ease; }
.ritual-destination { position: absolute; inset: -3%; background: var(--ritual-scene, none) center / cover no-repeat; opacity: 0; transform: scale(1.12); filter: saturate(.72) brightness(.75); transition: opacity .75s ease, transform 1.25s cubic-bezier(.2,.7,.15,1); }
.ritual-shade { position: absolute; inset: 0; background: radial-gradient(circle at 48% 40%, rgba(233,221,184,.12), rgba(9,15,11,.9) 70%); transition: opacity .7s ease; }
.ritual-stage { position: absolute; inset: 0; }
.ritual-portrait { position: absolute; left: calc(50% - 250px); top: 50%; width: 250px; height: 430px; overflow: hidden; opacity: 0; transform: translate(-50%, -42%) scale(.96); filter: drop-shadow(0 18px 34px rgba(0,0,0,.48)); transition: opacity .38s ease, transform .55s cubic-bezier(.2,.8,.2,1); }
.ritual-portrait img { width: 100%; height: auto; display: block; }
.name-ritual .ritual-portrait { opacity: 1; transform: translate(-50%, -46%) scale(1); }
.ritual-breath { position: absolute; left: 57%; top: 14%; width: 180px; height: 110px; transform: rotate(-7deg); }
.ritual-breath i { position: absolute; left: 0; top: 48%; width: 0; height: 1px; border-top: 2px solid rgba(241,236,211,.7); border-radius: 50%; opacity: 0; }
.release .ritual-breath i { animation: name-wind .68s ease-out forwards; }
.release .ritual-breath i:nth-child(2) { top: 34%; animation-delay: .08s; }
.release .ritual-breath i:nth-child(3) { top: 62%; animation-delay: .15s; }
@keyframes name-wind { 0% { width: 0; opacity: 0; transform: translateX(0) scaleY(.4); } 22% { opacity: .9; } 100% { width: 190px; opacity: 0; transform: translateX(65px) scaleY(2.5); } }
.name-page { position: absolute; left: calc(50% - 62px); top: 50%; width: 178px; height: 244px; display: grid; align-content: center; justify-items: center; gap: 16px; padding: 22px; color: #29251e; background: #f1e8ce; border: 1px solid rgba(77,62,41,.48); box-shadow: 0 18px 60px rgba(0,0,0,.42), inset 0 0 35px rgba(121,94,48,.12); opacity: 0; transform: translate(-38%, -46%) rotate(2deg) scale(.86); clip-path: polygon(2% 0, 97% 1%, 100% 12%, 98% 25%, 100% 39%, 97% 54%, 100% 70%, 98% 86%, 100% 100%, 3% 99%, 0 89%, 2% 72%, 0 58%, 2% 42%, 0 27%, 2% 13%); transition: opacity .28s .23s ease, transform .52s .18s cubic-bezier(.2,.8,.2,1); }
.name-ritual .name-page { opacity: 1; transform: translate(-38%, -46%) rotate(-2deg) scale(1); }
.name-page::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(98,69,35,.22); }
.name-page > span { font-family: var(--serif); font-size: 10px; color: #7e3f37; }
.name-page > strong { position: relative; font-family: var(--serif); font-size: 44px; font-weight: 500; writing-mode: vertical-rl; }
.name-page > i { position: absolute; width: 22px; height: 22px; border: 2px solid rgba(121,63,54,.45); border-radius: 50%; }
.name-page > i:nth-of-type(1) { left: 14px; top: 18px; }
.name-page > i:nth-of-type(2) { right: 17px; bottom: 23px; width: 14px; height: 14px; }
.name-page > i:nth-of-type(3) { left: 18px; bottom: 18px; border-color: rgba(54,76,56,.35); }
.release .name-page { animation: return-name 1s cubic-bezier(.25,.7,.25,1) forwards; }
@keyframes return-name { 0% { opacity: 1; transform: translate(-38%,-46%) rotate(-2deg) scale(1); } 24% { opacity: 1; transform: translate(-22%,-50%) rotate(5deg) scale(1.04); } 100% { opacity: 0; transform: translate(125vw,-82vh) rotate(48deg) scale(.24); } }
.ritual-arrival { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; color: #fff8e8; text-align: center; opacity: 0; transform: scale(.94); transition: opacity .55s .24s ease, transform .8s .18s ease; }
.ritual-arrival img { width: min(46vw, 430px); height: min(58vh, 520px); object-fit: contain; filter: drop-shadow(0 20px 38px rgba(0,0,0,.55)); }
.ritual-arrival small { margin-top: -12px; font-size: 10px; text-shadow: 0 2px 12px #000; }
.ritual-arrival strong { margin-top: 5px; font-family: var(--serif); font-size: clamp(24px, 4vw, 52px); font-weight: 500; text-shadow: 0 3px 18px #000; }
.release .ritual-destination { opacity: 1; transform: scale(1.02); }
.release .ritual-shade { opacity: .45; }
.release .ritual-portrait { opacity: 0; transform: translate(-56%, -48%) scale(.96); }
.release .ritual-arrival { opacity: 1; transform: scale(1); }
.transition-veil.depart { opacity: 0; }
.return-wash { position: absolute; inset: 0; display: none; }
.quiet-return .return-wash { display: block; }
.return-wash i { position: absolute; left: -10%; width: 120%; height: 30%; border-radius: 50%; background: rgba(236,231,209,.98); transform: translateX(-110%); animation: quiet-wash .4s cubic-bezier(.65,0,.35,1) forwards; }
.return-wash i:nth-child(1) { top: -9%; }.return-wash i:nth-child(2) { top: 22%; animation-delay: .04s; }.return-wash i:nth-child(3) { top: 52%; animation-delay: .08s; }.return-wash i:nth-child(4) { top: 80%; animation-delay: .12s; }
@keyframes quiet-wash { to { transform: translateX(0); } }

.toast { position: fixed; z-index: 120; left: 50%; bottom: 24px; max-width: min(440px, calc(100% - 32px)); padding: 11px 16px; border: 1px solid rgba(255,255,255,.24); border-radius: 5px; color: #fff8e7; background: var(--moss-deep); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 14px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; font-size: 12px; text-align: center; }.toast.show { opacity: 1; transform: translate(-50%,0); }.toast[data-tone="error"] { background: var(--red); }

.confirm-dialog { width: min(470px, calc(100% - 28px)); border: 1px solid #695c40; border-radius: 7px; padding: 0; color: var(--ink); background: var(--paper-light); box-shadow: 0 28px 80px rgba(23,27,20,.38); }.confirm-dialog::backdrop { background: rgba(25,32,26,.62); backdrop-filter: blur(3px); }.confirm-dialog form { padding: 22px; }.confirm-dialog header { display: flex; align-items: center; gap: 15px; }.dialog-seal { width: 42px; height: 42px; font-size: 19px; }.confirm-dialog small { color: var(--red); font-size: 9px; font-weight: 800; letter-spacing: .13em; }.confirm-dialog h2 { margin: 2px 0 0; font-family: var(--serif); }.confirm-dialog p { margin: 20px 0 12px; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }.confirm-dialog label { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 700; }.confirm-dialog input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; background: #fff; }.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.fatal-state { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; text-align: center; }.fatal-state span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--red); font-size: 23px; }.fatal-state h1 { margin: 8px 0 0; font-family: var(--serif); }.fatal-state p { color: var(--ink-soft); }.fatal-state button { border: 1px solid var(--line); border-radius: 5px; padding: 8px 14px; background: var(--paper-light); cursor: pointer; }

@media (max-width: 1100px) {
  .notebook-workspace { grid-template-columns: minmax(220px, 280px) minmax(0,1fr); }
  .notebook-sidebar { display: none; }
  .note-index { grid-column: 1; }
  .editor-shell { grid-column: 2; }
  .resource-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 800px) {
  .map-page { overflow: auto; background-position: 38% center; }
  .map-titlebar { min-height: 126px; align-items: flex-start; padding: 18px 16px; }
  .map-title h1 { font-size: 32px; }
  .map-summary { display: none; }
  .map-canvas { min-height: 770px; }
  .map-locations { position: relative; min-height: 620px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-content: center; gap: 16px; padding: 40px 16px 150px; }
  .map-location { position: relative; inset: auto; min-width: 0; width: 100%; min-height: 76px; transform: none; }
  .map-location:hover, .map-location:focus-visible { transform: translateY(-3px); }
  .location-notebook { grid-column: 1 / -1; }
  .quick-capture { position: fixed; bottom: 12px; grid-template-columns: 42px minmax(0,1fr) 38px; width: calc(100% - 24px); padding: 8px; }
  .quick-capture label { display: none; }.quick-capture input { border-left: 0; }.quick-spirit { width: 40px; height: 38px; }

  .room-page { overflow: auto; }
  .room-header { position: sticky; top: 0; grid-template-columns: auto minmax(0,1fr) auto; min-height: 76px; padding: 10px 12px; }
  .room-heading { grid-column: 2; width: 100%; min-width: 0; justify-self: center; justify-content: center; }.room-heading > div { min-width: 0; }.room-heading > span { display: none; }.room-heading h1 { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }.back-button span { display: none; }.back-button { width: 38px; padding: 8px; }.room-actions { grid-column: 3; }.room-actions .secondary-button span, .room-actions .primary-button span { display: none; }.room-actions .secondary-button, .room-actions .primary-button { width: 38px; padding: 8px; }
  .notebook-workspace { height: auto; min-height: calc(100dvh - 76px); display: block; }
  .note-index { height: 250px; border-right: 0; border-bottom: 1px solid var(--line); }
  .editor-shell { min-height: calc(100dvh - 326px); }
  .editor-empty { min-height: 420px; }
  .editor-head { grid-template-columns: auto 1fr auto; padding-inline: 10px; }.editor-actions { gap: 2px; }.editor-actions .icon-button { width: 30px; height: 30px; }
  .save-status { display: none; }
  .editor-meta { padding-inline: 14px; }.title-input { font-size: 24px; }.meta-row { grid-template-columns: 1fr; }
  .editor-body { height: 460px; }.format-toolbar { padding-inline: 12px; }
  .destination-panel { width: calc(100% - 24px); margin-top: 12px; }
  .resource-grid, .helper-grid { grid-template-columns: 1fr; }.header-search { width: 150px; }.scenic-empty { min-height: calc(100dvh - 130px); grid-template-columns: 48px minmax(0,1fr); padding: 20px; }.scenic-empty > span { width: 46px; height: 46px; }.paper-spirit { display: none; }
}

@media (max-width: 520px) {
  .map-title small { font-size: 8px; }.map-title .title-seal { width: 40px; height: 40px; }.map-locations { grid-template-columns: 1fr; padding-top: 22px; }.location-notebook { grid-column: auto; }.map-canvas { min-height: 850px; }
  .room-heading small { display: none; }.room-heading h1 { font-size: 18px; }
  .note-index { height: 220px; }.note-row { min-height: 110px; }.editor-shell { min-height: 600px; }.editor-mode button { min-width: 48px; }.editor-actions .icon-button:nth-child(2) { display: none; }
  .title-input { font-size: 21px; }.editor-body { height: 500px; }.editor-body textarea, .markdown-preview { padding-inline: 16px; }
  .project-card, .helper-card { grid-template-columns: 48px minmax(0,1fr); }.project-card > .icon-button, .helper-card > .secondary-button { grid-column: 2; justify-self: start; }.helper-glyph { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .transition-veil { display: none; }
}

/* Ayakashi residence redesign */
body * { letter-spacing: 0 !important; }

.ayakashi-map {
  min-height: 100dvh;
  background: #101611;
}
.ayakashi-map .paper-grain { z-index: 9; opacity: .08; mix-blend-mode: screen; }
.ayakashi-map .firefly { z-index: 8; }
.ayakashi-map .map-titlebar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  min-height: 112px;
  padding: 20px clamp(22px, 4vw, 58px);
  background: linear-gradient(to bottom, rgba(8,13,10,.82), rgba(8,13,10,.28), transparent);
}
.ayakashi-map .map-title { align-items: flex-start; }
.ayakashi-map .map-title h1 { font-size: clamp(30px, 3.7vw, 52px); font-weight: 500; line-height: 1; }
.ayakashi-map .map-title small { color: #d7cfb5; font-weight: 500; }
.ayakashi-map .title-seal { width: 46px; height: 46px; background: #9a4a40; box-shadow: 0 0 0 3px #9a4a40; }
.ayakashi-map .map-summary { align-self: flex-start; padding-top: 5px; }
.ayakashi-map .map-summary strong { color: #f0d695; }
.inbox-seal {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 50%;
  color: #fff8e8;
  background: rgba(22,28,23,.48);
  cursor: pointer;
}
.inbox-seal em { position: absolute; right: -4px; top: -4px; min-width: 17px; height: 17px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #a84f44; font-size: 9px; font-style: normal; }
.ayakashi-map .map-canvas { min-height: 100dvh; }
.yokai-portals {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.yokai-portal.map-location {
  position: relative;
  inset: auto;
  width: 100%;
  min-width: 0;
  height: 100dvh;
  min-height: 620px;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(239,231,205,.22);
  border-radius: 0;
  color: #fff9ea;
  background: #1d281f;
  box-shadow: none;
  text-align: left;
  transform: none;
  isolation: isolate;
}
.yokai-portal.map-location::before { display: none; }
.portal-scene { position: absolute; inset: 0; z-index: -3; background: var(--portal-scene) center / cover no-repeat; filter: saturate(.72) contrast(.94); transform: scale(1.035); transition: transform .9s cubic-bezier(.2,.8,.2,1), filter .6s ease; }
.portal-haze { position: absolute; inset: 0; z-index: -2; background: linear-gradient(to bottom, rgba(8,14,10,.18) 0 32%, rgba(10,16,12,.05) 48%, rgba(9,14,10,.92) 100%); transition: background .5s ease; }
.yokai-portal::after { content: ""; position: absolute; inset: 0; z-index: 4; opacity: 0; background: rgba(244,232,193,.16); mix-blend-mode: screen; transition: opacity .4s ease; }
.yokai-portal:hover, .yokai-portal:focus-visible { transform: none; box-shadow: inset 0 0 0 2px rgba(246,225,169,.6); }
.yokai-portal:hover .portal-scene, .yokai-portal:focus-visible .portal-scene { transform: scale(1.1); filter: saturate(1) contrast(1); }
.yokai-portal:hover::after, .yokai-portal:focus-visible::after { opacity: 1; }
.portal-character { position: absolute; z-index: 2; left: 50%; bottom: 7%; width: 74%; height: 68%; object-fit: contain; object-position: center bottom; transform: translateX(-50%); filter: drop-shadow(0 18px 24px rgba(0,0,0,.5)); transition: transform .65s cubic-bezier(.2,.8,.2,1), filter .5s ease; }
.yokai-portal:hover .portal-character, .yokai-portal:focus-visible .portal-character { transform: translateX(-50%) translateY(-10px) scale(1.045); filter: drop-shadow(0 24px 30px rgba(0,0,0,.62)); }
.yokai-nyanko .portal-character { width: 62%; height: 57%; bottom: 10%; }
.yokai-misuzu .portal-character { width: 111%; height: 72%; bottom: 7%; object-position: 18% bottom; }
.yokai-hinoe .portal-character { width: 58%; height: 68%; bottom: 7%; }
.yokai-fox .portal-character { width: 65%; height: 66%; bottom: 7%; }
.portal-number { position: absolute; z-index: 5; top: 128px; left: 22px; font-family: var(--serif); font-size: 12px; color: rgba(255,249,230,.7); }
.portal-copy { position: absolute; z-index: 5; left: 24px; right: 22px; bottom: 93px; display: grid; gap: 4px; text-shadow: 0 2px 15px rgba(0,0,0,.8); }
.portal-copy small { color: #e8d9b1; font-family: var(--serif); font-size: 12px; }
.portal-copy strong { font-family: var(--serif); font-size: clamp(28px, 3vw, 46px); font-weight: 500; line-height: 1; white-space: nowrap; }
.portal-copy > span { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11px; color: rgba(255,255,255,.8); }
.portal-copy > span i { display: inline-grid; }
.yokai-portal > em { position: absolute; z-index: 6; right: 18px; bottom: 96px; min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 7px; border: 1px solid rgba(255,255,255,.48); border-radius: 50%; color: #fff; background: rgba(21,28,22,.56); font-size: 10px; font-style: normal; }
.ayakashi-map .quick-capture {
  z-index: 25;
  bottom: 18px;
  width: min(610px, calc(100% - 36px));
  min-height: 54px;
  border-color: rgba(225,213,178,.5);
  background: rgba(242,235,213,.92);
  box-shadow: 0 14px 36px rgba(0,0,0,.32);
}

body[data-view="notebook"] .room-backdrop { background-image: url("assets/ayakashi/scene-home-3.jpg"); }
body[data-view="inbox"] .room-backdrop { background-image: url("assets/ayakashi/scene-home-4.jpg"); }
body[data-view="projects"] .room-backdrop { background-image: url("assets/ayakashi/scene-east-4.jpg"); }
body[data-view="collections"] .room-backdrop { background-image: url("assets/ayakashi/scene-east-2.jpg"); }
body[data-view="helpers"] .room-backdrop { background-image: url("assets/ayakashi/scene-fox-4.jpg"); }
.room-backdrop { position: fixed; opacity: 1; filter: saturate(.82) contrast(.96); }
.room-page::after { background: rgba(235,231,214,.1); }
.room-header { min-height: 82px; border-bottom: 1px solid rgba(235,218,179,.32); color: #fff6dd; background: rgba(25,30,24,.83); box-shadow: 0 8px 28px rgba(19,22,18,.3); backdrop-filter: blur(9px); }
.room-header::before { border-color: rgba(243,215,154,.16); }
.notebook-workspace { height: calc(100dvh - 82px); background: rgba(247,243,230,.3); backdrop-filter: blur(2px); }
.notebook-sidebar { background: rgba(225,218,198,.64); backdrop-filter: blur(9px); }
.note-index { background: rgba(250,247,238,.55); backdrop-filter: blur(7px); }
.editor-shell { background: rgba(255,253,247,.46); backdrop-filter: blur(5px); }
.destination-panel { min-height: calc(100dvh - 122px); }
.scenic-empty { background: rgba(255,250,232,.78); backdrop-filter: blur(12px); }
.project-card, .helper-card, .resource-card { background: rgba(255,251,235,.83); backdrop-filter: blur(10px); }

@media (max-width: 900px) {
  .ayakashi-map { overflow: auto; }
  .ayakashi-map .map-titlebar { position: fixed; min-height: 90px; padding: 14px 16px; }
  .ayakashi-map .map-title h1 { font-size: 28px; }
  .ayakashi-map .map-summary { display: flex; }
  .ayakashi-map .map-summary > span { display: none; }
  .yokai-portals { position: relative; min-height: 100dvh; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .yokai-portal.map-location { height: 50dvh; min-height: 360px; }
  .portal-number { top: 104px; }
  .portal-character { height: 66%; bottom: 5%; }
  .portal-copy { bottom: 74px; }
  .portal-copy strong { font-size: 30px; }
  .yokai-portal > em { bottom: 76px; }
  .ayakashi-map .quick-capture { position: fixed; }
  .ritual-portrait { left: calc(50% - 105px); width: 210px; height: 370px; }
  .name-page { left: 54%; width: 150px; height: 210px; }
}

@media (max-width: 520px) {
  .ayakashi-map .map-title .title-seal { width: 38px; height: 38px; }
  .ayakashi-map .map-title h1 { font-size: 22px; }
  .ayakashi-map .map-title small { font-size: 8px; }
  .ayakashi-map .map-summary { gap: 7px; }
  .ayakashi-map .map-refresh { width: 38px; height: 38px; }
  .yokai-portals { grid-template-columns: repeat(2, minmax(0,1fr)); padding: 0; }
  .yokai-portal.map-location { min-height: 390px; }
  .portal-number { top: 92px; left: 14px; }
  .portal-copy { left: 14px; right: 12px; bottom: 70px; }
  .portal-copy small { font-size: 9px; }
  .portal-copy strong { font-size: 25px; }
  .portal-copy > span { font-size: 9px; }
  .yokai-portal > em { right: 10px; bottom: 70px; min-width: 24px; height: 24px; }
  .yokai-nyanko .portal-character { width: 78%; height: 52%; }
  .yokai-misuzu .portal-character { width: 124%; height: 62%; }
  .yokai-hinoe .portal-character { width: 70%; height: 62%; }
  .yokai-fox .portal-character { width: 67%; height: 59%; }
  .ayakashi-map .quick-capture { grid-template-columns: 40px minmax(0,1fr) 36px; bottom: 8px; width: calc(100% - 16px); }
  .ayakashi-map .quick-capture label { display: none; }
  .ayakashi-map .quick-capture input { border-left: 0; padding-left: 4px; }
  .ritual-portrait { left: 31%; top: 46%; width: 180px; height: 330px; }
  .name-page { left: 50%; top: 46%; width: 128px; height: 184px; }
  .name-page > strong { font-size: 35px; }
  .ritual-arrival img { width: 72vw; height: 52vh; }
  .room-header { min-height: 76px; }
  .notebook-workspace { height: auto; }
}

/* Unified rural map cover */
.rural-map {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background: #8bb68e;
  isolation: isolate;
}
.rural-map .paper-grain { z-index: 18; opacity: .075; mix-blend-mode: multiply; }
.rural-map .map-titlebar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 24;
  min-height: 102px;
  padding: 18px clamp(20px, 3.5vw, 54px);
  color: #fffbea;
  background: linear-gradient(to bottom, rgba(22, 45, 39, .7), rgba(22, 45, 39, .2) 68%, transparent);
  pointer-events: none;
}
.rural-map .map-title h1 { font-size: clamp(27px, 3.3vw, 46px); font-weight: 500; }
.rural-map .map-title small { color: #e8dfbd; }
.rural-map .title-seal { width: 44px; height: 44px; background: #934b41; box-shadow: 0 0 0 3px #934b41; }
.rural-map .map-summary strong { color: #f4d991; }
.rural-map .map-titlebar button { pointer-events: auto; }
.rural-map .map-canvas {
  position: relative;
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
.map-world {
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100vw, 177.79dvh);
  aspect-ratio: 1672 / 941;
  overflow: hidden;
  transform: translate(-50%, -50%);
}
.rural-map-stage,
.map-character-layer,
.map-atmosphere-layer,
.map-label-layer {
  position: absolute;
  inset: 0;
}
.rural-map-stage { z-index: 0; overflow: hidden; }
.map-background-layer { background: #9fcb9a; }
.map-landmark-layer { z-index: 2; pointer-events: none; }
.rural-map-art,
.map-landmark-art {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: fill;
}
.rural-map-art { filter: saturate(1.015) contrast(1.01); }
.map-landmark-art {
  opacity: .18;
  filter: saturate(1.08) contrast(1.025) drop-shadow(0 5px 7px rgba(27, 58, 42, .08));
}
.map-character-layer { z-index: 4; pointer-events: none; }
.map-atmosphere-layer { z-index: 6; overflow: hidden; pointer-events: none; }
.map-label-layer { z-index: 9; pointer-events: none; }
.map-sunlight {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 68% 12%, rgba(255, 250, 210, .28), transparent 33%),
    linear-gradient(118deg, rgba(255, 255, 255, .055), transparent 48%, rgba(46, 111, 105, .045));
  mix-blend-mode: screen;
}
.map-cloud {
  position: absolute;
  width: 15%;
  height: 5.7%;
  border-radius: 50%;
  background: rgba(248, 248, 227, .14);
  filter: blur(15px);
  animation: rural-cloud 28s linear infinite;
}
.map-cloud-one { left: -15%; top: 22%; }
.map-cloud-two { left: 46%; top: 12%; width: 19%; opacity: .64; animation-duration: 36s; animation-delay: -13s; }
.map-wind {
  position: absolute;
  width: 15%;
  height: 1px;
  opacity: .16;
  background: linear-gradient(90deg, transparent, #fffbdc, transparent);
  filter: blur(.3px);
  animation: map-wind 8s ease-in-out infinite;
}
.map-wind-one { left: 33%; top: 73%; transform: rotate(-8deg); }
.map-wind-two { left: 69%; top: 57%; animation-delay: -3.5s; transform: rotate(5deg); }
@keyframes rural-cloud {
  from { transform: translateX(-15%); }
  to { transform: translateX(780%); }
}
@keyframes map-wind {
  0%, 100% { opacity: 0; transform: translateX(-18px) rotate(-4deg); }
  45% { opacity: .25; }
  70% { opacity: .08; transform: translateX(46px) rotate(3deg); }
}
.map-atmosphere-layer .firefly { z-index: 1; width: 3px; height: 3px; opacity: .55; }

.rural-hotspots {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: block;
}
.rural-hotspot.map-location {
  position: absolute;
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 46% 42% 48% 40%;
  color: #fff8df;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transform: none;
}
.rural-hotspot.map-location::before { display: none; }
.rural-hotspot:hover,
.rural-hotspot:focus-visible {
  transform: none;
  box-shadow: inset 0 0 52px rgba(255, 247, 181, .09);
}
.rural-hotspot:focus-visible {
  outline: 3px solid rgba(255, 239, 151, .92);
  outline-offset: -5px;
}
.hotspot-notebook { left: 27%; top: 25%; width: 37%; height: 46%; }
.hotspot-projects { left: 0; top: 9%; width: 27%; height: 49%; }
.hotspot-collections { left: 66%; top: 17%; width: 29%; height: 42%; }
.hotspot-helpers { left: 72%; top: 55%; width: 28%; height: 39%; }
.map-character-presentation {
  position: absolute;
  pointer-events: none;
  transform-origin: 50% 96%;
  transition: transform .32s cubic-bezier(.2,.85,.2,1), filter .25s ease;
}
.map-character-presentation::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 18%;
  right: 18%;
  bottom: 1.5%;
  height: 7%;
  border-radius: 50%;
  background: rgba(25, 45, 34, .22);
  filter: blur(4px);
  transform: scaleX(.92);
  transition: opacity .25s ease, transform .3s ease;
}
.map-character {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 7px 5px rgba(25,38,29,.22));
  animation: map-character-breathe 4.8s ease-in-out infinite;
}
.character-notebook { left: 29.5%; top: 50.5%; width: 20%; }
.character-projects { left: 5.5%; top: 31%; width: 22.5%; }
.character-collections { left: 72%; top: 38%; width: 8.5%; }
.character-helpers { left: 77%; top: 66%; width: 8.8%; }
.map-world[data-active-location="notebook"] .character-notebook,
.map-world[data-active-location="projects"] .character-projects,
.map-world[data-active-location="collections"] .character-collections,
.map-world[data-active-location="helpers"] .character-helpers {
  transform: translateY(-8px) scale(1.055);
  filter: drop-shadow(0 8px 8px rgba(25, 38, 29, .24)) drop-shadow(0 0 12px rgba(255, 243, 170, .4));
}
.map-world[data-active-location] .map-character-presentation::after { opacity: .66; transform: scaleX(.8); }
.character-projects .map-character { animation-duration: 6.4s; animation-delay: -2.2s; }
.character-collections .map-character { animation-duration: 5.8s; animation-delay: -1.1s; }
.character-helpers .map-character { animation-duration: 4.1s; animation-delay: -.8s; }
@keyframes map-character-breathe {
  0%, 100% { transform: translateY(0) rotate(-.25deg); }
  50% { transform: translateY(-4px) rotate(.3deg); }
}
.map-location-label {
  position: absolute;
  min-width: 138px;
  display: grid;
  gap: 1px;
  padding: 9px 15px 10px;
  border: 1px solid rgba(68,58,41,.6);
  border-radius: 2px;
  color: #263a31;
  background: rgba(250,238,199,.92);
  box-shadow: 0 4px 0 rgba(76,61,41,.3), 0 12px 26px rgba(34,44,34,.2);
  backdrop-filter: blur(4px);
  text-align: left;
  opacity: .78;
  pointer-events: none;
  transform: translateY(3px) rotate(var(--sign-tilt,0deg)) scale(.94);
  transition: transform .3s ease, background .25s ease, opacity .2s ease;
}
.map-location-label::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(80,69,48,.18); pointer-events: none; }
.map-location-label small { color: #876153; font-size: 9px; }
.map-location-label strong { font-family: var(--serif); font-size: 22px; font-weight: 600; white-space: nowrap; }
.map-location-label > span { display: flex; align-items: center; gap: 5px; color: #56665b; font-size: 9px; }
.map-location-label > span i { display: inline-grid; }
.map-location-label em {
  min-width: 21px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  padding: 2px 5px;
  color: #fff9e7;
  background: #89534b;
  font-style: normal;
}
.label-notebook { left: 48%; top: 61%; --sign-tilt: 1deg; }
.label-projects { left: 11%; top: 58%; --sign-tilt: -1.5deg; }
.label-collections { left: 77.5%; top: 59%; --sign-tilt: 1.2deg; }
.label-helpers { left: 69%; top: 76%; --sign-tilt: -1deg; }
.map-world[data-active-location="notebook"] .label-notebook,
.map-world[data-active-location="projects"] .label-projects,
.map-world[data-active-location="collections"] .label-collections,
.map-world[data-active-location="helpers"] .label-helpers {
  opacity: 1;
  background: rgba(255, 241, 196, .97);
  transform: translateY(-5px) rotate(0) scale(1);
}
.rural-map .quick-capture { z-index: 30; bottom: 18px; width: min(600px, calc(100% - 32px)); background: rgba(247,239,214,.93); }

@media (max-width: 800px) {
  .rural-map .map-titlebar { position: fixed; min-height: 82px; padding: 12px 13px; }
  .rural-map .map-title { gap: 10px; }
  .rural-map .map-title h1 { font-size: 22px; }
  .rural-map .map-title small { font-size: 8px; }
  .rural-map .map-summary { display: flex; gap: 7px; }
  .rural-map .map-summary > span { display: none; }
  .map-menu-panel { position: fixed; top: 70px; right: 10px; width: min(250px, calc(100vw - 20px)); }
  .rural-map .map-canvas {
    min-height: 100dvh;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .rural-map .map-canvas::-webkit-scrollbar { display: none; }
  .map-world {
    left: 0;
    top: 82px;
    width: max(1180px, calc((100dvh - 82px) * 1.7779));
    transform: none;
  }
  .rural-map .quick-capture { position: fixed; bottom: 8px; grid-template-columns: 40px minmax(0,1fr) 36px; width: calc(100% - 16px); }
  .rural-map .quick-capture label { display: none; }
  .rural-map .quick-capture input { border-left: 0; padding-left: 4px; }
  .map-location-label { min-width: 124px; padding: 7px 11px 8px; }
  .map-location-label strong { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .map-character { animation: none; }
  .map-character-presentation,
  .map-location-label { transition: none; }
  .map-cloud,
  .map-wind,
  .map-atmosphere-layer .firefly { animation: none; }
}

/* Personal knowledge site */
.rural-map .map-titlebar {
  min-height: 138px;
  align-items: flex-start;
  padding-top: 28px;
  background: linear-gradient(to bottom, rgba(17, 37, 31, .82), rgba(17, 37, 31, .32) 72%, transparent);
}
.rural-map .map-title { max-width: min(720px, 68vw); align-items: flex-start; }
.rural-map .map-title .title-seal { width: 52px; height: 52px; font-size: 26px; margin-top: 4px; }
.rural-map .map-title h1 {
  max-width: 13em;
  margin-top: 6px;
  font-size: clamp(30px, 3.5vw, 48px);
  line-height: 1.02;
}
.rural-map .map-title p {
  max-width: 62ch;
  margin: 12px 0 0;
  color: rgba(255, 250, 231, .88);
  font-size: clamp(11px, 1.05vw, 14px);
  line-height: 1.75;
  text-shadow: 0 2px 14px rgba(13, 28, 22, .8);
}
.rural-map .map-summary {
  margin-top: 8px;
  padding: 8px 10px 8px 15px;
  border: 1px solid rgba(255, 247, 217, .24);
  border-radius: 999px;
  background: rgba(21, 42, 34, .3);
  backdrop-filter: blur(10px);
}
.map-site-note {
  position: absolute;
  z-index: 30;
  left: clamp(18px, 3.5vw, 54px);
  bottom: 24px;
  width: min(310px, calc(100% - 36px));
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 248, 220, .42);
  border-radius: 4px;
  color: #fff8e5;
  background: rgba(31, 55, 43, .66);
  box-shadow: 0 14px 30px rgba(20, 32, 25, .2);
  backdrop-filter: blur(12px);
}
.map-site-note > span {
  grid-column: 1 / -1;
  color: #e7cf96;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.map-site-note strong { font-family: var(--serif); font-size: 18px; }
.map-site-note p { margin: 0; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.map-site-note em {
  border-radius: 999px;
  padding: 4px 7px;
  color: #2c4538;
  background: #f0d997;
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(110px, .35fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin-bottom: 26px;
  padding: 18px 4px 28px;
  border-bottom: 1px solid rgba(47, 62, 49, .23);
}
.section-intro > span {
  color: var(--red);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .18em;
}
.section-intro h2 {
  max-width: 720px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 46px);
  font-weight: 500;
  line-height: 1.25;
}
.section-intro p { max-width: 680px; margin: 12px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.8; }
body[data-view="notebook"] .section-intro,
body[data-view="projects"] .section-intro,
body[data-view="collections"] .section-intro,
body[data-view="helpers"] .section-intro {
  color: #fff8e5;
  border-bottom-color: rgba(255, 248, 229, .46);
  text-shadow: 0 2px 12px rgba(10, 18, 15, .72);
}
body[data-view="notebook"] .section-intro > span,
body[data-view="projects"] .section-intro > span,
body[data-view="collections"] .section-intro > span,
body[data-view="helpers"] .section-intro > span { color: #f0ca83; }
body[data-view="notebook"] .section-intro p,
body[data-view="projects"] .section-intro p,
body[data-view="collections"] .section-intro p,
body[data-view="helpers"] .section-intro p { color: rgba(255, 248, 229, .9); }

.public-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.public-note-card {
  min-height: 270px;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(60, 67, 52, .22);
  border-radius: 5px;
  color: var(--ink);
  background: rgba(255, 252, 239, .9);
  box-shadow: 0 12px 30px rgba(38, 45, 34, .08);
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.public-note-card:hover { transform: translateY(-4px); border-color: rgba(97, 78, 45, .48); box-shadow: 0 18px 38px rgba(38, 45, 34, .13); }
.public-note-card.featured { grid-column: 1 / -1; min-height: 310px; padding: clamp(26px, 4vw, 48px); background: linear-gradient(135deg, rgba(39, 67, 53, .96), rgba(75, 91, 68, .94)); color: #fff9e8; }
.note-card-number { color: var(--gold); font-family: var(--serif); font-size: 28px; }
.public-note-card small { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .12em; }
.public-note-card.featured small { color: #e4c27c; }
.public-note-card h2 { max-width: 760px; margin: 0; font-family: var(--serif); font-size: clamp(24px, 3vw, 40px); line-height: 1.25; }
.public-note-card p { max-width: 720px; margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.public-note-card.featured p { color: rgba(255, 249, 230, .78); }
.public-note-card footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 10px; }
.publish-empty {
  min-height: 330px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(60, 67, 52, .24);
  border-radius: 6px;
  background: rgba(255, 252, 239, .88);
}
.publish-empty > span { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%; color: #f6e8c2; background: var(--moss-deep); }
.publish-empty small { color: var(--red); font-size: 9px; font-weight: 900; letter-spacing: .14em; }
.publish-empty h2 { margin: 4px 0 7px; font-family: var(--serif); font-size: 28px; }
.publish-empty p { margin: 0; color: var(--ink-soft); line-height: 1.8; }

.public-reader {
  position: relative;
  z-index: 9;
  width: min(900px, calc(100% - 32px));
  margin: 34px auto 80px;
  padding: clamp(24px, 5vw, 68px);
  border: 1px solid rgba(63, 67, 52, .22);
  background: rgba(255, 253, 244, .94);
  box-shadow: var(--shadow);
}
.reader-back { display: inline-flex; align-items: center; gap: 7px; border: 0; padding: 0 0 12px; color: var(--red); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.public-reader > header { padding: 20px 0 28px; border-bottom: 1px solid var(--line); }
.public-reader > header > div { display: flex; flex-wrap: wrap; gap: 6px; }
.public-reader > header span { border-radius: 999px; padding: 5px 9px; color: var(--moss-deep); background: var(--paper-deep); font-size: 9px; }
.public-reader > header p { margin: 15px 0 0; color: var(--ink-soft); font-family: var(--serif); font-size: 18px; line-height: 1.8; }
.public-markdown { height: auto; overflow: visible; padding: 34px 0 0; font-size: 17px; }

.project-grid { gap: 18px; }
.project-card {
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: start;
  padding: clamp(22px, 3vw, 34px);
}
.project-card > span:first-child { font-size: 42px; }
.project-card h2 { font-size: clamp(24px, 3vw, 36px); }
.project-card p { max-width: 720px; font-size: 13px; line-height: 1.8; }
.project-card ul { display: grid; gap: 7px; margin: 18px 0; padding: 0; list-style: none; }
.project-card li { position: relative; padding-left: 16px; color: var(--ink-soft); font-size: 11px; }
.project-card li::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 1px; background: var(--red); }
.project-link { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--paper-light); }
.project-status-dot { width: 11px; height: 11px; margin: 15px; border-radius: 50%; background: #78a17e; box-shadow: 0 0 0 7px rgba(120, 161, 126, .14); }

.solution-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.solution-card {
  display: grid;
  gap: 15px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgba(64, 55, 40, .25);
  border-radius: 6px;
  background: rgba(255, 251, 235, .91);
  box-shadow: 0 10px 28px rgba(46, 42, 30, .08);
}
.solution-card header, .solution-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.solution-card header span { color: var(--red); font-family: var(--serif); font-size: 25px; }
.solution-card time { color: var(--ink-soft); font-size: 9px; }
.solution-card h2 { margin: 0; font-family: var(--serif); font-size: 25px; line-height: 1.35; }
.solution-card > p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.8; }
.solution-card dl { display: grid; gap: 10px; margin: 0; padding-top: 14px; border-top: 1px solid var(--line); }
.solution-card dl div { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
.solution-card dt { color: var(--red); font-size: 10px; font-weight: 800; }
.solution-card dd { margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.7; }
.solution-card footer { justify-content: flex-start; flex-wrap: wrap; }
.solution-card footer em { color: var(--moss); font-style: normal; font-size: 9px; }

.helper-card { min-height: 150px; }
.helper-glyph svg { width: 24px; height: 24px; }
.resource-actions { display: flex; align-items: center; gap: 7px; }
.resource-actions .secondary-button { text-decoration: none; }
.local-resource-label { border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px; color: var(--ink-soft); font-size: 8px; font-weight: 900; }
.note-row-signals { display: inline-flex; gap: 5px; color: var(--gold); }
.is-published { color: #fff; border-color: var(--moss); background: var(--moss); }

@media (max-width: 900px) {
  .rural-map .map-titlebar { min-height: 150px; padding: 18px; }
  .rural-map .map-title { max-width: calc(100vw - 104px); gap: 12px; }
  .rural-map .map-title .title-seal { width: 44px; height: 44px; font-size: 22px; }
  .rural-map .map-title h1 { font-size: clamp(26px, 6vw, 42px); }
  .rural-map .map-title p { max-width: 48ch; margin-top: 8px; font-size: 10px; line-height: 1.55; }
  .map-site-note { bottom: 12px; }
  .public-note-grid, .solution-grid { grid-template-columns: minmax(0, 1fr); }
  .project-card { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .public-note-card.featured { grid-column: auto; }
}

@media (max-width: 800px) {
  .rural-map .map-titlebar { position: fixed; min-height: 108px; }
  .rural-map .map-title p { display: none; }
  .rural-map .map-title small { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .rural-map .map-title h1 { max-width: 70vw; font-size: 24px; }
  .rural-map .map-summary { margin-top: 0; padding: 5px; }
  .map-world { top: 108px; width: max(1180px, calc((100dvh - 108px) * 1.7779)); }
  .map-site-note { position: fixed; left: 8px; bottom: 8px; width: calc(100% - 16px); }
  .section-intro { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .room-header { grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
  .room-heading { grid-column: 2; min-width: 0; }
  .room-heading h1 { overflow: hidden; font-size: 21px; text-overflow: ellipsis; white-space: nowrap; }
  .room-actions { grid-column: 1 / -1; justify-content: stretch; }
  .room-actions .header-search { flex: 1; width: auto; }
  .room-actions .secondary-button span { display: none; }
  .publish-empty { grid-template-columns: 48px minmax(0, 1fr); }
  .publish-empty > span { width: 48px; height: 48px; }
  .publish-empty .primary-button { grid-column: 1 / -1; }
  .project-card { grid-template-columns: 42px minmax(0, 1fr); }
  .project-card > :last-child { grid-column: 2; }
  .helper-card { grid-template-columns: 48px minmax(0, 1fr); }
  .resource-actions, .local-resource-label { grid-column: 2; justify-self: start; }
}

@media (max-width: 520px) {
  .rural-map .map-title { max-width: calc(100vw - 64px); }
  .rural-map .map-title .title-seal { display: none; }
  .rural-map .map-title h1 { max-width: 76vw; font-size: 21px; }
  .map-site-note p { display: none; }
  .public-note-card, .public-note-card.featured { min-height: 250px; padding: 22px; }
  .destination-panel { width: auto; min-width: 0; margin-inline: 12px; }
  .public-note-grid, .public-note-card { width: 100%; min-width: 0; }
  .public-note-card { overflow: hidden; }
  .public-note-card h2, .public-note-card p, .public-note-card footer span { min-width: 0; overflow-wrap: anywhere; }
  .section-intro h2 { font-size: 29px; }
  .solution-card h2 { font-size: 22px; }
  .public-reader { width: calc(100% - 20px); margin-top: 16px; padding: 22px; }
}

.noscript-nav {
  position: fixed;
  z-index: 100;
  inset: auto 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 248, 220, .42);
  border-radius: 5px;
  color: #fff8e5;
  background: #274536;
}
.noscript-nav a { color: #f3dfa4; }

.static-note-page { min-height: 100dvh; background: #f4efe1; }
.static-note-nav {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 0 max(20px, calc((100vw - 820px) / 2));
  border-bottom: 1px solid rgba(47, 62, 49, .18);
  background: #274536;
}
.static-note-nav a { color: #f8ebc7; font-size: 12px; text-decoration: none; }
.static-note-nav a:hover { text-decoration: underline; }
.static-note-main { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: clamp(48px, 8vw, 92px) 0 80px; }
.static-note-article > header { padding-bottom: 32px; border-bottom: 1px solid rgba(47, 62, 49, .22); }
.static-note-article > header small { color: #94564d; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.static-note-article > header h1 {
  margin: 12px 0 18px;
  color: #263a31;
  font-family: var(--serif);
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 500;
  line-height: 1.2;
}
.static-note-article > header p { max-width: 68ch; margin: 0; color: #657167; font-size: 14px; line-height: 1.8; }
.static-note-article > header div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.static-note-article > header div span { color: #52675a; font-size: 10px; }
.static-note-article .public-markdown { padding-top: 38px; }

@media (max-width: 520px) {
  .static-note-main { width: calc(100% - 28px); padding-top: 38px; }
  .static-note-article > header h1 { font-size: 34px; }
}
