@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/fraunces-400.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/fraunces-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/fraunces-600.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/outfit-400.woff2") format("woff2");
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/outfit-500.woff2") format("woff2");
}

:root {
  --paper: #f7f1e8;
  --sand: #f0e2d0;
  --sand-deep: #e7d3bb;
  --card: #fffaf4;
  --ink: #1c2c29;
  --moss: #24584c;
  --moss-deep: #1b3c36;
  --clay: #8c4530;
  --header: #fbf6ee;
  --line: rgba(28, 44, 41, 0.14);
  --soft: #5e6763;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(820px 460px at 100% -10%, var(--sand) 0%, transparent 62%),
    var(--paper);
  font-family: "Outfit", "Noto Sans", sans-serif;
  font-weight: 400;
  line-height: 1.5;
}

.bar {
  width: min(1080px, calc(100% - 3rem));
  margin: 0 auto;
}

.stage {
  width: min(1080px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 3.25rem 0 4.5rem;
  flex: 1;
}

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header);
  border-bottom: 1px solid rgba(28, 44, 41, 0.08);
}

.top .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4.6rem;
}

.bar-end {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.7rem 0.85rem;
  margin-left: auto;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.nav-link .short {
  display: none;
}

.account-menu {
  position: relative;
}

.avatar {
  width: 2.45rem;
  height: 2.45rem;
  border: 0;
  border-radius: 999px;
  background: var(--moss-deep);
  color: #f6f1e8;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.16s ease;
}

.avatar:hover {
  background: var(--clay);
}

.menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 5;
  min-width: 11.5rem;
  padding: 0.35rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.12);
  border-radius: 0.85rem;
  box-shadow: 0 14px 32px rgba(28, 44, 41, 0.12);
}

.menu-item {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0.6rem;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
}

.menu-item:hover {
  background: var(--sand);
  color: var(--clay);
}

.letter.letters-board {
  width: 100%;
}

.stage:has(.letters-board.is-empty) {
  display: flex;
  flex-direction: column;
}

.letters-board.is-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.letters-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  text-align: center;
  padding: 2.5rem 1rem 1rem;
}

.letters-empty img {
  width: 4.4rem;
  height: auto;
}

.letters-empty p {
  margin: 0;
  max-width: 14em;
  font-family: "Fraunces", "Iowan Old Style", Palatino, serif;
  font-size: clamp(1.7rem, 3.4vw, 2.35rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--ink);
}

.letters-empty .submit {
  width: fit-content;
  margin-top: 0.35rem;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
}

.letters-title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: none;
}

.letter-total {
  font-family: "Outfit", "Noto Sans", sans-serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  color: var(--clay);
  background: var(--sand);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1.05rem;
}

.when-block {
  margin-top: 1.15rem;
}

.when-block h2 {
  margin: 0;
  color: var(--clay);
  font-family: "Outfit", "Noto Sans", sans-serif;
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
}

.when-filters {
  margin-top: 0.55rem;
}

.info {
  position: relative;
  display: inline-flex;
}

.info-button {
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  border: 1px solid rgba(28, 44, 41, 0.2);
  border-radius: 999px;
  background: #fff;
  color: var(--moss-deep);
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-style: italic;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
}

.info-button:hover,
.info-button[aria-expanded="true"] {
  color: #f6f1e8;
  background: var(--moss);
  border-color: var(--moss);
}

.info-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 6;
  width: min(17.5rem, 72vw);
  margin: 0;
  padding: 0.7rem 0.8rem 0.75rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(28, 44, 41, 0.14);
  font-size: 0.84rem;
  line-height: 1.4;
}

.info-panel p {
  margin: 0;
  color: var(--soft);
}

.info-panel ul {
  margin: 0.7rem 0 0;
  padding: 0;
  list-style: none;
}

.info-panel li + li {
  margin-top: 0.35rem;
}

.info-panel strong {
  color: var(--ink);
  font-weight: 500;
}

.filters a,
.filters .filter-current,
.filters .filter-disabled {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2.15rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none;
}

.filters .filter-disabled {
  color: rgba(28, 44, 41, 0.38);
  background: transparent;
  border: 1px solid rgba(28, 44, 41, 0.1);
}

.filters a {
  color: var(--moss-deep);
  background: #fff;
  border: 1px solid rgba(28, 44, 41, 0.16);
}

.filters a:hover {
  color: #f6f1e8;
  background: var(--moss);
  border-color: var(--moss);
}

.filters .filter-current {
  color: #f6f1e8;
  background: var(--moss-deep);
}

.filters img {
  width: 1.15rem;
  height: 1.15rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 1rem;
}

.pager a,
.pager-edge,
.pager-current,
.pager-gap {
  min-width: 2.2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  font-weight: 500;
}

.pager a {
  color: var(--moss-deep);
  background: #fff;
  border: 1px solid rgba(28, 44, 41, 0.16);
}

.pager a:hover {
  color: #f6f1e8;
  background: var(--moss);
  border-color: var(--moss);
}

.pager-current {
  color: #f6f1e8;
  background: var(--moss-deep);
}

.pager-edge,
.pager-gap {
  color: var(--soft);
}

.letter-table {
  margin-top: 1.5rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.95rem;
  overflow: hidden;
}

.letters-miss {
  margin: 2.75rem 0 0;
  padding: 2.4rem 1.5rem;
  text-align: center;
  color: var(--ink);
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.95rem;
  font-family: "Fraunces", "Iowan Old Style", Palatino, serif;
  font-size: clamp(1.55rem, 2.8vw, 2rem);
  font-weight: 400;
  line-height: 1.35;
}

.letter-search {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1.15rem;
}

.letter-search label {
  color: var(--clay);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.search-field {
  position: relative;
}

.search-hint {
  margin: 0;
  color: var(--soft);
  font-size: 0.88rem;
}

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

.letter-search input {
  width: 100%;
  padding: 0.75rem 2.6rem 0.75rem 0.9rem;
  border: 1px solid rgba(28, 44, 41, 0.16);
  border-radius: 0.8rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}

.letter-search input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--clay);
  cursor: pointer;
}

.search-clear[hidden] {
  display: none;
}

.search-clear svg {
  width: 1rem;
  height: 1rem;
}

.search-clear:hover {
  background: var(--sand);
  color: var(--ink);
}

.letter-search input:focus {
  outline: 2px solid rgba(36, 88, 76, 0.35);
  border-color: var(--moss);
}

.letters-board.is-searching > .filters,
.letters-board.is-searching > .when-block {
  opacity: 0.4;
  pointer-events: none;
}

#letter-results.is-loading {
  opacity: 0.55;
}

.letter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(12rem, 1fr) minmax(12rem, 1fr) minmax(6.5rem, 0.8fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.75rem 0.85rem 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid rgba(28, 44, 41, 0.08);
}

.letter-link {
  grid-column: 1 / 5;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.letter-row.head {
  border-top: 0;
  background: var(--sand);
  color: var(--clay);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sort-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  color: inherit;
  text-decoration: none;
}

.sort-link .arrow {
  letter-spacing: 0;
  opacity: 0.4;
}

.sort-link.active .arrow {
  opacity: 1;
}

.sort-link:hover .arrow {
  opacity: 1;
}

.letter-row:not(.head):hover {
  background: #fff;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.05rem;
}

.share,
.trash {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--moss-deep);
  text-decoration: none;
  cursor: pointer;
}

.share svg,
.trash svg {
  width: 1.15rem;
  height: 1.15rem;
}

.share:hover {
  background: var(--sand);
  color: var(--moss);
}

.trash:hover {
  background: #f4e0d6;
  color: var(--clay);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(28, 44, 41, 0.46);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: min(26rem, 100%);
  padding: 1.55rem 1.45rem 1.35rem;
  background: var(--card);
  border-radius: 1.15rem;
  box-shadow: 0 22px 50px rgba(28, 44, 41, 0.2);
}

.modal-card h2 {
  margin: 0.25rem 0 0;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.modal-snippet {
  margin: 0.95rem 0 0;
  line-height: 1.45;
}

.modal-copy {
  margin: 0.45rem 0 0;
  color: var(--soft);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.35rem;
}

.modal-cancel,
.modal-discard {
  font: inherit;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.modal-cancel {
  color: var(--moss-deep);
  background: #fff;
  border: 1px solid rgba(28, 44, 41, 0.16);
}

.modal-cancel:hover {
  background: var(--sand);
}

.modal-discard {
  color: #f6f1e8;
  background: var(--clay);
  border: 0;
}

.modal-discard:hover {
  background: #6f3424;
}

.modal-card .loader {
  inset: 0;
  border-radius: 1.15rem;
}

.letter-row .snippet {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--ink);
}

.letter-row .snippet img {
  width: 1.85rem;
  height: 1.85rem;
  flex: none;
}

.mark-spacer {
  width: 1.85rem;
  flex: none;
}

.letter-row.head .snippet {
  color: inherit;
}

.letter-row.head > span:nth-child(4),
.letter-link > [data-label="Readable"] {
  justify-self: center;
  text-align: center;
}

.letter-row.head > span:last-child {
  width: 4.35rem;
}

.readable {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.eye-sep {
  color: var(--clay);
}

.eye {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  color: var(--moss-deep);
}

.eye.is-shut {
  color: var(--soft);
}

.letter-row span[data-label] {
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.nav-link {
  color: var(--moss-deep);
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(28, 44, 41, 0.16);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  white-space: nowrap;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.nav-link:hover {
  color: #f6f1e8;
  background: var(--moss);
  border-color: var(--moss);
}

.nav-link.primary {
  color: #f6f1e8;
  background: var(--moss-deep);
  border-color: var(--moss-deep);
}

.nav-link.primary:hover {
  background: var(--clay);
  border-color: var(--clay);
}

.auth {
  position: relative;
  width: min(26rem, 100%);
  margin: 0 auto;
}

.auth h1 {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.confirm-title {
  font-size: clamp(1.65rem, 5.4vw, 2.35rem);
  white-space: nowrap;
}

.auth-lead {
  margin: 0.8rem 0 0;
  color: var(--soft);
}

.form-error {
  margin: 1.25rem 0 0;
  padding: 0.8rem 0.95rem 0.85rem 0.9rem;
  color: #6a301c;
  background: #f8e6dc;
  border: 1px solid rgba(140, 69, 48, 0.28);
  border-left: 3px solid var(--clay);
  border-radius: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
}

.form-note {
  margin: 1rem 0 0;
  color: var(--moss);
}

.seal-plain {
  margin: 1.35rem 0 0;
  max-width: 36rem;
  color: var(--soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.public-letter .seal-plain,
.landing-points + .seal-plain {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.landing-points + .seal-plain {
  margin-top: 2.25rem;
}

.auth .form-note,
.account-panel .form-note {
  margin: 1.25rem 0 0;
  padding: 0.8rem 0.95rem 0.85rem 0.9rem;
  color: var(--moss-deep);
  background: #e7f0ec;
  border: 1px solid rgba(36, 88, 76, 0.28);
  border-left: 3px solid var(--moss);
  border-radius: 0.75rem;
  font-weight: 500;
  line-height: 1.45;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1.15rem;
  cursor: pointer;
}

.end-day {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.85rem;
}

.end-day[hidden] {
  display: none;
}

.end-day .check {
  margin-top: 0;
}

.end-day .info-panel {
  left: auto;
  right: 0;
}

.check input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0.2rem;
  accent-color: var(--moss-deep);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-top: 1rem;
}

.field span {
  font-size: 0.92rem;
  font-weight: 500;
}

.field input,
.field textarea,
.field select {
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.16);
  border-radius: 0.75rem;
  padding: 0.75rem 0.85rem;
}

.field textarea {
  min-height: 12rem;
  resize: vertical;
  line-height: 1.6;
}

.field small {
  color: var(--soft);
  font-size: 0.88rem;
}

.local-clock {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0;
  color: var(--soft);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.local-clock[hidden] {
  display: none;
}

.split {
  display: grid;
  grid-template-columns: 1fr 8.5rem;
  gap: 0.65rem;
}

.letter {
  width: min(40rem, 100%);
}

.letter-show {
  width: 100%;
}

.letter-split {
  display: grid;
  grid-template-columns: minmax(0, 42rem) minmax(18rem, 1fr);
  gap: 1.75rem 2.25rem;
  align-items: start;
  margin-top: 1.75rem;
}

.letter-show .letter-body {
  margin-top: 0;
}

.letter-rail {
  position: sticky;
  top: 5.35rem;
  padding: 1.05rem 1.15rem 1.15rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.9rem;
}

.letter-rail .clock-note {
  margin: 0;
  font-size: 0.88rem;
}

.letter-rail .seal-facts {
  margin-top: 0.9rem;
}

.public-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.15rem;
}

.letter-rail .open-public {
  gap: 0.4rem;
}

.letter-rail .open-public svg {
  width: 1rem;
  height: 1rem;
}

.public-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.15rem 0 0;
}

.qr-frame {
  width: fit-content;
  padding: 0.55rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.7rem;
}

.qr-frame svg {
  display: block;
  width: 7.25rem;
  height: 7.25rem;
}

.public-qr figcaption {
  margin-top: 0.4rem;
  color: var(--soft);
  font-size: 0.78rem;
}

.stage.center-stage {
  display: flex;
  align-items: center;
  justify-content: center;
}

.public-letter {
  text-align: center;
}

.public-letter .seal-facts {
  justify-items: center;
}

.public-letter .clock-note {
  margin-top: 1.75rem;
  font-size: 0.88rem;
}

.public-letter .guest-clock {
  margin-top: 0.35rem;
}

.public-letter .letter-body {
  text-align: left;
}

.missing-mark {
  display: block;
  width: 4.4rem;
  height: auto;
  margin: 1.75rem auto 0.2rem;
}

.public-letter .missing-home {
  width: fit-content;
  margin: 1.5rem auto 0;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
}

.shut-sheet {
  position: relative;
  margin: 2rem auto 0.2rem;
  padding: 2.35rem 1.35rem 1.2rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.9rem;
  text-align: left;
}

.shut-sheet .lines {
  margin: 0;
}

.wax {
  position: absolute;
  top: -1.35rem;
  left: 50%;
  width: 3.55rem;
  height: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 4px 5px rgba(110, 34, 28, 0.2));
}

a.submit {
  display: block;
  text-align: center;
  text-decoration: none;
}

.clock-note {
  margin: 1.15rem 0 0;
  color: var(--soft);
}

.seal-facts {
  display: grid;
  gap: 0.85rem;
  margin: 1.6rem 0 0;
}

.clock-note + .seal-facts {
  margin-top: 0.75rem;
}

.seal-facts div {
  display: grid;
  gap: 0.15rem;
}

.seal-facts dt {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.seal-facts dd {
  margin: 0;
}

.code-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.7rem;
}

.code {
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

a.code {
  color: inherit;
  text-decoration: none;
}

a.code:hover {
  color: var(--clay);
}

.copy-code {
  border: 1px solid rgba(28, 44, 41, 0.16);
  border-radius: 999px;
  background: transparent;
  color: var(--moss-deep);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.18rem 0.7rem;
  white-space: nowrap;
  cursor: pointer;
}

.copy-code:hover {
  color: var(--clay);
  border-color: var(--clay);
}

.seal-preview {
  margin: 1.15rem 0 0;
  color: var(--moss-deep);
  font-weight: 500;
  line-height: 1.45;
}

.seal-preview.is-past {
  padding: 0.8rem 0.95rem 0.85rem 0.9rem;
  color: #6a301c;
  background: #f8e6dc;
  border: 1px solid rgba(140, 69, 48, 0.28);
  border-left: 3px solid var(--clay);
  border-radius: 0.75rem;
}

.letter-body {
  margin-top: 1.5rem;
  padding: 1.15rem 1.2rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.9rem;
  white-space: pre-wrap;
  line-height: 1.7;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: 2px solid rgba(36, 88, 76, 0.35);
  border-color: var(--moss);
}

.submit {
  margin-top: 1.35rem;
  width: 100%;
  font: inherit;
  font-weight: 500;
  color: #f6f1e8;
  background: var(--moss-deep);
  border: 0;
  border-radius: 0.8rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.16s ease;
}

.submit:hover {
  background: var(--clay);
}

.submit:disabled {
  cursor: progress;
  background: var(--moss-deep);
}

.letters-board > a.submit {
  width: fit-content;
  margin: 1.5rem auto 0;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
}

.loader {
  position: absolute;
  inset: -1.25rem -0.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background: var(--paper);
  border-radius: 1.15rem;
}

.loader img {
  width: 4.4rem;
  height: 4.4rem;
  padding: 0.55rem;
  background: var(--sand);
  border-radius: 999px;
  animation: rock 1.15s ease-in-out infinite;
}

.loader span {
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-style: italic;
  color: var(--moss);
}

@keyframes rock {
  0%, 100% { transform: rotate(-14deg); }
  50% { transform: rotate(14deg); }
}

.letter-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 0.9rem;
}

.letter-kicker .kicker {
  margin: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--moss);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.back-link svg {
  width: 1.05rem;
  height: 1.05rem;
}

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

.letter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 2.25rem;
}

.letter-action {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  color: var(--moss-deep);
  background: #fff;
  border: 1px solid rgba(28, 44, 41, 0.16);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.letter-action:hover {
  color: #f6f1e8;
  background: var(--moss);
  border-color: var(--moss);
}

.letter-action.is-primary {
  color: #f6f1e8;
  background: var(--moss-deep);
  border-color: var(--moss-deep);
}

.letter-action.is-primary:hover {
  background: var(--clay);
  border-color: var(--clay);
}

.account-page {
  width: 100%;
}

.account-page h1 {
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 3rem);
}

.account-layout {
  display: grid;
  grid-template-columns: 12.5rem minmax(0, 28rem);
  gap: 2.25rem;
  align-items: start;
  margin-top: 1.75rem;
}

.account-nav {
  display: grid;
  gap: 0.2rem;
  position: sticky;
  top: 5.35rem;
}

.account-nav a,
.account-nav button {
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0.7rem;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.account-nav a:hover,
.account-nav button:hover {
  background: rgba(255, 255, 255, 0.7);
}

.account-nav a[aria-current="page"] {
  color: var(--moss-deep);
  background: #fff;
  font-weight: 500;
}

.account-nav a.is-danger {
  color: var(--clay);
}

.account-nav form {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(28, 44, 41, 0.12);
}

.account-panel {
  position: relative;
}

.account-panel .form-error,
.account-panel .form-note {
  margin-bottom: 1.5rem;
}

.account-panel h2 {
  margin: 0;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.panel-lead {
  margin: 0.55rem 0 0;
  color: var(--soft);
}

.account-panel form .letter-action,
.account-panel > .account-delete {
  margin-top: 1.35rem;
}

.account-delete {
  color: var(--clay);
  background: transparent;
}

.account-delete:hover {
  color: #f6f1e8;
  background: var(--clay);
  border-color: var(--clay);
}

.account-delete:disabled {
  cursor: default;
  opacity: 0.45;
  pointer-events: none;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 1.75rem;
}

.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 0.85rem;
  padding: 0.8rem 2.55rem 0.75rem 0.8rem;
}

.stat-icon {
  position: absolute;
  top: 0.65rem;
  right: 0.6rem;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0.16rem;
  background: var(--sand);
  border-radius: 0.5rem;
}

.stat-card.is-readings .stat-icon {
  background: #f8e6dc;
}

.stat-value {
  margin: 0;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  margin: 0.28rem 0 0;
  color: var(--soft);
  font-size: 0.82rem;
}

.stat-card.is-sealed .stat-value {
  color: var(--moss-deep);
}

.stat-card.is-open .stat-value {
  color: var(--moss);
}

.stat-card.is-closed .stat-icon {
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
}

.stat-card.is-closed .stat-value {
  color: #6d5640;
}

.stat-card.is-readings .stat-value {
  color: var(--clay);
}

.stat-chart {
  margin: 1.15rem 0 0;
  padding: 1.25rem 1.35rem 1.2rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.1);
  border-radius: 1.15rem;
}

.stat-chart h2 {
  margin: 0;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.stat-chart p {
  margin: 0.45rem 0 0;
  max-width: 38rem;
  color: var(--soft);
}

.stat-plot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  height: 16rem;
  margin-top: 1.35rem;
}

.stat-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  height: 100%;
}

.stat-track {
  display: flex;
  align-items: flex-end;
  flex: 1;
  width: min(4.5rem, 78%);
  background: rgba(28, 44, 41, 0.05);
  border-radius: 0.8rem;
  overflow: hidden;
}

.stat-fill {
  display: block;
  width: 100%;
  border-radius: 0.7rem 0.7rem 0 0;
}

.stat-fill.is-sealed {
  background: var(--moss-deep);
}

.stat-fill.is-open {
  background: var(--moss);
}

.stat-fill.is-closed {
  background: var(--sand-deep);
}

.stat-col strong {
  margin-top: 0.7rem;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1;
}

.stat-col span {
  margin-top: 0.2rem;
  color: var(--soft);
  font-size: 0.88rem;
}

.modal-discard:disabled {
  cursor: default;
  opacity: 0.45;
}

.letter-action.discard {
  margin-left: auto;
  color: var(--clay);
  background: transparent;
}

.letter-action.discard:hover {
  color: #f6f1e8;
  background: var(--clay);
  border-color: var(--clay);
}

.auth-switch {
  margin: 1rem 0 0;
  color: var(--soft);
}

.auth-switch a {
  color: var(--moss);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.brand img {
  width: 2.35rem;
  height: 2.35rem;
  display: block;
}

.intro h1 {
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.kicker {
  margin: 0 0 0.9rem;
  color: var(--moss);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 11ch;
  font-size: clamp(3.1rem, 6vw, 4.8rem);
  line-height: 0.96;
  font-weight: 600;
}

.lede {
  max-width: 36rem;
  margin: 1.5rem 0 0;
  color: var(--soft);
  font-size: 1.12rem;
}

.lede em {
  color: var(--ink);
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-style: italic;
  font-weight: 400;
}

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(16rem, 0.8fr);
  column-gap: 3.5rem;
  align-items: center;
}

.landing-actions {
  margin: 1.6rem 0 0;
}

.landing-cta {
  display: inline-flex;
  align-items: center;
  color: #f6f1e8;
  background: var(--moss-deep);
  border: 1px solid var(--moss-deep);
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  font-weight: 500;
  text-decoration: none;
}

.landing-cta:hover {
  background: var(--clay);
  border-color: var(--clay);
}

.letter-play {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.35rem 1.2rem 1.25rem;
  background: linear-gradient(180deg, #f6e7d6 0%, var(--sand-deep) 100%);
  border-radius: 1.6rem 1.2rem 1.5rem 1.35rem;
}

.play-clock {
  width: 2.7rem;
  height: 2.7rem;
  display: block;
  margin-bottom: 0.15rem;
}

.play-hour,
.play-minute {
  transform-box: view-box;
  transform-origin: center;
}

.play-minute {
  animation: play-hand 34s linear infinite;
}

.play-hour {
  animation: play-hand 408s linear infinite;
}

.letter-stage {
  position: relative;
  width: 12.5rem;
  height: 12.5rem;
}

.letter-stage .fig {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fig-open {
  animation: fig-open 8.5s ease-in-out infinite;
}

.fig-sealed {
  animation: fig-sealed 8.5s ease-in-out infinite;
}

.play-state {
  position: relative;
  width: 100%;
  height: 1.2rem;
  margin: 0.85rem 0 0;
}

.play-state span {
  position: absolute;
  inset: 0;
  text-align: center;
  color: var(--clay);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.play-state .is-open {
  animation: play-open-label 8.5s ease-in-out infinite;
}

.play-state .is-sealed {
  animation: play-sealed-label 8.5s ease-in-out infinite;
}

.play-link {
  margin: 0.95rem 0 0;
  padding: 0.32rem 0.75rem;
  color: var(--ink);
  background: var(--card);
  border-radius: 999px;
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.play-link span {
  color: var(--soft);
}

.play-guest {
  margin: 0.55rem 0 0;
  color: var(--soft);
  font-size: 0.88rem;
  text-align: center;
}

.landing-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 3.25rem;
}

.landing-points article {
  padding: 1.15rem 1.15rem 1.25rem;
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.08);
  border-radius: 1.15rem 0.95rem 1.2rem 1.05rem;
}

.landing-points img {
  width: 4.4rem;
  height: 4.4rem;
  display: block;
  animation: play-bob 5.5s ease-in-out infinite;
}

.landing-points article:nth-child(2) img {
  animation-delay: -1.8s;
}

.landing-points article:nth-child(3) img {
  animation-delay: -3.4s;
}

.landing-points h2 {
  margin: 0.9rem 0 0;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.landing-points p {
  margin: 0.35rem 0 0;
  color: var(--soft);
}

@keyframes fig-open {
  0%, 26% { opacity: 1; transform: translateY(0) rotate(-2.5deg); }
  42%, 76% { opacity: 0; transform: translateY(14px) rotate(2deg) scale(0.96); }
  92%, 100% { opacity: 1; transform: translateY(0) rotate(-2.5deg); }
}

@keyframes fig-sealed {
  0%, 26% { opacity: 0; transform: translateY(-16px) rotate(3deg) scale(1.02); }
  44%, 74% { opacity: 1; transform: translateY(0) rotate(-1.5deg) scale(1.18); }
  90%, 100% { opacity: 0; transform: translateY(-12px) rotate(2deg) scale(1.05); }
}

@keyframes play-open-label {
  0%, 30% { opacity: 1; }
  42%, 78% { opacity: 0; }
  90%, 100% { opacity: 1; }
}

@keyframes play-sealed-label {
  0%, 30% { opacity: 0; }
  44%, 74% { opacity: 1; }
  88%, 100% { opacity: 0; }
}

@keyframes play-bob {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-0.28rem) rotate(1.5deg); }
}

@keyframes play-hand {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .fig-open,
  .fig-sealed,
  .play-state span,
  .play-hour,
  .play-minute,
  .landing-points img {
    animation: none;
  }

  .fig-open,
  .play-state .is-open {
    opacity: 0;
  }

  .fig-sealed {
    opacity: 1;
    transform: scale(1.18);
  }

  .play-state .is-sealed {
    opacity: 1;
  }
}

.lines {
  display: grid;
  gap: 0.85rem;
  margin: 1.35rem 0 1.6rem;
}

.lines i {
  display: block;
  height: 1px;
  background: rgba(28, 44, 41, 0.16);
}

.lines i:nth-child(1) { width: 100%; }
.lines i:nth-child(2) { width: 92%; }
.lines i:nth-child(3) { width: 96%; }
.lines i:nth-child(4) { width: 58%; }

.foot {
  background: var(--moss-deep);
  color: #f6f1e8;
}

.foot-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.7rem 0;
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.foot-brand img {
  width: 2.7rem;
  height: 2.7rem;
  display: block;
}

.foot-brand strong {
  display: block;
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.foot-brand em {
  display: block;
  margin-top: 0.1rem;
  color: rgba(246, 241, 232, 0.72);
  font-family: "Fraunces", "Nimbus Roman", serif;
  font-size: 0.98rem;
  font-style: italic;
  font-weight: 400;
}

.foot-side {
  text-align: right;
}

.foot p {
  margin: 0;
  color: #e2a86a;
  font-size: 0.95rem;
}

.foot-side p + p {
  margin-top: 0.45rem;
}

.foot-links {
  display: flex;
  justify-content: flex-end;
  gap: 0.9rem;
}

.foot-privacy {
  color: #f6f1e8;
}

.foot-copy {
  color: rgba(246, 241, 232, 0.72);
  font-size: 0.88rem;
}

.auth.privacy {
  width: min(36rem, 100%);
}

.privacy-copy {
  margin: 1.15rem 0 0;
  color: var(--ink);
  line-height: 1.55;
}

.foot-cookies {
  color: #f6f1e8;
}

body:has(.cookie-banner) .foot {
  padding-bottom: 7.25rem;
}

.cookie-banner {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.85rem;
}

.cookie-card {
  width: min(40rem, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem 1rem;
  padding: 0.95rem 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: 0 16px 40px rgba(28, 44, 41, 0.16);
}

.cookie-copy {
  flex: 1 1 16rem;
  margin: 0;
  color: var(--ink);
}

.cookie-card form {
  display: flex;
  gap: 0.5rem;
  margin: 0;
}

.cookie-deny,
.cookie-accept {
  min-width: 6.5rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.cookie-deny {
  color: var(--ink);
  background: var(--card);
  border: 1px solid rgba(28, 44, 41, 0.28);
}

.cookie-deny:hover {
  background: var(--sand);
}

.cookie-accept {
  color: #f6f1e8;
  background: var(--moss);
  border: 1px solid var(--moss);
}

.cookie-accept:hover {
  background: var(--moss-deep);
}

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

@media (max-width: 860px) {
  body {
    background:
      radial-gradient(520px 280px at 100% 0%, var(--sand) 0%, transparent 70%),
      var(--paper);
  }

  .bar,
  .stage {
    width: min(100% - 2rem, 40rem);
  }

  .local-place {
    display: none;
  }

  .stage {
    padding-top: 2.4rem;
  }

  .foot-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.45rem 0 1.55rem;
  }

  .foot-side {
    text-align: left;
  }

  .foot-links {
    justify-content: flex-start;
  }

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

  .letter-play {
    margin-top: 2rem;
  }

  .landing-points {
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
  }

  h1 {
    max-width: 12ch;
  }

  .brand {
    font-size: 1.12rem;
    gap: 0.45rem;
  }

  .brand img {
    width: 1.85rem;
    height: 1.85rem;
  }

  .nav-link {
    padding: 0.4rem 0.7rem;
  }

  .nav-link .long {
    display: none;
  }

  .nav-link .short {
    display: inline;
  }

  .letter h1 {
    max-width: none;
  }

  .letter-split {
    grid-template-columns: 1fr;
  }

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

  .stat-plot {
    height: 13rem;
    gap: 0.7rem;
  }

  .account-layout {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .account-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem 0.2rem;
  }

  .account-nav form {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .letter-rail {
    position: static;
  }

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

  .letter-row,
  .letter-row.head {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.35rem 0.6rem;
  }

  .letter-link {
    grid-column: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
  }

  .row-actions {
    align-self: start;
    margin-top: 0.15rem;
  }

  .letter-row.head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
  }

  body:has(.cookie-banner) .foot {
    padding-bottom: 11.5rem;
  }

  .cookie-card form {
    width: 100%;
  }

  .cookie-deny,
  .cookie-accept {
    flex: 1;
  }

  .letter-row span[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-top: 0.35rem;
    color: var(--clay);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
}
