@font-face {
  font-family: "Malvides";
  src: url("../fonts/Malvides.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Dochet Script";
  src: url("../fonts/dochet-script.regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fff8f5;
  --bg-2: #fef1eb;
  --panel: #faf6ee;
  --text: #201a17;
  --muted: #6e6460;
  --accent: #94452c;
  --accent-2: #b35c41;
  --accent-ink: #fffbff;
  --line: #e3dac9;
  --shadow: 0 8px 28px rgba(67, 59, 56, 0.08);
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --display: "Epilogue", "Plus Jakarta Sans", sans-serif;
  --cinnabar: #d97e63;
  --sage: #7a9a85;
  --walnut: #3d2b24;
  --ink: #2c2523;
  --paper: #faf6ee;
  --alabaster: #f5efeb;
  --oatmeal: #efe9dc;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
}

body {
  margin: 0 auto;
  max-width: 1440px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.5;
}

body {
  padding-top: 102px;
}

.ink-filter {
  position: absolute;
  width: 0;
  height: 0;
}

img {
  max-width: 100%;
  display: block;
}

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

a {
  color: var(--accent-2);
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  z-index: 20;
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

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

.station-bar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 51;
  width: 100%;
  height: 38px;
  background: #e4cfc0;
}

.station-inner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: 1440px;
  height: 100%;
  margin: 0 auto;
  padding: 0 2.5rem;
}

.station-bar .radio-controls {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  flex: none;
}

.station-bar .radio-btn {
  flex: none;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #c4a48a;
  color: #fffaf4;
  cursor: pointer;
}

.station-bar #radio-toggle {
  width: 22px;
  height: 22px;
  background: #3d2b24;
}

.station-bar .radio-btn .material-symbols-outlined {
  font-size: 12px;
  line-height: 1;
}

.station-bar #radio-toggle .material-symbols-outlined {
  font-size: 16px;
}

.station-bar .radio-volume {
  width: 64px;
  height: 14px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.station-bar .radio-volume::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 999px;
  background: #c9b09c;
}

.station-bar .radio-volume::-webkit-slider-thumb {
  appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border: 0;
  border-radius: 50%;
  background: #a08068;
}

.station-bar .radio-volume::-moz-range-track {
  height: 2px;
  border: 0;
  border-radius: 999px;
  background: #c9b09c;
}

.station-bar .radio-volume::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #a08068;
}

.station-bar .radio-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1;
  color: #1c1a16;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.station-bar .radio-title-run {
  display: flex;
  width: max-content;
}

.station-bar .radio-title-run span {
  flex: none;
  padding-right: 0.35rem;
  white-space: nowrap;
}

.station-bar .radio-title.is-playing {
  text-overflow: clip;
}

.station-bar .radio-title.is-playing .radio-title-run {
  animation: radio-title-slide 36s linear infinite;
}

.station-bar .radio-time {
  flex: none;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #1c1a16;
}

.station-bar .radio-time #radio-left {
  display: inline-block;
  min-width: 2.4rem;
  font-weight: 700;
  text-align: right;
}

@keyframes radio-title-slide {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  .station-bar .radio-title.is-playing .radio-title-run {
    animation: none;
  }
}

.site-nav {
  position: fixed;
  top: 38px;
  left: 50%;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  height: 64px;
  padding: 0 2.5rem;
  background: rgba(255, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 8px rgba(67, 59, 56, 0.04);
  transform: translateX(-50%);
}

body.entries-open .station-bar,
body.entries-open .site-nav,
body.entries-open .glyph-banner {
  z-index: 1;
}

.glyph-banner {
  position: fixed;
  top: 102px;
  left: 50%;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1440px;
  padding: 10px 2.5rem;
  background: rgba(250, 246, 238, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(227, 218, 201, 0.9);
  box-shadow: 0 6px 18px rgba(67, 59, 56, 0.04);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  transform: translateX(-50%);
}

.glyph-banner p {
  margin: 0;
  flex: 1 1 auto;
}

.glyph-banner a {
  color: var(--accent);
  text-underline-offset: 2px;
}

.glyph-banner.is-running::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cinnabar);
  opacity: 0.75;
  animation: glyph-banner-pulse 1.8s ease-in-out infinite;
}

.glyph-banner-dismiss {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.glyph-banner-dismiss:hover {
  color: var(--ink);
}

@keyframes glyph-banner-pulse {
  0%,
  100% { opacity: 0.35; }
  50% { opacity: 0.9; }
}

.brand {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: center;
}

.site-nav nav {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(254, 241, 235, 0.7);
}

.site-nav nav a {
  text-decoration: none;
  color: #55433e;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
}

.site-nav nav a[hidden] {
  display: none !important;
}

.site-nav nav a:hover {
  color: var(--text);
  background: var(--alabaster);
}

.site-nav nav a[aria-current="page"] {
  color: #fffbff;
  background: var(--accent-2);
  box-shadow: 0 2px 10px rgba(200, 109, 81, 0.18);
}

.nav-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-menu-toggle {
  border: 0;
  background: transparent;
  font: inherit;
  color: #55433e;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.nav-menu-toggle:hover,
.nav-menu-toggle[aria-expanded="true"]:not([aria-current="page"]) {
  color: var(--text);
  background: var(--alabaster);
}

.nav-menu-toggle[aria-current="page"] {
  color: #fffbff;
  background: var(--accent-2);
  box-shadow: 0 2px 10px rgba(200, 109, 81, 0.18);
}

.nav-submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 60;
  display: grid;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffdfb;
  box-shadow: var(--shadow);
}

.nav-submenu a {
  display: block;
  text-align: left;
}

.nav-end {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.nav-login {
  flex-shrink: 0;
  text-decoration: none;
  color: #fffbff;
  background: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(200, 109, 81, 0.18);
}

.nav-login:hover {
  filter: brightness(1.06);
}

.nav-logout {
  display: none;
  flex-shrink: 0;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: #55433e;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 0;
  border-radius: 0;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

.nav-logout:hover {
  color: var(--text);
}

body.is-signed-in .site-nav nav {
  display: flex;
}

body.is-signed-in .nav-login {
  display: none;
}

body.is-signed-in .nav-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.auth-page-head {
  text-align: center;
  justify-items: center;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.auth-page-panel {
  width: min(420px, 100%);
  margin: 0 auto;
  padding: 28px;
}

.auth-switch {
  margin: 16px 0 0;
}

.auth-switch-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 0.9rem;
}

.auth-switch-btn:hover {
  color: var(--accent);
}

@media (min-width: 1100px) {
  body.is-signed-in .site-nav nav {
    display: flex;
  }
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.hero {
  --fold: 50%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 72px 6vw 64px;
  overflow: visible;
  background: var(--bg);
}

.hero-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  max-width: 760px;
  margin-bottom: 28px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 10px 22px 10px 16px;
  border-radius: 999px;
  background: #fffcfa;
  box-shadow: 0 8px 24px rgba(67, 59, 56, 0.06);
  color: #4a403c;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e8a090;
  flex-shrink: 0;
}

.hero h1 {
  margin: 0;
  max-width: none;
  font-size: 58px;
  line-height: 1.08;
  font-weight: 600;
  color: var(--ink);
}

.hero h1 span {
  white-space: nowrap;
}

.hero-sub {
  margin: -12px 0 0;
  padding-bottom: 14px;
  width: max-content;
  max-width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
}

.hero-quote {
  margin: 0;
  max-width: 40rem;
  color: #b35c41;
  font-family: var(--display);
  font-style: italic;
  font-size: 16px;
}

.codex-stage {
  --fold: 50%;
  --fold-n: 0.5;
  --stage-pad-x: 48px;
  --stage-pad-t: 48px;
  --stage-pad-b: 24px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(640px, 100%);
  min-height: 280px;
  padding: var(--stage-pad-t) var(--stage-pad-x) var(--stage-pad-b);
  overflow: visible;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  perspective: 1100px;
  perspective-origin: 50% 50%;
}

.codex-stage.is-dragging,
.codex-rig.is-dragging {
  cursor: grabbing;
}

.hero-wash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 156%;
  z-index: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.hero-wash img {
  display: block;
  width: 100%;
  height: auto;
}

.wash-blob {
  transform-box: fill-box;
  transform-origin: center;
  animation: wash-breathe 16s ease-in-out infinite;
}

.wash-blob:nth-of-type(2) {
  animation-duration: 20s;
  animation-delay: -5s;
}

.wash-blob:nth-of-type(3) {
  animation-duration: 18s;
  animation-delay: -9s;
}

@keyframes wash-breathe {
  0%,
  100% {
    opacity: 0.88;
    transform: scale(1) translate(0, 0);
  }
  50% {
    opacity: 1;
    transform: scale(1.06) translate(8px, -6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wash-blob {
    animation: none;
  }

  .codex-verse-latin {
    clip-path: none;
  }

  .codex-face-cipher {
    display: none;
  }
}

.codex-rig {
  position: relative;
  z-index: 1;
  width: 100%;
  transform-style: preserve-3d;
}

.codex-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
  transform-style: preserve-3d;
  transform-origin: var(--fold) 50%;
  background-color: #f7f4ee;
  background-image: url("../assets/paper-grain.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgba(210, 196, 180, 0.7);
  box-shadow:
    0 1px 2px rgba(70, 52, 42, 0.04),
    0 6px 12px rgba(70, 52, 42, 0.05),
    0 16px 32px rgba(70, 52, 42, 0.07),
    0 32px 56px rgba(70, 52, 42, 0.08);
  will-change: transform;
  transition: transform 0.4s ease;
}

.codex-stage.is-dragging .codex-sheet {
  transition: none;
}

.codex-sheet::before {
  content: none;
}

.codex-sheet::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(48, 32, 24, 0.14) 0%,
    rgba(48, 32, 24, 0.04) calc(var(--fold) - 8%),
    rgba(255, 255, 255, 0.2) var(--fold),
    rgba(48, 32, 24, 0.05) calc(var(--fold) + 8%),
    rgba(48, 32, 24, 0.12) 100%
  );
  mix-blend-mode: multiply;
}

.codex-face-latin {
  position: relative;
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--fold)) 0 0);
}

.codex-face-cipher {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  clip-path: inset(0 0 0 var(--fold));
}

.codex-type {
  position: relative;
  width: max-content;
  max-width: 100%;
  overflow: hidden;
}

.codex-cipher {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../assets/asemic-cipher.png");
  background-repeat: no-repeat;
  background-size: 118% 118%;
  background-position: center;
  mix-blend-mode: multiply;
  filter: contrast(1.12);
}

.codex-page {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  padding: 36px 40px;
}

.codex-verse {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  color: var(--ink);
  font-family: "Malvides", var(--display);
  font-size: 28px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.28;
  letter-spacing: 0.02em;
  text-align: center;
}

.codex-verse span {
  display: block;
  white-space: nowrap;
}

.codex-verse-sizer {
  visibility: hidden;
}

.codex-aside {
  margin: 0;
  max-width: 28rem;
  color: #6e6460;
  font-family: var(--display);
  font-size: 16px;
  font-style: italic;
  line-height: 1.5;
  text-align: center;
}

.codex-caption {
  margin: 8px 0 0;
  color: #9a8d84;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-scan {
  position: absolute;
  top: calc(var(--stage-pad-t) - 16px);
  bottom: calc(var(--stage-pad-b) - 16px);
  left: calc(var(--stage-pad-x) + (100% - 2 * var(--stage-pad-x)) * var(--fold-n));
  z-index: 20;
  width: 16px;
  background: none;
  transform: translateX(-50%);
  pointer-events: none;
}

.hero-scan-stroke {
  position: absolute;
  left: 50%;
  top: 0;
  width: 8px;
  height: 100%;
  transform: translateX(-50%);
  object-fit: fill;
  object-position: center;
  image-rendering: auto;
}

.codex-hint {
  position: absolute;
  left: calc(var(--stage-pad-x) + (100% - 2 * var(--stage-pad-x)) * var(--fold-n));
  top: calc(var(--stage-pad-t) - 32px);
  z-index: 21;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 32px;
  transform: translate(-50%, -100%);
  color: #b35c41;
  font-family: var(--display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  animation: hint-breathe 2.4s ease-in-out infinite;
}

.codex-hint span {
  font-size: 11px;
  letter-spacing: 0;
  opacity: 0.7;
}

.codex-stage.is-dragging .codex-hint,
.codex-stage.has-revealed .codex-hint {
  opacity: 0;
  animation: none;
}

@keyframes hint-breathe {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .codex-hint {
    animation: none;
    opacity: 0.8;
  }
}

.hero-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.lede,
.process-intro p,
.page-head p {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero .hero-actions {
  justify-content: center;
  margin-top: 72px;
}

.hero .hero-actions .btn {
  padding: 11px 36px;
}

#how-it-works {
  scroll-margin-top: 118px;
}

.panel .row-actions {
  margin-top: 14px;
}

.composer > .journal-save-row {
  justify-content: space-between;
  margin-bottom: 0;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 11px 18px;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  background: transparent;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 11px 36px;
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-ghost {
  border: 1px solid #c4b09d;
  color: var(--walnut);
  background: #fff;
  box-shadow: 0 1px 0 rgba(67, 59, 56, 0.05);
}

.btn-ghost:hover:not(:disabled) {
  border-color: var(--accent-2);
  color: var(--accent);
  background: #fff8f5;
}

.process {
  padding: 24px 2.5rem 72px;
  background: var(--paper);
}

.process-intro,
.page-head {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 20px 48px;
  align-items: center;
  margin-bottom: 28px;
}

.page-head-stack {
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  justify-items: start;
}

.process h2,
.page-head h1 {
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  margin: 0;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.steps li {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 36px;
}

.step-lead {
  display: flex;
  align-items: center;
  position: relative;
  flex: 0 0 302px;
  padding-left: 88px;
}

.step-copy,
.step-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.step-text {
  flex: 1;
}

.step-text .step-index {
  visibility: hidden;
}

.step-icon {
  display: block;
  position: absolute;
  left: 0;
  top: 50%;
  width: 72px;
  height: 72px;
  margin: 0;
  transform: translateY(-50%);
}

.step-index {
  display: block;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  color: rgba(148, 69, 44, 0.4);
  margin: 0 0 6px;
}

.steps h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  text-align: left;
}

.steps p {
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.steps-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
}

section.seal-row {
  display: flex;
  justify-content: center;
  padding: 8px 2.5rem 64px;
  overflow-x: clip;
  background: var(--paper);
}

.seal-stage {
  width: min(100%, 750px);
  text-align: center;
}

.seal-copy {
  text-align: center;
}

.seal-copy h3 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.seal-emph {
  color: var(--accent);
}

.seal-copy p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.home-stories {
  margin: 48px 0;
  padding: 24px 2.5rem 40px;
  background: var(--paper);
}

.home-stories h2 {
  margin: 0 0 22px;
  text-align: center;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 500;
  letter-spacing: -0.03em;
}

.home-story-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0;
}

.home-story-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid #e7ddd0;
  border-radius: 18px;
  background: #fffdfb;
  color: inherit;
  text-decoration: none;
}

.home-story-card img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.home-story-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 18px 20px;
}

.home-story-body h3 {
  margin: 0;
}

.home-story-body p {
  margin: 0;
  color: #6e6560;
  line-height: 1.45;
}

.home-story-body .story-read {
  margin-top: auto;
}

.seal-photo-wrap {
  position: relative;
  width: min(100%, 750px);
  margin: 0 auto;
}

.seal-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: calc(32px - 4.23%);
}

.process-intro-center .steps-note {
  margin-top: -14px;
}

.process-foot {
  margin-top: 28px;
}

.page {
  padding: 32px 2.5rem 72px;
}

.contact-page {
  padding-top: 72px;
  padding-bottom: 96px;
}

.contact-form {
  width: min(28rem, 100%);
  display: grid;
  gap: 4px;
}

.contact-form .field {
  margin-bottom: 12px;
}

.contact-form .field > span em {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--muted);
  opacity: 0.78;
}

.contact-form textarea {
  width: 100%;
  min-height: 10rem;
}

.contact-form .btn {
  justify-self: start;
  margin-top: 4px;
}

.contact-form h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
  width: max-content;
  max-width: calc(100vw - 10vw);
}

.contact-sub {
  margin: 8px 0 18px;
  color: var(--muted);
}

.home-contact {
  display: flex;
  justify-content: center;
  padding: 24px 2.5rem 72px;
  background: var(--paper);
}

.home-contact .contact-form {
  width: min(42rem, 100%);
}

.home-contact .contact-form h3 {
  margin: 0;
  text-align: center;
}

.home-contact-sub {
  margin: 8px 0 18px;
  text-align: center;
  color: var(--muted);
}

.home-contact .contact-form textarea {
  height: 101.5px;
  min-height: 101.5px;
}

.home-contact .contact-form .btn {
  justify-self: center;
}

.privacy-page {
  padding-top: 72px;
  padding-bottom: 96px;
}

.privacy-copy {
  width: min(40rem, 100%);
}

.privacy-copy h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.85rem, 3.4vw, 2.45rem);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

.privacy-copy h2 {
  margin: 28px 0 8px;
  font-size: 1.05rem;
}

.privacy-copy p,
.privacy-copy li {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.55;
}

.privacy-copy ul {
  margin: 0 0 10px;
  padding-left: 1.2rem;
}

.privacy-copy .btn {
  margin-top: 8px;
}

.upload-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.page-head {
  max-width: none;
}

.ref-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.my-archetypes-panel {
  margin-bottom: 18px;
}

.my-archetypes-panel .panel-heading {
  margin-bottom: 0.35rem;
}

.letter-map-archetypes {
  list-style: none;
  margin: 0;
  padding: 0;
}

.letter-map-archetypes li:not(.letter-map-archetype-empty) {
  border-top: 1px solid #ebe5da;
}

.letter-map-archetypes li:not(.letter-map-archetype-empty):last-child {
  border-bottom: 1px solid #ebe5da;
}

.letter-map-archetype {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
}

.letter-map-archetype.is-current .letter-map-archetype-open,
.letter-map-archetype-open:hover {
  background: rgba(200, 109, 81, 0.04);
}

.letter-map-archetype-open {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.1rem;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.letter-map-archetype-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #2c271f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.letter-map-archetype-marks {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.letter-map-archetype-marks img {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: invert(23%) sepia(34%) saturate(1292%) hue-rotate(346deg) brightness(93%) contrast(88%);
}

.letter-map-archetype-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.letter-map-archetype-action {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #8c827d;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.letter-map-archetype-action:hover {
  color: #2c271f;
}

.letter-map-archetypes-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.7rem;
}

.letter-map-archetypes-foot:empty {
  display: none;
}

.letter-map-archetypes-foot .fonts-cap {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #8c827d;
}

.letter-map-create {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  font-size: 0.8125rem;
  border-radius: 8px;
  padding: 0.4rem 0.85rem;
  background: #f3e6dc;
  color: #2c271f;
}

.letter-map-create:hover {
  background: #edd9cc;
}

.letter-map-create:disabled {
  opacity: 0.6;
  cursor: default;
}

.letter-map-archetype-empty {
  margin: 0;
  padding: 0.35rem 0 0.15rem;
  border: 0;
  font-size: 0.8125rem;
  color: #8c827d;
}

.ref-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 18px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 1px 8px rgba(67, 59, 56, 0.05);
  text-align: left;
  cursor: pointer;
}

.ref-card:hover {
  background: #faf3ea;
}

.ref-card.selected {
  border-color: var(--accent);
  background: rgba(148, 69, 44, 0.08);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ref-card-tag {
  display: inline-flex;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--alabaster);
  color: var(--walnut);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ref-card.selected .ref-card-tag {
  background: var(--accent);
  color: var(--accent-ink);
}

.ref-card-letters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ref-letter-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 8px 4px;
  border-radius: 12px;
  background: var(--paper);
}

.ref-glyph {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  filter: brightness(0);
  pointer-events: none;
  user-select: none;
}

.ref-glyph-text {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  color: #111;
  font-size: 1.2rem;
  line-height: 1;
}

.ref-actions {
  margin-top: 20px;
  justify-content: flex-end;
}

.ref-actions .btn {
  padding-left: 36px;
  padding-right: 36px;
}

.make-split {
  display: grid;
  gap: 24px;
  max-width: 720px;
}

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

.asemic-guide {
  display: grid;
  gap: 12px;
}

.asemic-guide h2 {
  margin: 2rem 0 0;
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  color: var(--text);
}

.asemic-guide h2:first-child {
  margin-top: 0;
}

.asemic-guide p,
.asemic-guide li {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.asemic-guide .guide-lead {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.45;
}

.asemic-guide .guide-aside {
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 1.02rem;
}

.asemic-guide ul {
  margin: 0;
  padding-left: 1.25em;
  list-style: disc;
}

.asemic-guide li {
  display: list-item;
  margin: 0 0 8px;
}

.asemic-guide li:last-child {
  margin-bottom: 0;
}

.asemic-guide .guide-close {
  color: var(--text);
}

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

.example-thumb {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4efe6;
  cursor: zoom-in;
  overflow: hidden;
}

.example-thumb:focus-visible {
  outline: 2px solid rgba(148, 69, 44, 0.7);
  outline-offset: 2px;
}

.guide-examples img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.upload-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.upload-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding-bottom: 16px;
}

.upload-dialog-panel .thumbs {
  margin: 12px 0 0;
}

.upload-dialog-panel .thumbs:empty {
  display: none;
}

.upload-dialog-panel .row-actions {
  margin-top: 12px;
  justify-content: flex-end;
}

.upload-dialog-panel .status {
  margin: 8px 0 0;
  min-height: 0;
}

.upload-dialog-panel .status:empty {
  display: none;
}

.upload-dialog-panel .panel-heading {
  align-items: center;
}

.upload-dialog-panel .panel-heading h2 {
  font-size: 18px;
}

.upload-dialog-panel p.howto {
  font-size: 14px;
}

.style-dialog-panel {
  width: min(920px, 100%);
}

.style-dialog-panel .ref-seed-count {
  margin-top: 12px;
}

.style-dialog-panel .ref-card-grid {
  max-height: min(52vh, 520px);
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.upload-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -6px -6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.upload-close:hover,
.upload-close:focus-visible {
  background: rgba(148, 69, 44, 0.12);
  color: var(--text);
}

.save-letters-panel {
  width: min(420px, 100%);
}

.pages-archive {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
}

.pages-archive.open {
  display: grid;
  place-items: center;
  padding: 24px;
}

.pages-archive-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.pages-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}

.pages-archive-item {
  margin: 0;
}

.pages-archive-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.pages-archive-item figcaption {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(7, 32, 42, 0.84);
  cursor: pointer;
}

.lightbox-frame {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  max-width: min(920px, 100%);
}

.lightbox-figure {
  margin: 0;
}

.lightbox-figure img {
  display: block;
  max-width: min(78vw, 820px);
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0e1820;
}

.lightbox-caption {
  margin-top: 10px;
  color: var(--accent-2);
  font-size: 0.88rem;
  text-align: center;
}

.lightbox-close,
.lightbox-nav {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
}

.lightbox-close {
  position: absolute;
  top: -8px;
  right: 44px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.lightbox-nav {
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 2px solid rgba(148, 69, 44, 0.7);
  outline-offset: 2px;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 8px;
}

.choice-card {
  display: grid;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.choice-card:hover {
  border-color: var(--accent);
}

.choice-kicker {
  margin: 0;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.choice-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.choice-card p {
  margin: 0;
  color: var(--muted);
}

.choice-card .choice-note {
  color: var(--accent-2);
  font-size: 0.88rem;
}

.choice-cta {
  margin-top: 8px;
  color: var(--accent-2);
  font-weight: 600;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.howto {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.howto li {
  margin-bottom: 8px;
}

p.howto {
  padding-left: 0;
}

.draw-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.alphabet-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: stretch;
}

.library-stack,
.map-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.library-stack {
  height: 0;
  min-height: 100%;
  overflow: hidden;
}

.library-stack > #glyph-source-pane,
.map-stack > .slots-panel {
  flex: 1 1 auto;
  min-height: 0;
}

.my-archetypes-panel,
.extract-glyphs-panel {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  margin-bottom: 0;
  min-width: 0;
}

.my-archetypes-panel .panel-heading,
.extract-glyphs-panel .panel-heading {
  align-items: center;
  margin-bottom: 0.35rem;
}

.my-archetypes-panel .panel-heading h2,
.extract-glyphs-panel .panel-heading h2 {
  margin: 0;
}

.my-archetypes-panel .letter-map-archetypes-foot {
  margin-top: auto;
  padding-top: 0.7rem;
}

.panel-fold {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8c827d;
  cursor: pointer;
}

.panel-fold:hover {
  background: rgba(44, 39, 31, 0.06);
  color: #2c271f;
}

.panel-fold .material-symbols-outlined {
  font-size: 22px;
}

.my-archetypes-panel.is-collapsed > :not(.panel-heading),
.extract-glyphs-panel.is-collapsed > :not(.panel-heading) {
  display: none;
}

.my-archetypes-panel.is-collapsed .panel-heading,
.extract-glyphs-panel.is-collapsed .panel-heading {
  margin-bottom: 0;
}

.extract-glyphs-panel .field:last-of-type {
  margin-bottom: 0;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.extract-page-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.field-label-row > span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field-learn {
  border: 0;
  padding: 0;
  background: none;
  color: #55433e;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
}

.field-learn:hover {
  color: #2c271f;
}

.extract-glyphs-panel .extract-create-row,
.glyph-make-archetypes .extract-create-row {
  justify-content: flex-end;
  margin-top: auto;
  margin-bottom: 0;
  padding-top: 14px;
}

.extract-pick {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.extract-pick:focus-visible {
  outline: 2px solid rgba(148, 69, 44, 0.45);
  outline-offset: 1px;
}

.extract-pick-value {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.extract-pick-value.is-empty {
  color: var(--muted);
}

.extract-pick-value img {
  width: 36px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 auto;
}

.journal-layout {
  --journal-em: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.journal-layout > .panel,
.composer-shell,
.glyph-composer {
  min-width: 0;
  max-width: 100%;
}

.journal-save-status {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: left;
  color: var(--ink);
}

.journal-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.entries-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.entries-drawer.open {
  pointer-events: auto;
}

.entries-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(6, 14, 20, 0.55);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.22s ease;
}

.entries-drawer.open .entries-backdrop {
  opacity: 1;
}

.entry-list-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(360px, 92vw);
  margin: 0;
  border-radius: 0;
  transform: translateX(100%);
  transition: transform 0.28s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.entries-drawer.open .entry-list-panel {
  transform: translateX(0);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 12px;
}

.alphabet-menu {
  position: relative;
  margin: -4px 0 14px;
}

.alphabet-menu-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.alphabet-menu-btn:focus-visible {
  outline: 2px solid rgba(148, 69, 44, 0.45);
  outline-offset: 1px;
}

.alphabet-menu-btn .material-symbols-outlined {
  font-size: 20px;
  color: var(--muted);
}

.alphabet-menu-list {
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 280px;
  margin: 0;
  padding: 6px;
  overflow: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 12px 32px rgba(44, 37, 35, 0.12);
}

.alphabet-menu-list button {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.alphabet-menu-list button:hover,
.alphabet-menu-list button[aria-selected="true"] {
  background: var(--bg-2);
}

.panel-heading-stack {
  flex-direction: column;
  align-items: flex-start;
}

.panel-heading-stack .hint {
  max-width: 42rem;
}

.hint,
.status {
  color: var(--muted);
  font-size: 0.9rem;
}

.status {
  min-height: 1.2em;
}

#glyph-make-extract .dropzone {
  margin-top: 10px;
}

#glyph-make-extract .thumbs:empty,
#glyph-make-extract .status:empty {
  display: none;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 132px;
  border: 1px dashed rgba(148, 69, 44, 0.35);
  border-radius: 12px;
  background: rgba(148, 69, 44, 0.08);
  cursor: pointer;
  text-align: center;
  padding: 18px;
}

.dropzone.dragover {
  border-color: var(--accent);
  border-color: var(--accent);
  background: rgba(148, 69, 44, 0.14);
}

.dropzone span {
  color: var(--muted);
  font-size: 0.88rem;
}

.thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.thumbs img {
  width: 112px;
  height: 148px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.thumb-card {
  position: relative;
}

.thumb-close {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.94);
  color: var(--ink, #2a2118);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(42, 33, 24, 0.18);
}

.thumb-close:hover,
.thumb-close:focus-visible {
  background: #fff;
  color: var(--accent);
}

.draw-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.pen-tools,
.draw-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.pen-btn {
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--text);
  cursor: pointer;
}

.pen-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: #ffdbd0;
  color: var(--accent);
}

.draw-page {
  --grid-cell: 28px;
  --sq-mid: rgba(70, 80, 90, 0.4);
  width: 100%;
  position: relative;
  background-color: #f3eee3;
  border: 1px solid rgba(16, 34, 44, 0.12);
  border-radius: 12px;
  overflow: hidden;
}

.draw-page.is-square-grid {
  --sq: rgba(120, 130, 140, 0.14);
  background-image:
    linear-gradient(to right, transparent calc(50% - 0.5px), var(--sq-mid) calc(50% - 0.5px), var(--sq-mid) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--sq-mid) calc(50% - 0.5px), var(--sq-mid) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--sq) calc(50% - 0.5px), var(--sq) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), var(--sq) calc(50% - 0.5px), var(--sq) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-size: 100% 100%, 100% 100%, var(--grid-cell) var(--grid-cell), var(--grid-cell) var(--grid-cell);
  background-position: center, center, center, center;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}

#draw-canvas {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
  height: min(68vh, 720px);
  background: transparent;
  cursor: crosshair;
  touch-action: none;
}

.draw-tips summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent-2);
}

.draw-tips ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.draw-tips li {
  margin-bottom: 10px;
}

.draw-tips li:last-child {
  margin-bottom: 0;
}

.hoard {
  display: grid;
  gap: 10px;
}

.hoard {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  min-height: 180px;
}

.hoard-empty {
  grid-column: 1 / -1;
  margin: 0;
  white-space: nowrap;
}

.letter-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, 112px);
  gap: 10px;
  justify-content: start;
}

.letter-slots .slot {
  width: 112px;
  height: 112px;
  max-width: 112px;
  aspect-ratio: 1 / 1;
}

.glyph-card,
.slot {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.glyph-card {
  cursor: pointer;
  aspect-ratio: 1;
  min-height: 92px;
}

.glyph-card.is-bank,
.slot.filled img {
  cursor: grab;
  touch-action: none;
}

.glyph-card.is-bank {
  cursor: grab;
}

body.is-glyph-dragging,
body.is-glyph-dragging * {
  cursor: grabbing;
}

.slot.is-drop,
#glyph-source-pane.is-drop {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

.glyph-drag-ghost {
  position: fixed;
  z-index: 80;
  width: 72px;
  height: 72px;
  margin: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(44, 37, 35, 0.16);
}

.glyph-drag-ghost img {
  display: block;
  width: 78%;
  height: 78%;
  margin: 11% auto 0;
  object-fit: contain;
  filter: brightness(0) invert(28%) sepia(48%) saturate(1400%) hue-rotate(346deg) brightness(0.92);
}

body.is-custom-ink .slot img,
body.is-custom-ink .glyph-card img,
body.is-custom-ink .glyph-drag-ghost img,
body.is-custom-ink .letter-map-archetype-marks img {
  filter: var(--glyph-ink-filter);
}

.glyph-card img,
.slot img {
  width: 92%;
  height: calc(100% * 280 / 392);
  margin-bottom: calc(100% * 112 / 392);
  object-fit: contain;
  object-position: bottom center;
  align-self: end;
  transform: translateY(calc(var(--glyph-hang, 0) * 100% * 112 / 280));
  filter: brightness(0) invert(28%) sepia(48%) saturate(1400%) hue-rotate(346deg) brightness(0.92);
}

.slot {
  width: 112px;
  height: 112px;
  min-height: 112px;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  justify-items: center;
  padding: 6px 8px 8px;
  box-sizing: border-box;
}

.slot img {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: center;
  width: 92%;
  height: calc(100% * 280 / 392);
  min-height: 0;
  max-height: none;
  margin-top: 0;
  margin-bottom: calc(100% * 112 / 392);
  object-position: bottom center;
}

.slot.filled {
  border-color: var(--cinnabar);
}

.slot-key {
  position: static;
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  font-size: 0.7rem;
  font-weight: 650;
  color: var(--ink);
}

.slot-edit {
  position: static;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  z-index: 1;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.2;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.slot-edit:hover {
  color: var(--cinnabar);
}

.slot.editing {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

.glyph-swap {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  gap: 0;
  transition: gap 420ms ease;
}

.glyph-swap.is-editing {
  gap: 16px;
  margin-bottom: 18px;
}

.glyph-pane {
  min-height: 0;
}

#glyph-source-pane {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#glyph-source-pane > .panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#glyph-source-pane .panel-heading,
.slots-panel .panel-heading {
  align-items: center;
  margin-top: 0;
}

.slots-panel .panel-heading .hint {
  margin: 0;
}

#glyph-source-pane .panel-heading h2,
.slots-panel .panel-heading h2 {
  margin: 0;
  line-height: 1.2;
}

#glyph-source-pane #pair-hint {
  margin: 0 0 12px;
}

#glyph-source-pane .hoard {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow: auto;
  align-content: start;
  justify-content: start;
  grid-template-columns: repeat(auto-fill, var(--glyph-box-w, 112px));
  grid-auto-rows: var(--glyph-box-h, 112px);
  gap: 10px;
  padding: 0;
}

.hoard-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#glyph-source-pane .hoard .glyph-card {
  width: var(--glyph-box-w, 112px);
  height: var(--glyph-box-h, 112px);
  min-height: var(--glyph-box-h, 112px);
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  justify-items: center;
  padding: 6px 8px 8px;
}

#glyph-source-pane .hoard .glyph-card img {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: end;
  justify-self: center;
  width: 92%;
  height: calc(100% * 280 / 392);
  min-height: 0;
  max-height: none;
  margin-top: 0;
  margin-bottom: calc(100% * 112 / 392);
  object-position: bottom center;
}

#glyph-source-pane .hoard .glyph-remove {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  z-index: 1;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

#glyph-source-pane .hoard .glyph-remove:hover {
  color: var(--cinnabar);
}

#glyph-source-pane .hoard .glyph-card.editing {
  outline: 2px solid var(--cinnabar);
  outline-offset: 2px;
}

#letter-edit-pane {
  flex: 0 0 auto;
  max-height: 1200px;
  opacity: 1;
  overflow: hidden;
  transform: none;
}

.letter-edit {
  color: var(--ink);
  padding-bottom: 14px;
}

.letter-edit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.letter-edit-head h2 {
  margin: 0;
}

.letter-edit .letter-edit-fold,
.letter-edit .letter-edit-fold[aria-expanded="true"] {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}

.letter-edit-fold .fold-down {
  display: none;
}

.letter-edit.is-collapsed .letter-edit-fold .fold-up {
  display: none;
}

.letter-edit.is-collapsed .letter-edit-fold .fold-down {
  display: block;
}

.letter-edit.is-collapsed .letter-edit-work,
.letter-edit.is-collapsed .letter-edit-toolbar,
.letter-edit.is-collapsed .letter-edit-stage,
.letter-edit.is-collapsed #strokes-slide,
.letter-edit.is-collapsed .row-actions,
.letter-edit.is-collapsed .status {
  display: none;
}

.letter-edit.is-collapsed {
  padding-bottom: 4px;
}

.letter-edit.is-collapsed .letter-edit-head {
  margin-bottom: 0;
}

.letter-edit .row-actions {
  margin-top: 10px;
  justify-content: flex-end;
  gap: 8px;
}

.letter-edit #letter-edit-save {
  box-sizing: border-box;
  width: 108px;
  margin: 5px 0 5px auto;
  padding-left: 12px;
  padding-right: 12px;
  text-align: center;
}

.letter-edit .status {
  margin: 0;
}

.letter-edit .status:empty {
  display: none;
}

.letter-edit-work {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.letter-edit-toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  gap: 8px;
  margin: 0;
  position: relative;
  z-index: 6;
  flex: 0 0 auto;
}

.letter-edit-tools {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.letter-edit .tool-submenu {
  top: 0;
  left: calc(100% + 6px);
}

.tool-pop {
  position: relative;
}

.tool-submenu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 4;
  display: grid;
  gap: 2px;
  min-width: 108px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  box-shadow: 0 8px 22px rgba(40, 24, 16, 0.14);
}

.thickness-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 7px 8px;
  cursor: pointer;
}

.thickness-opt[aria-pressed="true"] {
  background: #ffdbd0;
  color: var(--cinnabar);
}

#brush-list,
#pencil-list {
  min-width: 220px;
  max-height: 228px;
  overflow: auto;
  align-content: start;
}

.brush-group-label {
  margin: 8px 4px 2px;
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.04em;
  color: #7a6558;
}

.brush-group-label:first-child {
  margin-top: 2px;
}

.brush-grid {
  display: grid;
  grid-template-columns: repeat(4, 46px);
  gap: 4px;
}

.brush-opt {
  width: 46px;
  height: 46px;
  padding: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.brush-opt img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.brush-opt[aria-pressed="true"] {
  background: #ffdbd0;
}

.thickness-mark {
  width: 42px;
  border-radius: 999px;
  background: currentColor;
}

.eraser-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
}

.eraser-mark span {
  border-radius: 50%;
  background: currentColor;
}

.shape-list {
  grid-template-columns: 1fr 1fr;
  min-width: 0;
  gap: 4px;
}

.shape-opt {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.shape-opt svg {
  width: 18px;
  height: 18px;
  display: block;
}

.shape-opt[aria-pressed="true"] {
  border-color: var(--cinnabar);
  background: #ffdbd0;
  color: var(--cinnabar);
}

.tool-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

.tool-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.color-swatch,
.color-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #94452c;
  box-shadow: inset 0 0 0 1px rgba(40, 24, 16, 0.28);
}

.color-custom {
  cursor: pointer;
}

.color-custom input[type="color"] {
  width: 28px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.tool-pen-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("../assets/pen-tool.png?v=1") center / contain no-repeat;
  mask: url("../assets/pen-tool.png?v=1") center / contain no-repeat;
}

.tool-rotate-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("../assets/rotate-right.png?v=1") center / contain no-repeat;
  mask: url("../assets/rotate-right.png?v=1") center / contain no-repeat;
}

.tool-expand-icon {
  width: 18px;
  height: 18px;
  display: block;
  background-color: currentColor;
  -webkit-mask: url("../assets/expand.png?v=1") center / contain no-repeat;
  mask: url("../assets/expand.png?v=1") center / contain no-repeat;
}

.tool-btn[aria-pressed="true"],
.tool-btn[aria-expanded="true"] {
  border-color: var(--cinnabar);
  background: #ffdbd0;
  color: var(--cinnabar);
}

.tool-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.tool-btn-sep {
  width: 22px;
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.letter-edit-stage[data-tool="brush"] #letter-edit-canvas {
  cursor: crosshair;
}

.letter-edit-stage[data-tool="eraser"] #letter-edit-canvas {
  cursor: none;
}

.eraser-cursor {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 1.5px solid var(--cinnabar);
  border-radius: 50%;
  background: rgba(148, 69, 44, 0.16);
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: none;
}

.letter-edit-stage[data-tool="eraser"] .eraser-cursor.is-on {
  display: block;
}

.letter-edit-stage[data-tool="cursor"] #letter-edit-canvas {
  cursor: default;
}

.rotate-readout {
  position: absolute;
  z-index: 4;
  top: 6px;
  left: 10px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 560;
  line-height: 1;
  color: #94452c;
  pointer-events: none;
}

.letter-edit-stage[data-tool="pen"] #letter-edit-canvas,
.letter-edit-stage[data-tool="shape"] #letter-edit-canvas {
  cursor: crosshair;
}

@media (prefers-reduced-motion: reduce) {
  .glyph-swap,
  #letter-edit-pane {
    transition: none;
  }
}

.draw-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

#layers-slide {
  align-self: stretch;
  flex: 0 0 168px;
  width: 168px;
}

#strokes-slide {
  margin-top: 10px;
}

.draw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 42px;
  padding: 0 10px 0 12px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.draw-panel-head h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0;
}

.draw-panel-body {
  min-height: 0;
  overflow: auto;
}

#layers-slide .draw-panel-body {
  flex: 1 1 auto;
}

#strokes-slide .draw-panel-body {
  max-height: 210px;
}

.stroke-menu {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 10px 0;
}

.stroke-menu button {
  flex: 0 0 auto;
  margin: 0;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.3;
  cursor: pointer;
}

.stroke-menu button[aria-pressed="true"] {
  background: #ffdbd0;
  border-color: transparent;
  color: var(--cinnabar);
}

.stroke-examples {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 10px;
}

.stroke-example {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.stroke-example canvas {
  display: block;
  width: 56px;
  height: 56px;
}

.stroke-example:hover {
  border-color: var(--cinnabar);
}

#letter-layer-add {
  width: 26px;
  height: 26px;
}

.layer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  height: 42px;
  padding: 0 8px;
  border-top: 1px solid var(--line);
  flex: 0 0 auto;
}

.draw-slide-empty {
  margin: 0;
  padding: 8px 12px 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.layer-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px 8px;
}

.layer-row {
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.layer-list {
  user-select: none;
}

.layer-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.layer-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

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

.layer-rename {
  flex: 0 0 auto;
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.layer-rename svg {
  width: 14px;
  height: 14px;
}

.layer-rename:hover {
  background: rgba(44, 37, 35, 0.08);
}

.layer-name-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 1px 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  user-select: text;
}

.layer-preview {
  display: block;
  width: 100%;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.layer-row.is-selected {
  background: #ffdbd0;
  color: var(--cinnabar);
}

.letter-edit-stage {
  --grid-cell: 28px;
  --sq-mid: rgba(90, 70, 55, 0.42);
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background-color: #fff;
  overflow: hidden;
  z-index: 1;
}

.stage-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  height: 42px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  position: relative;
  z-index: 4;
}

.stage-sheet {
  --line-top: 6%;
  --line-bottom: 96%;
  --line-x2: 26%;
  --line-x3: 74%;
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: #e4dcd0;
}

.sheet-field {
  position: absolute;
  z-index: 0;
  left: var(--line-x2);
  top: var(--line-top);
  width: calc(var(--line-x3) - var(--line-x2));
  height: calc(var(--line-bottom) - var(--line-top));
  background: #fff;
  pointer-events: none;
}

.letter-edit-stage.is-square-grid .sheet-field {
  --sq: oklch(from var(--bg) 0.84 0.028 h / 22%);
  background-color: #fff;
  background-image:
    linear-gradient(to right, transparent calc(50% - 0.5px), var(--sq-mid) calc(50% - 0.5px), var(--sq-mid) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--sq-mid) calc(50% - 0.5px), var(--sq-mid) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), var(--sq) calc(50% - 0.5px), var(--sq) calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to right, transparent calc(50% - 0.5px), var(--sq) calc(50% - 0.5px), var(--sq) calc(50% + 0.5px), transparent calc(50% + 0.5px));
  background-size: 100% 100%, 100% 100%, var(--grid-cell) var(--grid-cell), var(--grid-cell) var(--grid-cell);
  background-position: center, center, center, center;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
}

.inline-grid {
  --line-top: 6%;
  --line-mean: 31%;
  --line-base: 69%;
  --line-bottom: 96%;
  --line-x1: 11%;
  --line-x2: 26%;
  --line-x3: 74%;
  --line-x4: 89%;
  --ink-line: var(--sq-mid);
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-repeat: no-repeat;
  background-image:
    linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line)),
    linear-gradient(var(--ink-line), var(--ink-line));
  background-size:
    100% 1px,
    100% 1px,
    100% 1px,
    100% 1px,
    1px 100%,
    1px 100%;
  background-position:
    0 calc(var(--line-top) - 0.5px),
    0 calc(var(--line-mean) - 0.5px),
    0 calc(var(--line-base) - 0.5px),
    0 calc(var(--line-bottom) - 0.5px),
    calc(var(--line-x2) - 0.5px) 0,
    calc(var(--line-x3) - 0.5px) 0;
}

.inline-grid[hidden] {
  display: none;
}

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

.band-label {
  position: absolute;
  left: 0;
  width: 28px;
  display: grid;
  place-items: center;
  pointer-events: auto;
  cursor: default;
}

.band-label::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1600px;
  background: rgba(217, 126, 99, 0.13);
  opacity: 0;
  pointer-events: none;
}

.band-label:hover::before {
  opacity: 1;
}

.band-name {
  writing-mode: vertical-rl;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.band-label:hover .band-name {
  color: var(--ink);
}

.band-ascender {
  top: var(--line-top);
  height: calc(var(--line-mean) - var(--line-top));
}

.band-body {
  top: var(--line-mean);
  height: calc(var(--line-base) - var(--line-mean));
}

.band-descender {
  top: var(--line-base);
  height: calc(var(--line-bottom) - var(--line-base));
}

.band-preview {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: flex-end;
  gap: 4px;
  padding: 4px 10px 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(40, 24, 16, 0.12);
  pointer-events: none;
}

.band-label:hover .band-preview {
  display: flex;
}

.part-letter {
  position: relative;
  display: block;
  font-family: var(--display);
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  color: rgba(44, 37, 35, 0.22);
}

.part-letter::after {
  content: attr(data-char);
  position: absolute;
  left: 0;
  top: 0;
  color: var(--cinnabar);
}

.band-ascender .part-letter::after {
  clip-path: inset(0 0 77% 0);
}

.band-descender .part-letter::after {
  clip-path: inset(77% 0 0 0);
}

#letter-edit-canvas {
  display: block;
  position: relative;
  z-index: 2;
  width: 100%;
  height: 440px;
  touch-action: none;
  cursor: crosshair;
  clip-path: inset(var(--line-top) calc(100% - var(--line-x3)) calc(100% - var(--line-bottom)) var(--line-x2));
}

.upload-only {
  max-width: 640px;
}

.slots-panel {
  margin-top: 0;
  display: flex;
  flex-direction: column;
}

.slots-panel #letter-slots {
  flex: 1 1 auto;
}

.slots-panel #seal-status {
  margin: 8px 0 0;
}

.slots-panel #seal-status:empty {
  display: none;
}

.slots-panel .seal-row {
  margin-top: auto;
  justify-content: flex-end;
}

.seal-row #btn-save-letters {
  margin: 0;
  padding-left: 36px;
  padding-right: 36px;
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  background: var(--panel);
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.entries-latin {
  display: flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
  cursor: pointer;
}

.entries-latin input {
  appearance: none;
  width: 36px;
  height: 22px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
}

.entries-latin input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.entries-latin input:checked {
  background: var(--accent);
}

.entries-latin input:checked::after {
  transform: translateX(14px);
}

.entries-latin input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.entry-list button {
  width: 100%;
  text-align: left;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}

.entry-list button.active {
  border-color: var(--accent);
}

.entry-title-script {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1px;
  min-width: 0;
  overflow: hidden;
  line-height: 1.2;
}

.entry-title-script.is-latin {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-title-script img {
  height: 1.2em;
  width: auto;
  max-width: 1.6em;
  object-fit: contain;
  filter: brightness(0) invert(28%) sepia(48%) saturate(1400%) hue-rotate(346deg) brightness(0.92);
}

.entry-list small {
  display: block;
  color: var(--muted);
  margin-top: 0;
}

.entry-search {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 0 0 14px;
  position: relative;
  z-index: 2;
}

.entry-search-pick {
  position: relative;
  flex: 0 0 auto;
}

.entry-search-mode {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 0 10px 10px 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.entry-search-mode:hover,
.entry-search-pick.is-open .entry-search-mode {
  border-color: var(--accent-2);
}

.entry-search-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 8;
  width: 100%;
  min-width: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(40, 24, 16, 0.1);
}

.entry-search-menu button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
}

.entry-search-menu button:hover,
.entry-search-menu button[aria-selected="true"] {
  background: rgba(148, 69, 44, 0.12);
}

.entry-search input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 42px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
}

.entry-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.entry-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--oatmeal);
  color: var(--ink);
  font-size: 0.75rem;
  line-height: 1.4;
}

.journal-tags {
  margin-top: 4px;
}

.tag-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.tag-editor:focus-within {
  outline: 2px solid rgba(148, 69, 44, 0.4);
  outline-offset: 1px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.tag-list:empty {
  display: none;
}

.tag-list li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--oatmeal);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.2;
}

.tag-remove {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0 4px;
  font: inherit;
  line-height: 1;
}

.field .tag-input {
  flex: 1 1 140px;
  min-width: 140px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 6px 4px;
  outline: none;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field > span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.field input:not(.glyph-composer-src),
.field textarea:not(.glyph-composer-src) {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  resize: vertical;
}

.field input:not(.glyph-composer-src):focus,
.field textarea:not(.glyph-composer-src):focus,
.pen-btn:focus-visible {
  outline: 2px solid rgba(148, 69, 44, 0.45);
  outline-offset: 1px;
}

.field textarea:not(.glyph-composer-src) {
  font-size: 1.02rem;
  line-height: 1.55;
}

.composer-shell {
  background: transparent;
  border: 0;
  border-radius: 0;
}

.composer-shell:focus-within {
  outline: none;
}

.composer-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: #faf6f1;
  border-radius: 10px;
  margin-bottom: 22px;
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.composer-menu svg {
  stroke-width: 1.05;
}

.composer-tool svg {
  width: 22px;
  height: 22px;
}

.composer-tool svg.icon-numbers {
  width: 28px;
  height: 28px;
}

.composer-tool:hover,
.composer-pick.is-open .composer-tool {
  border-color: var(--accent-2);
  color: var(--accent);
}

.composer-pick-btn.composer-tool {
  max-width: none;
  padding: 0;
}

.composer-pick {
  position: relative;
}

.composer-pick-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  max-width: 220px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.composer-pick-btn:hover,
.composer-pick.is-open .composer-pick-btn {
  border-color: var(--accent-2);
}

.composer-pick-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-pick-caret {
  width: 10px;
  height: 7px;
  flex: 0 0 auto;
}

.composer-pick-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 8;
  min-width: 100%;
  max-height: 240px;
  overflow: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(40, 24, 16, 0.1);
}

.composer-pick-list button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 400;
  text-align: left;
  cursor: pointer;
}

.composer-pick-list button:hover,
.composer-pick-list button[aria-selected="true"] {
  background: #fff8f5;
  color: var(--accent);
}

.paper-swatch {
  display: block;
  width: 16px;
  height: 22px;
  border-radius: 1px;
  background-color: #f7f5f2;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(40, 24, 16, 0.22);
}

#journal-paper-menu {
  display: flex;
  gap: 6px;
  min-width: max-content;
  padding: 8px;
}

#journal-paper-menu button,
#journal-paper-menu button:hover,
#journal-paper-menu button[aria-selected="true"] {
  width: 28px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background-color: transparent;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(40, 24, 16, 0.2);
}

#journal-paper-menu button[aria-selected="true"] {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.journal-color-swatch {
  display: block;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #94452c;
  box-shadow: inset 0 0 0 1px rgba(40, 24, 16, 0.25);
}

#journal-color-menu {
  min-width: 228px;
  padding: 8px;
  overflow: visible;
}

.journal-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#journal-color-picker {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

#journal-color-code {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
}

#journal-size-menu,
#journal-align-menu,
#journal-leading-menu,
#journal-tracking-menu {
  left: 50%;
  transform: translateX(-50%);
}

#journal-size-menu button,
#journal-align-menu button,
#journal-leading-menu button,
#journal-tracking-menu button {
  text-align: center;
}

.glyph-composer {
  position: relative;
  min-height: 280px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.journal-layout .field:has(#title-label) {
  display: none;
}

.composer-shell .glyph-composer {
  width: 100%;
  aspect-ratio: 210 / 297;
  margin: 0;
  min-height: 0;
  border: 0;
  border-radius: 1px;
  overflow: auto;
  box-shadow:
    0 1px 2px rgba(40, 24, 16, 0.08),
    0 16px 36px rgba(40, 24, 16, 0.16);
  background-color: #f7f5f2;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
}

.composer-shell .glyph-composer-face {
  min-height: 100%;
  padding: 9% 10% 12%;
  box-sizing: border-box;
}

.journal-layout.is-latin .composer-shell .glyph-composer-src {
  min-height: 100%;
  height: auto;
  padding: 9% 10% 12%;
  box-sizing: border-box;
  background: transparent;
}

#entry-composer[data-ink="light"] .glyph-composer-face .glyph.is-upper img,
#entry-composer[data-ink="light"] .glyph-composer-face .glyph.is-lower img {
  filter: brightness(0) invert(1);
}

.journal-layout.is-latin #entry-composer[data-ink="light"] .glyph-composer-src {
  color: #f4f1ea;
}

#entry-composer[data-color="custom"] .glyph-composer-face .glyph img,
#entry-composer[data-color="custom"] .glyph-composer-face .glyph.is-upper img,
#entry-composer[data-color="custom"] .glyph-composer-face .glyph.is-lower img {
  filter: var(--journal-ink-filter);
}

#entry-composer[data-color="custom"] .glyph-composer-face,
#entry-composer[data-color="custom"] .list-mark {
  color: var(--journal-ink);
}

.journal-layout.is-latin #entry-composer[data-color="custom"] .glyph-composer-src {
  color: var(--journal-ink);
}

.glyph-composer-title {
  min-height: 0;
}

.glyph-composer-title .glyph-composer-face {
  min-height: calc(1.35em + 16px);
  padding: 8px 14px;
  text-align: left;
}

.glyph-composer:focus-within {
  outline: 2px solid rgba(148, 69, 44, 0.4);
  outline-offset: 1px;
}

.composer-shell .glyph-composer:focus-within {
  outline: none;
}

.glyph-composer-src {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  pointer-events: none;
}

.journal-layout.is-latin .glyph-composer-face {
  display: none;
}

.journal-layout.is-latin .glyph-composer-src {
  position: static;
  width: 100%;
  height: 100%;
  min-height: inherit;
  opacity: 1;
  overflow: auto;
  pointer-events: auto;
  background: transparent;
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  letter-spacing: calc((var(--journal-tracking, 0.5) - 0.5) * 0.22em);
  padding: 14px 16px;
  resize: none;
}

.journal-layout.is-latin .glyph-composer-title .glyph-composer-src {
  min-height: calc(1.35em + 16px);
  height: auto;
  padding: 8px 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: calc(1.15em + (var(--journal-leading, 1) - 0.5) * 0.4em);
}

.btn-ghost[aria-pressed="true"] {
  border-color: var(--accent-2);
  color: var(--accent);
  background: #fff8f5;
}

.glyph-composer-face {
  min-height: 280px;
  padding: 10px 16px 28px;
  display: block;
  line-height: 2.4em;
  cursor: text;
  overflow: visible;
  user-select: none;
}

.glyph-composer-title .glyph-composer-face {
  min-height: calc(1.35em + 16px);
  padding: 8px 14px;
  line-height: 1;
}

.glyph-composer-face .word {
  display: inline;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  margin: 0;
}

.glyph-composer-face .break {
  display: block;
  height: 2.4em;
}

.glyph-composer-title .glyph-composer-face .break {
  height: calc((var(--journal-leading, 1) - 0.5) * 0.4em);
}

.glyph-composer-face .glyph {
  display: inline-block;
  position: relative;
  width: auto;
  height: 1.42em;
  vertical-align: baseline;
  overflow: visible;
}

.glyph-composer-face .glyph.is-lower {
  height: 0.96em;
}

.glyph-composer-face .glyph img {
  display: block;
  width: auto;
  max-width: 1.7em;
  object-fit: contain;
  pointer-events: none;
  filter: brightness(0) invert(28%) sepia(48%) saturate(1400%) hue-rotate(346deg) brightness(0.92);
}

.glyph-composer-face .is-selected {
  background: rgba(148, 69, 44, 0.22);
  border-radius: 3px;
}

.glyph-composer-face .glyph.is-upper img {
  height: 1.42em;
  object-position: bottom center;
}

.glyph-composer-face .glyph.is-lower img {
  height: 0.96em;
  object-position: bottom center;
}

.glyph-composer-title .glyph-composer-face .glyph,
.glyph-composer-title .glyph-composer-face .glyph-caret,
.glyph-composer-title .glyph-composer-face .glyph-space {
  vertical-align: middle;
}

.glyph-composer-title .glyph-composer-face .glyph {
  height: 1.24em;
}

.glyph-composer-title .glyph-composer-face .glyph.is-lower {
  height: 0.84em;
}

.glyph-composer-title .glyph-composer-face .glyph.is-upper img {
  height: 1.24em;
}

.glyph-composer-title .glyph-composer-face .glyph.is-lower img {
  height: 0.84em;
  object-position: bottom center;
}

.glyph-space {
  display: inline-block;
  width: 0.42em;
  min-width: 18px;
  height: 1em;
  vertical-align: baseline;
}

.glyph-caret {
  display: inline-block;
  width: 2px;
  height: 1.35em;
  margin: 0 1px;
  vertical-align: baseline;
  background: var(--accent);
  border-radius: 1px;
  animation: glyph-caret 1s step-end infinite;
}

@keyframes glyph-caret {
  50% {
    opacity: 0;
  }
}

.composer-placeholder {
  margin: 0;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.pillars {
  padding: 24px 2.5rem 64px;
  background: var(--paper);
}

.pillars-intro {
  margin: 0 0 28px;
  text-align: center;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-kicker-sage {
  color: var(--sage);
}

.pillars h2 {
  margin: 0;
  max-width: none;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

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

.pillar-card {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 4;
  justify-items: center;
  align-content: start;
  text-align: center;
  padding: 24px;
  border-radius: 20px;
  background: var(--alabaster);
  box-shadow: 0 1px 8px rgba(67, 59, 56, 0.05);
}

.pillar-card-alt {
  background: var(--oatmeal);
}

.pillar-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--paper);
  color: var(--accent);
  font-size: 26px;
}

.pillar-index {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pillar-card h3 {
  margin: 0;
}

.pillar-card p {
  margin: 0;
  color: #433b38;
}

.process-intro-center {
  grid-template-columns: 1fr;
  text-align: center;
  justify-items: center;
}

.process-foot-center {
  margin-top: 40px;
  text-align: center;
}

.process-foot-center h3 {
  margin: 0 0 16px;
}

.process-foot-center .btn {
  display: inline-flex;
}

.cipher-block {
  margin-top: 36px;
  overflow-x: clip;
}

.cipher-photo-stage {
  position: relative;
  width: min(100%, 750px);
  margin: 0 auto 12px;
}

.cipher-bg,
.seal-bg {
  --spin: 0deg;
  position: absolute;
  left: 50%;
  top: 50%;
  width: 118%;
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--spin));
  pointer-events: none;
  z-index: 0;
}

.cipher-bg-b,
.seal-bg-b {
  width: 132%;
}

.cipher-photo {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

.cipher-block .process-foot-center {
  margin-top: 0;
}

.process > .cipher-demo {
  margin-top: 0;
  margin-bottom: 36px;
}

.process > .seal-row {
  padding-right: 0;
  padding-left: 0;
  background: transparent;
}

.home-guest > .cipher-block {
  padding: 8px 2.5rem 64px;
}

.cipher-demo {
  margin-top: 36px;
  padding: 24px;
  border-radius: 20px;
  background: #e4cfc0;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: center;
}

.cipher-demo h3 {
  margin: 0 0 8px;
}

.cipher-demo p {
  margin: 0;
  color: #433b38;
}

.cipher-demo-fields {
  display: grid;
  gap: 10px;
}

.cipher-demo input {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--paper);
  box-shadow: 0 1px 6px rgba(67, 59, 56, 0.06);
}

.cipher-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(250, 246, 238, 0.9);
}

.cipher-ribbon > p {
  flex: 0 0 auto;
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

#asemic-output-ribbon {
  display: block;
  min-width: 0;
  text-align: right;
  color: var(--accent);
  font-family: "Dochet Script", var(--display);
  font-size: 1.45rem;
  font-style: normal;
  line-height: 1.35;
  letter-spacing: 0.02em;
  word-break: break-word;
}

#asemic-output-ribbon img {
  width: auto;
  height: 22px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

#asemic-output-ribbon.is-mapped {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.cipher-space {
  width: 0.45em;
  min-width: 16px;
  display: inline-block;
}

.atelier-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.atelier-path .material-symbols-outlined {
  font-size: 18px;
  color: var(--accent);
}

.atelier-flow {
  text-transform: none;
  letter-spacing: 0;
  color: var(--accent);
  font-family: var(--display);
  font-style: italic;
}

.path-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f8ebe5;
}

.path-chip {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

#alphabet-map .glyph-swap,
#alphabet-map .glyph-make-archetypes,
#alphabet-map #glyph-make-extract {
  display: none;
}

#alphabet-map.is-make-draw .glyph-swap {
  display: flex;
}

#alphabet-map.is-make-extract #glyph-make-extract,
#alphabet-map.is-make-archetypes .glyph-make-archetypes {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}

.path-chip .path-lock {
  font-size: 14px;
  display: none;
}

.path-chip.is-locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.path-chip.is-locked .path-lock {
  display: inline-block;
}

.path-chip.is-current {
  background: var(--accent);
  color: var(--accent-ink);
}

#step-lock-hint {
  min-height: 1.2em;
  margin: 4px 0 0;
}

.ref-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.ref-seed-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--alabaster);
  color: var(--muted);
  font-size: 0.85rem;
}

.ref-seed-count strong {
  color: var(--accent);
}

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}

.icon-btn .material-symbols-outlined {
  font-size: 18px;
}

.studio-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 0.8rem;
  color: var(--muted);
}

.step-now {
  color: var(--ink);
  font-weight: 600;
}

.step-next {
  color: var(--accent);
}

.memory-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.9fr);
  gap: 18px;
  align-items: stretch;
}

.memory-layout.key-collapsed {
  grid-template-columns: minmax(0, 1fr);
}

.memory-layout > .panel {
  height: 100%;
}

.match-key {
  min-height: 100%;
}

.match-key-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 12px;
}

.match-key-pair {
  display: flex;
  align-items: center;
  gap: 6px;
}

.match-key .match-latin {
  cursor: default;
}

.fluency-card {
  min-width: 240px;
  padding: 14px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 1px 8px rgba(67, 59, 56, 0.05);
}

.fluency-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.fluency-bar {
  margin: 10px 0 6px;
  height: 8px;
  border-radius: 999px;
  background: #f3e6e0;
  overflow: hidden;
}

#fluency-fill {
  height: 100%;
  width: 0;
  background: var(--accent-2);
  border-radius: inherit;
}

.workshop-head .fluency-card {
  max-width: 320px;
  margin-top: 8px;
}

.match-board {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 140px;
  justify-content: start;
  align-items: start;
  margin: 20px 0;
}

.match-target-pair {
  display: grid;
  grid-template-columns: max-content max-content;
  column-gap: 6px;
}

.match-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.match-slot.is-over {
  border-color: var(--accent);
  background: rgba(148, 69, 44, 0.1);
}

.match-tile,
.match-slot {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.match-latin {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: grab;
}

.match-latin.is-dragging {
  opacity: 0.4;
}

.match-slot {
  border-style: dashed;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
}

.match-slot.is-filled {
  border-style: solid;
  background: rgba(148, 69, 44, 0.08);
}

.match-glyph img {
  width: auto;
  height: 26px;
  object-fit: contain;
  filter: brightness(0);
}

.draw-prompt {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.draw-prompt strong {
  font-size: 1.8rem;
}

.recall-word {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  min-height: 80px;
  margin: 8px 0 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--paper);
}

.recall-word img {
  width: auto;
  height: 42px;
  object-fit: contain;
  filter: brightness(0);
}

.flashcard {
  width: 100%;
  min-height: 260px;
  border: 0;
  border-radius: 16px;
  background: #fdfbf7;
  cursor: pointer;
  box-shadow: 0 1px 8px rgba(67, 59, 56, 0.05);
  padding: 28px 20px;
}

.flash-latin {
  display: block;
  font-family: var(--display);
  font-size: 3.4rem;
  font-weight: 600;
  color: var(--ink);
}

.flash-hint {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.85rem;
}

#card-glyph {
  width: 96px;
  height: 96px;
  margin: 0 auto;
  object-fit: contain;
}

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

.roster-tile {
  position: relative;
  min-height: 64px;
  border: 0;
  border-radius: 10px;
  background: var(--alabaster);
  cursor: pointer;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.roster-tile span {
  align-self: flex-start;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--muted);
}

.roster-tile img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.roster-tile.is-current {
  background: #ffdbd0;
  outline: 2px solid var(--accent);
}

.roster-tile.is-empty {
  opacity: 0.45;
  cursor: not-allowed;
}

.roster-tile.is-mastered span {
  color: var(--sage);
}

.trace-wrap {
  position: relative;
  height: 200px;
  border-radius: 14px;
  background: #fdfbf7;
  overflow: hidden;
}

#strokeCanvas {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.ghost-guide {
  position: absolute;
  inset: 20%;
  width: 60%;
  height: 60%;
  object-fit: contain;
  opacity: 0.18;
  pointer-events: none;
}

.blindfold-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.blindfold-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.88rem;
}

.journal-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.journal-layout .glyph-composer-face,
.journal-layout.is-latin .glyph-composer-src {
  font-size: var(--journal-em, 16px);
}

.journal-layout .glyph-composer-face .glyph {
  margin-right: calc((var(--journal-tracking, 0.5) - 0.5) * 0.42em);
}

#entry-composer .glyph-composer-face {
  line-height: 1;
  text-align: var(--journal-align, left);
}

.journal-layout.is-latin #entry-body {
  line-height: calc(1.15em + (var(--journal-leading, 1) - 0.5) * 0.4em);
  text-align: var(--journal-align, left);
}

#entry-composer .glyph-composer-face .break {
  height: calc((var(--journal-leading, 1) - 0.5) * 0.4em);
}

#entry-composer .script-line,
.glyph-composer-title .script-line {
  line-height: 1;
}

.script-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  max-width: 100%;
  white-space: normal;
}

#entry-composer {
  --glyph-rise: 1.56em;
  --glyph-drop: calc(var(--glyph-rise) * 112 / 280);
}

#entry-composer .script-line {
  align-items: flex-end;
  justify-content: var(--journal-align, left);
  padding-bottom: var(--glyph-drop);
}

#entry-composer .glyph-composer-face .glyph,
#entry-composer .glyph-composer-face .glyph.is-lower {
  height: var(--glyph-rise);
}

#entry-composer .glyph-composer-face .glyph.is-upper img,
#entry-composer .glyph-composer-face .glyph.is-lower img {
  height: var(--glyph-rise);
  object-position: bottom center;
  transform: translateY(calc(var(--glyph-hang, 0) * var(--glyph-drop)));
}

.glyph-composer-title {
  --glyph-rise: 1.24em;
  --glyph-drop: calc(var(--glyph-rise) * 112 / 280);
}

.glyph-composer-title .script-line {
  align-items: flex-end;
  padding-bottom: var(--glyph-drop);
}

.glyph-composer-title .glyph-composer-face .glyph,
.glyph-composer-title .glyph-composer-face .glyph.is-lower,
.glyph-composer-title .glyph-composer-face .glyph-caret,
.glyph-composer-title .glyph-composer-face .glyph-space {
  vertical-align: baseline;
}

.glyph-composer-title .glyph-composer-face .glyph,
.glyph-composer-title .glyph-composer-face .glyph.is-lower {
  height: var(--glyph-rise);
}

.glyph-composer-title .glyph-composer-face .glyph.is-upper img,
.glyph-composer-title .glyph-composer-face .glyph.is-lower img {
  height: var(--glyph-rise);
  object-position: bottom center;
  transform: translateY(calc(var(--glyph-hang, 0) * var(--glyph-drop)));
}

.list-mark {
  display: inline-flex;
  align-items: center;
  margin-right: 0.35em;
  color: var(--text);
  font-size: 0.9em;
  line-height: 1;
  white-space: nowrap;
}

.list-mark-check {
  cursor: pointer;
}

.script-line.is-checked {
  opacity: 0.45;
}

.journal-layout .glyph-composer-face {
  color: var(--accent);
}

.sage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sage);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 2.5rem 40px;
  background: var(--paper);
  box-shadow: 0 -1px 12px rgba(67, 59, 56, 0.03);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.footer-brand strong {
  color: var(--ink);
  font-family: var(--display);
  font-weight: 500;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.footer-links a {
  text-decoration: none;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-links a[hidden] {
  display: none;
}

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.stories-page {
  padding-top: 28px;
  padding-bottom: 88px;
}

.stories-head {
  margin: 0 0 22px;
}

.stories-head h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  letter-spacing: -0.03em;
  line-height: 1.5;
  color: var(--text);
}

.story-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(220px, 0.92fr);
  align-items: stretch;
  margin: 0 0 40px;
  overflow: hidden;
  border: 1px solid #e7ddd0;
  border-radius: 18px;
  background: #fffdfb;
}

.story-feature-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 32px 26px;
}

.story-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 12px;
  border-radius: 999px;
  background: #f6ebe4;
  color: #c17b64;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
}

.story-feature-copy h2 {
  margin: 16px 0 12px;
  max-width: 14em;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  letter-spacing: -0.03em;
  line-height: 1.5;
  color: var(--text);
}

.story-feature-copy p {
  margin: 0 0 18px;
  max-width: 34rem;
  color: #6e6560;
  font-size: 0.98rem;
  line-height: 1.55;
}

.story-read {
  color: #b4533a;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.story-read:hover {
  color: var(--accent);
}

.story-feature-media {
  position: relative;
  min-height: 260px;
  background: #e8c4b0;
}

.story-feature-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% center;
}

.story-feature-marks img {
  object-position: center;
}

.stories-more h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  color: #2c241f;
}

.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.story-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px 32px;
  align-items: center;
  padding: 16px 2px;
  border-top: 1px solid #eadfd2;
}

.story-row:last-child {
  border-bottom: 1px solid #eadfd2;
}

.story-row h3 {
  margin: 0 0 2px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  letter-spacing: -0.03em;
  line-height: 1.5;
  color: var(--text);
}

.story-row p {
  margin: 0;
  color: #6e6560;
  font-size: 0.94rem;
  line-height: 1.45;
}

.story-row .story-tag,
.story-row .story-read {
  justify-self: end;
}

.story-row .story-read {
  white-space: nowrap;
}

.story-article {
  max-width: 40rem;
  padding-bottom: 12px;
}

.story-back {
  display: inline-block;
  margin-bottom: 22px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.story-back:hover {
  text-decoration: underline;
}

.story-article h1 {
  margin: 8px 0 18px;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  letter-spacing: -0.03em;
  line-height: 1.5;
  color: var(--text);
}

.story-article .story-tag {
  display: flex;
  width: max-content;
  margin-bottom: 14px;
}

.story-article .story-lede {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.22rem;
  line-height: 1.45;
  color: var(--accent);
}

.story-figure {
  width: 100%;
  height: auto;
  margin: 8px 0 28px;
  border-radius: 16px;
}

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

.story-examples img {
  width: 100%;
  height: 112px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.story-article p {
  margin: 0 0 14px;
  color: #4e4642;
  font-size: 1.02rem;
  line-height: 1.65;
}

.story-article h2 {
  margin: 30px 0 12px;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: #2c241f;
}

.story-bullets {
  list-style: disc;
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.story-bullets li {
  display: list-item;
  margin: 0 0 8px;
  color: #4e4642;
  font-size: 1.02rem;
  line-height: 1.55;
}

.story-bullets li:last-child {
  margin-bottom: 0;
}

.story-points {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.story-points li {
  margin: 0;
  padding: 11px 0;
  border-top: 1px solid #eadfd2;
  color: #4e4642;
  font-size: 1.02rem;
  line-height: 1.5;
}

.story-points li:last-child {
  border-bottom: 1px solid #eadfd2;
}

.story-points strong {
  font-weight: 600;
  color: #2c241f;
}

@media (max-width: 900px) {
  body.is-signed-in .site-nav {
    flex-wrap: wrap;
    height: auto;
    min-height: 64px;
    row-gap: 8px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  body.is-signed-in .site-nav nav {
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .hero,
  .process-intro,
  .page-head,
  .contact-page,
  .make-split,
  .choice-grid,
  .alphabet-layout {
    padding-left: 0;
    grid-template-columns: 1fr;
  }

  .steps li {
    padding: 16px 18px;
  }

  .library-stack {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  #glyph-source-pane .hoard {
    max-height: 480px;
  }

  .journal-layout,
  .memory-layout,
  .pillar-grid,
  .cipher-demo,
  .seal-row,
  .draw-layout {
    grid-template-columns: 1fr;
  }

  .pillar-card {
    display: flex;
    flex-direction: column;
    grid-row: auto;
    align-items: center;
    text-align: center;
    gap: 10px;
  }

  .station-inner,
  .site-nav,
  .glyph-banner,
  .process,
  .pillars,
  section.seal-row,
  .home-stories,
  .home-contact,
  .page,
  .site-footer {
    padding-left: 5vw;
    padding-right: 5vw;
  }

  .hero h1 {
    font-size: 38px;
    max-width: none;
  }

  .codex-stage {
    --stage-pad-x: 20px;
    --stage-pad-t: 36px;
    --stage-pad-b: 24px;
    min-height: 240px;
    padding: var(--stage-pad-t) var(--stage-pad-x) var(--stage-pad-b);
  }

  .codex-page {
    padding: 28px 20px;
  }

  .codex-verse {
    font-size: 22px;
  }

  .memory-roster {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .match-board {
    column-gap: 48px;
  }

  .match-key-list {
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  }

  .story-feature {
    grid-template-columns: 1fr;
  }

  .home-story-list {
    grid-template-columns: 1fr;
  }

  .story-feature-copy {
    padding: 22px 20px 20px;
  }

  .story-feature-copy h2 {
    max-width: none;
  }

  .story-feature-media {
    min-height: 220px;
    order: 2;
  }

  .story-row {
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
  }

  .story-row-copy {
    grid-column: 1 / -1;
  }

  .story-row .story-tag {
    justify-self: start;
  }
}

body:not(.is-signed-in) #home-studio {
  display: none;
}

body.is-signed-in #home-guest {
  display: none;
}

.journal-unlock {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 118px 24px 24px;
  background: rgba(255, 248, 245, 0.28);
  backdrop-filter: blur(8px);
}

.journal-unlock[hidden] {
  display: none;
}

body.is-journal-locked .site-nav,
body.is-journal-locked.entries-open .site-nav {
  z-index: 80;
}

.journal-unlock-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow);
}

.journal-unlock-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
}

.journal-unlock-card .hint {
  margin: 0;
  white-space: pre-line;
}

.journal-unlock-card > .btn-primary {
  align-self: flex-end;
  margin-top: 5px;
  margin-bottom: 0;
}

.journal-unlock-card .status:empty {
  display: none;
}

.glyph-notice {
  position: fixed;
  z-index: 70;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100% - 48px));
  margin: 0;
  padding: 22px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-family: var(--display);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
}

.glyph-notice[hidden] {
  display: none;
}

.journal-unlock input {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

.recovery-code {
  font-family: ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: 0.08em;
  font-size: 1.05rem;
  user-select: all;
  margin: 0;
}

