:root {
  --bg: #f8f3e9;
  --surface: #fffdf7;
  --paper: #fbf1dc;
  --paper-edge: #d8bd78;
  --ink: #142231;
  --ink-soft: #314254;
  --muted: #6d746f;
  --line: #dfd5c1;
  --green: #2f6f5b;
  --green-dark: #1f4b3e;
  --blue: #285778;
  --blue-soft: #dce9ee;
  --ruby: #963d4b;
  --rose: #d98b9d;
  --terracotta: #b55d3f;
  --gold: #b78b32;
  --shadow: 0 18px 45px rgba(22, 33, 44, 0.12);
  --radius: 8px;
  --header-card-height: 172px;
  --site-block-alpha: 0.9;
  --site-inner-block-alpha: 0.96;
  --hf-surface-alpha: var(--site-block-alpha);
  --hf-inner-surface-alpha: var(--site-inner-block-alpha);
  --z-header: 100;
  --z-tabs: 150;
  --z-modal-overlay: 20000;
  --z-modal-content: 20001;
  --z-toast: 23000;
  --header-height: 90px;
  --lexicon-sticky-top: calc(var(--header-height, 90px) + 16px);
  --paper-texture:
    radial-gradient(circle at 18% 16%, rgba(179, 139, 53, 0.08) 0 1px, transparent 1.8px),
    radial-gradient(circle at 72% 26%, rgba(143, 51, 69, 0.05) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 76%, rgba(47, 107, 87, 0.055) 0 1px, transparent 1.8px),
    repeating-linear-gradient(12deg, rgba(130, 96, 43, 0.035) 0 1px, transparent 1px 9px);
}

* {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(217, 139, 157, 0.18), transparent 260px),
    radial-gradient(circle at 88% 6%, rgba(183, 139, 50, 0.14), transparent 320px),
    linear-gradient(180deg, rgba(47, 111, 91, 0.1), transparent 360px),
    var(--bg);
  background-size:
    auto,
    auto,
    auto,
    auto;
  background-position:
    12% 0%,
    88% 6%,
    center top,
    center;
  background-repeat:
    no-repeat,
    no-repeat,
    no-repeat,
    repeat;
  background-attachment:
    scroll,
    scroll,
    scroll,
    scroll;
  position: relative;
  isolation: isolate;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(rgba(248, 243, 233, var(--site-background-overlay-opacity, 0)), rgba(248, 243, 233, var(--site-background-overlay-opacity, 0))),
    var(--site-background-image, none);
  background-size: auto, var(--site-background-size, cover);
  background-position: center, var(--site-background-position, center);
  background-repeat: no-repeat, var(--site-background-repeat, no-repeat);
  background-attachment: scroll, var(--site-background-attachment, scroll);
}

body.has-site-background::before {
  opacity: 1;
}

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

img,
video,
canvas {
  max-width: 100%;
}

:where(.site-header, .site-brand-shell, .site-brand-copy, .global-search, .collection-switcher, .account-panel, .panel, .collection-card, .collection-card-body, .metric, .booklet, .spread, .page, .lexicon-entry-row, .lexicon-detail, .message-card, .message-layout, .auth-card) {
  min-width: 0;
}

:where(.panel, .collection-card, .collection-card-meta div, .metric, .message-detail-card, .lexicon-entry-row, .lexicon-detail, .related-note, .note-card) {
  overflow-wrap: anywhere;
}

button {
  cursor: pointer;
}

button:disabled,
button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.48;
}

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

.icon-sprite {
  display: none;
}

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

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1680px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px 0 42px;
  display: flex;
  flex-direction: column;
}

.app-shell > main {
  flex: 1 0 auto;
}

.site-header {
  position: relative;
  z-index: var(--z-header);
  display: grid;
  grid-template-columns: minmax(260px, 1.05fr) minmax(320px, 1.35fr) auto minmax(320px, 0.82fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--site-block-alpha, 0.9)), rgba(250, 241, 220, calc(var(--site-block-alpha, 0.9) * 0.9))),
    var(--paper-texture);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(130, 96, 43, 0.22);
  border-radius: 12px;
  box-shadow: 0 16px 34px rgba(48, 40, 31, 0.1);
}

.site-brand-shell {
  min-width: 0;
  display: flex;
  align-items: stretch;
}

.site-brand {
  min-width: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
  cursor: default;
}

.site-logo {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 111, 91, 0.24);
  border-radius: 12px;
  background:
    radial-gradient(circle at 70% 18%, rgba(217, 139, 157, 0.22), transparent 26px),
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(245, 231, 201, 0.8));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.site-logo-image {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.site-logo-image[hidden],
.site-logo-fallback[hidden] {
  display: none;
}

.site-logo-fallback {
  color: var(--green-dark);
  font-size: 1.45rem;
  font-weight: 950;
  letter-spacing: 0;
}

.site-brand-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.site-brand-copy strong {
  color: var(--ink);
  font-size: clamp(1.32rem, 1.8vw, 2.1rem);
  line-height: 1;
}

.site-brand-copy span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.site-nav-link {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 850;
}

.site-nav-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.site-nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: block;
  object-fit: contain;
}

.site-nav-link:hover,
.site-nav-link:focus-visible,
.site-nav-link.active {
  border-color: rgba(47, 111, 91, 0.22);
  background: rgba(47, 111, 91, 0.09);
}

body.public-site-page .collection-hero,
body.public-site-page .tabs,
body.admin-page .collection-hero,
body.admin-page .tabs {
  display: none;
}

body.profile-page .app-shell > main {
  display: none;
}

.topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.collection-hero {
  align-items: stretch;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.92), rgba(251, 241, 220, 0.72)),
    var(--paper-texture);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(48, 40, 31, 0.08);
}

.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
}

.collection-heading {
  display: flex;
  align-items: start;
  gap: 18px;
  min-width: 0;
}

.collection-title-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.collection-name-block {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.collection-kicker {
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.collection-heading h1 {
  min-width: 0;
  max-width: min(900px, 58vw);
  overflow-wrap: anywhere;
}

.collection-hero h1 {
  min-width: 0;
  max-width: min(1040px, 68vw);
  overflow-wrap: anywhere;
}

.collection-description {
  max-width: 960px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.98rem, 1vw, 1.08rem);
  line-height: 1.55;
  white-space: pre-wrap;
}

.collection-description.empty {
  color: var(--muted);
  font-style: italic;
}

.collection-quick-actions {
  min-width: 210px;
  display: grid;
  gap: 8px;
  justify-items: end;
}

.collection-actions-label {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

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

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.7rem;
  line-height: 1.1;
}

.account-panel {
  flex: 0 1 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 196px;
  gap: 10px;
  align-items: stretch;
  width: min(430px, 100%);
  min-height: var(--header-card-height);
  height: var(--header-card-height);
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(22, 33, 44, 0.07);
}

.site-header .account-panel {
  width: 100%;
  min-height: 116px;
  height: 116px;
  grid-template-columns: minmax(0, 1fr) 126px;
  padding: 8px;
  background: rgba(255, 253, 247, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.site-header .account-buttons {
  gap: 6px;
}

.site-header .account-buttons .secondary-action {
  min-height: 0;
  padding: 0 8px;
  font-size: 0.84rem;
}

.site-header .account-tile {
  padding: 8px;
}

.site-header .account-avatar {
  width: 54px;
  height: 54px;
  font-size: 1rem;
}

.account-buttons {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.account-buttons .secondary-action {
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0 10px;
  line-height: 1.08;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}

.account-profile-block {
  display: grid;
  justify-items: stretch;
  min-height: 0;
  min-width: 0;
}

.account-label {
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.owner-card,
.account-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(22, 33, 44, 0.06);
}

.owner-card {
  width: 196px;
  min-width: 196px;
  min-height: var(--header-card-height);
  display: grid;
  gap: 7px;
  align-content: center;
  padding: 12px;
  text-align: center;
}

.owner-card[hidden],
.account-tile[hidden] {
  display: none;
}

.owner-card:hover,
.account-tile:hover {
  border-color: rgba(47, 107, 87, 0.38);
  background: #f7faf6;
}

.owner-card {
  cursor: pointer;
}

.owner-card:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.28);
  outline-offset: 3px;
}

.owner-label {
  color: var(--green);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.owner-line {
  display: grid;
  gap: 7px;
  justify-items: center;
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.owner-line > span:last-child,
.account-tile > span:last-child {
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.owner-summary-card {
  width: min(1460px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: 90vh;
  overflow: hidden;
}

.auth-card.owner-summary-card {
  width: min(1460px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: 90vh;
  overflow: hidden;
}

.owner-summary-content {
  display: grid;
  gap: 16px;
  max-height: calc(90vh - 44px);
  min-width: 0;
  overflow: auto;
  padding-right: 2px;
}

.owner-summary-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.owner-summary-avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-weight: 900;
}

.owner-summary-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-summary-head strong {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.owner-summary-head .profile-name-badges {
  display: flex;
  margin: 6px 0 0;
}

.owner-summary-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.owner-summary-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.owner-summary-stats div {
  display: grid;
  gap: 3px;
  padding: 10px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}

.owner-summary-stats strong {
  font-size: 1.05rem;
}

.owner-summary-stats span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.owner-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owner-avatar,
.account-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--green);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  font-weight: 900;
}

.owner-avatar {
  width: 94px;
  height: 94px;
  font-size: 1.45rem;
}

.account-tile {
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  min-height: 0;
  display: grid;
  gap: 6px;
  justify-items: center;
  align-content: center;
  padding: 10px;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.account-avatar {
  width: 94px;
  height: 94px;
  font-size: 1.45rem;
}

.owner-avatar img,
.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar-empty {
  background:
    linear-gradient(135deg, rgba(101, 113, 125, 0.08), rgba(47, 107, 87, 0.08)),
    #f6f8f4;
  border: 1px dashed rgba(101, 113, 125, 0.48);
}

.collection-switcher {
  position: relative;
  width: min(720px, 100%);
  min-width: 0;
  max-width: 720px;
}

.collection-switcher[hidden] {
  display: none;
}

.global-search {
  width: 100%;
  max-width: none;
  align-self: center;
}

.global-search > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  z-index: 1;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--green);
  pointer-events: none;
}

.collection-switcher input {
  padding-right: 34px;
  background: rgba(255, 255, 255, 0.94);
}

.global-search input {
  min-height: 48px;
  padding-left: 42px;
  padding-right: 14px;
  border-color: rgba(47, 111, 91, 0.2);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.collection-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 38px rgba(22, 33, 44, 0.15);
}

.collection-results[hidden] {
  display: none;
}

.collection-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.collection-result.has-thumb {
  grid-template-columns: 52px minmax(0, 1fr) auto;
}

.global-result-thumb {
  width: 52px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 7px;
  background:
    linear-gradient(45deg, rgba(130, 96, 43, 0.08) 25%, transparent 25% 75%, rgba(130, 96, 43, 0.08) 75%),
    linear-gradient(45deg, rgba(130, 96, 43, 0.08) 25%, transparent 25% 75%, rgba(130, 96, 43, 0.08) 75%),
    rgba(255, 253, 247, 0.76);
  background-position: 0 0, 6px 6px, 0 0;
  background-size: 12px 12px, 12px 12px, auto;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.global-result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.collection-result:hover,
.collection-result.active,
.collection-result.highlighted {
  border-color: rgba(47, 107, 87, 0.3);
  background: #f3f7f1;
}

.global-result-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.global-result-main strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 850;
}

.global-result-type {
  align-self: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(181, 93, 63, 0.1);
  color: var(--terracotta);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.collection-result small,
.collection-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.collection-empty {
  padding: 10px;
}

.admin-button {
  white-space: nowrap;
}

.admin-button.active {
  border-color: rgba(47, 107, 87, 0.28);
  background: rgba(47, 107, 87, 0.12);
  color: var(--green-dark);
}

.admin-badge {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #b32638;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  vertical-align: middle;
}

.moderator-badge {
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #1d64b7;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  vertical-align: middle;
}

#headerMessagesButton {
  position: relative;
}

#headerMessagesButton.has-unread {
  border-color: rgba(179, 38, 56, 0.45);
  background: rgba(179, 38, 56, 0.1);
  color: #7c1b28;
}

.message-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #b32638;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.tabs {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(22, 33, 44, 0.06);
  position: sticky;
  top: 10px;
  z-index: var(--z-tabs);
  backdrop-filter: blur(14px);
}

.tab,
.primary-action,
.secondary-action,
.danger-action,
.file-button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: transparent;
  font-weight: 750;
}

.tab.active {
  background: var(--green);
  color: #fff;
}

.tab:not(.active):hover,
.secondary-action:hover,
.icon-button:hover {
  background: #e9eee8;
}

main {
  padding-top: 22px;
}

.view {
  position: relative;
  z-index: auto;
  display: none;
}

.view.active {
  display: block;
}

.about-page-view {
  display: none;
}

.about-page-view.active {
  display: grid;
  gap: 18px;
}

.about-hero,
.about-section,
.about-action-card {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.95), rgba(251, 241, 220, 0.78)),
    var(--paper-texture);
  border-color: rgba(130, 96, 43, 0.2);
}

.about-hero {
  min-height: clamp(360px, 36vw, 520px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 28px;
  align-items: center;
  padding: clamp(26px, 4vw, 58px);
}

.about-hero-copy,
.about-section,
.about-action-card {
  min-width: 0;
}

.about-kicker {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 5px 10px;
  border: 1px solid rgba(183, 139, 50, 0.28);
  border-radius: 999px;
  background: rgba(183, 139, 50, 0.1);
  color: #765a1d;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.about-page-view h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 1;
}

.about-page-view p {
  max-width: 860px;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.15vw, 1.18rem);
  line-height: 1.65;
  white-space: pre-line;
}

.about-portrait {
  width: min(100%, 320px);
  aspect-ratio: 1;
  justify-self: center;
  display: grid;
  place-items: center;
  border: 1px solid rgba(47, 111, 91, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 65% 18%, rgba(217, 139, 157, 0.28), transparent 28%),
    radial-gradient(circle at 20% 76%, rgba(183, 139, 50, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(47, 111, 91, 0.1), rgba(40, 87, 120, 0.1)),
    #fffdf7;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 18px 34px rgba(48, 40, 31, 0.12);
}

.about-portrait img,
.about-section-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.about-portrait img {
  border-radius: inherit;
}

.about-portrait span {
  display: grid;
  place-items: center;
  width: 42%;
  aspect-ratio: 1;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
}

.about-section-image {
  width: min(100%, 680px);
  aspect-ratio: 16 / 7;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 91, 0.18);
  border-radius: 14px;
  background: #fffdf7;
}

.about-section-image.about-site-logo {
  width: min(100%, 280px);
  aspect-ratio: 1;
  padding: 28px;
}

.about-section-image.about-site-logo img {
  object-fit: contain;
}

.about-section-image[hidden] {
  display: none;
}

.site-content-block {
  position: relative;
}

.site-content-edit-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
  width: 34px;
  height: 34px;
  display: none;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(47, 111, 91, 0.28);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.94);
  color: var(--green);
  box-shadow: 0 8px 18px rgba(22, 33, 44, 0.12);
  cursor: pointer;
  opacity: 0.48;
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    background-color 160ms ease;
}

.site-content-edit-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.site-content-admin .site-content-block {
  outline: 1px solid transparent;
  outline-offset: 4px;
  transition:
    outline-color 160ms ease,
    background-color 160ms ease;
}

.site-content-admin .site-content-block:hover {
  outline-color: rgba(47, 111, 91, 0.22);
}

.site-content-admin .site-content-block > .site-content-edit-button {
  display: grid;
}

.site-content-admin .site-content-block:hover > .site-content-edit-button,
.site-content-admin .site-content-edit-button:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
}

.site-brand-shell .site-content-edit-button {
  top: -10px;
  right: -10px;
}

.about-section {
  padding: clamp(24px, 3.5vw, 48px);
}

.about-section h2,
.about-action-card h2 {
  font-size: clamp(1.6rem, 2.5vw, 2.8rem);
}

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

.about-action-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 300px;
  padding: clamp(22px, 3vw, 40px);
}

.about-action-card p {
  margin-top: 0;
}

.about-action-card button {
  justify-self: start;
  margin-top: auto;
}

.about-action-image {
  width: 100%;
  max-height: 180px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.64);
}

.about-action-image[hidden] {
  display: none;
}

.about-action-image img {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.about-page-view.active {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.about-hero,
.about-section,
.about-action-card,
.site-footer {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--site-block-alpha, 0.9)), rgba(251, 241, 220, calc(var(--site-block-alpha, 0.9) * 0.86))),
    var(--paper-texture);
  backdrop-filter: blur(5px);
}

.about-section {
  order: 1;
  min-height: 0;
}

.about-hero {
  order: 2;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 168px);
  gap: 18px;
  align-items: start;
  align-content: start;
  padding: clamp(20px, 2.6vw, 34px);
}

.about-action-grid {
  order: 3;
  grid-column: 1 / -1;
}

.about-action-card[data-site-content-key="about.shareCta"] {
  grid-column: 1 / -1;
  min-height: 0;
}

.about-page-view h2 {
  font-size: clamp(1.45rem, 2.2vw, 2.45rem);
  line-height: 1.06;
}

.about-page-view p {
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  line-height: 1.55;
}

.about-portrait {
  width: min(100%, 168px);
  border-radius: 14px;
}

.about-section {
  padding: clamp(20px, 2.6vw, 34px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 168px);
  gap: 18px;
  align-items: start;
  align-content: start;
}

.about-section-image {
  grid-column: 2;
  grid-row: 1 / span 5;
  justify-self: end;
  align-self: start;
  width: min(100%, 168px);
  aspect-ratio: 1;
  max-height: none;
  border-radius: 14px;
}

.about-section > :not(.about-section-image) {
  grid-column: 1;
}

.about-hero-copy {
  align-self: start;
}

.about-portrait {
  justify-self: end;
  align-self: start;
}

.home-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: auto;
}

.home-carousel {
  display: grid;
  gap: 10px;
  margin: 4px 0 8px;
}

.home-carousel-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.home-carousel-controls {
  display: inline-flex;
  gap: 6px;
}

.home-carousel-controls .icon-button {
  width: 32px;
  height: 32px;
  font-size: 1.35rem;
  line-height: 1;
}

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

.home-carousel-card {
  min-width: 0;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 9px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.62);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.home-carousel-card:hover,
.home-carousel-card:focus-visible {
  border-color: rgba(47, 111, 91, 0.34);
  background: rgba(255, 253, 247, 0.82);
  transform: translateY(-1px);
}

.home-carousel-image {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(255, 253, 247, 0.52);
}

.home-carousel-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-carousel-image span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(47, 111, 91, 0.13);
  color: var(--green);
  font-weight: 900;
}

.home-carousel-card strong,
.home-carousel-card small,
.home-carousel-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-carousel-card strong {
  color: var(--ink);
  font-size: 0.92rem;
  white-space: nowrap;
}

.home-carousel-card small,
.home-carousel-card em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  line-height: 1.3;
}

.home-carousel-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed rgba(130, 96, 43, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.48);
}

.about-page-view.active {
  grid-template-columns: minmax(0, 3fr) minmax(280px, 1fr);
  grid-template-areas:
    "site carousel"
    "author carousel"
    "share carousel";
  align-items: stretch;
}

.about-section {
  grid-area: site;
  order: initial;
}

.about-hero {
  grid-area: author;
  order: initial;
}

.about-action-grid {
  grid-area: carousel;
  grid-column: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-content: stretch;
  gap: 16px;
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 2vw, 26px);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--site-block-alpha, 0.9)), rgba(251, 241, 220, calc(var(--site-block-alpha, 0.9) * 0.84))),
    var(--paper-texture);
  box-shadow: 0 18px 42px rgba(48, 40, 31, 0.1);
  backdrop-filter: blur(5px);
}

.about-action-card[data-site-content-key="about.shareCta"] {
  grid-area: share;
  grid-column: auto;
  min-height: 0;
}

.about-section,
.about-hero,
.about-action-card[data-site-content-key="about.shareCta"] {
  height: 100%;
}

.home-carousel-panel-head {
  display: grid;
  gap: 4px;
}

.home-carousel-panel-head strong {
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.18rem, 1.5vw, 1.55rem);
  line-height: 1.05;
}

.about-action-grid > .about-action-card {
  gap: 10px;
  min-height: 0;
  padding: 14px;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--site-inner-block-alpha, 0.96)), rgba(251, 241, 220, calc(var(--site-inner-block-alpha, 0.96) * 0.9))),
    var(--paper-texture);
  box-shadow: 0 10px 24px rgba(48, 40, 31, 0.08);
  backdrop-filter: blur(4px);
}

.about-action-grid > .about-action-card h2 {
  font-size: clamp(1rem, 1.2vw, 1.24rem);
  line-height: 1.12;
}

.about-action-grid > .about-action-card button {
  margin-top: 0;
}

.rich-content {
  color: var(--ink-soft);
  font-size: clamp(0.95rem, 1vw, 1.05rem);
  line-height: 1.55;
}

.rich-content > :first-child {
  margin-top: 0;
}

.rich-content > :last-child {
  margin-bottom: 0;
}

.rich-content p,
.rich-content ul,
.rich-content ol {
  margin: 0 0 0.78em;
}

.rich-content ul,
.rich-content ol {
  padding-left: 1.25rem;
}

.rich-content h3,
.rich-content h4 {
  margin: 0 0 0.55em;
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.12;
}

.rich-content h3 {
  font-size: 1.18rem;
}

.rich-content h4 {
  font-size: 1.04rem;
}

.rich-content a {
  color: var(--green);
  font-weight: 760;
}

.rich-content font[face="Georgia"] {
  font-family: Georgia, "Times New Roman", serif;
}

.rich-content font[face="serif"] {
  font-family: Georgia, "Times New Roman", serif;
}

.rich-content font[face="Palatino Linotype"] {
  font-family: "Palatino Linotype", Palatino, serif;
}

.rich-content font[face="Garamond"] {
  font-family: Garamond, "Times New Roman", serif;
}

.rich-content font[face="Times New Roman"] {
  font-family: "Times New Roman", Times, serif;
}

.rich-content font[face="Inter"] {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.rich-content font[face="sans-serif"] {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.rich-content font[face="Arial"] {
  font-family: Arial, Helvetica, sans-serif;
}

.rich-content font[face="Verdana"] {
  font-family: Verdana, Geneva, sans-serif;
}

.rich-content font[face="Trebuchet MS"] {
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.rich-content font[face="Courier New"] {
  font-family: "Courier New", Courier, monospace;
}

.rich-content font[face="cursive"] {
  font-family: "Segoe Script", "Bradley Hand ITC", cursive;
}

.home-carousel {
  gap: 8px;
}

.home-carousel-track {
  grid-template-columns: 1fr;
}

.home-carousel-card {
  gap: 8px;
  min-height: 0;
  padding: 10px;
  border-color: rgba(130, 96, 43, 0.2);
  background: rgba(255, 253, 247, 0.54);
}

.home-carousel-image {
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(130, 96, 43, 0.12);
  background:
    linear-gradient(45deg, rgba(130, 96, 43, 0.07) 25%, transparent 25%, transparent 75%, rgba(130, 96, 43, 0.07) 75%),
    linear-gradient(45deg, rgba(130, 96, 43, 0.07) 25%, transparent 25%, transparent 75%, rgba(130, 96, 43, 0.07) 75%),
    rgba(255, 253, 247, 0.52);
  background-position: 0 0, 8px 8px, center;
  background-size: 16px 16px, 16px 16px, auto;
}

.home-carousel-card strong {
  white-space: normal;
}

.home-carousel-controls .icon-button {
  background: rgba(255, 253, 247, 0.72);
}

.site-header,
.site-footer,
.panel,
.about-hero,
.about-section,
.about-action-grid,
.about-action-card,
.collection-card,
.collections-filters,
.profile-card,
.lexicon-detail,
.lexicon-entry-row {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--site-block-alpha, 0.9)), rgba(251, 241, 220, calc(var(--site-block-alpha, 0.9) * 0.86))),
    var(--paper-texture);
  backdrop-filter: blur(5px);
}

.site-header .account-panel,
.about-action-grid > .about-action-card,
.home-carousel-frame {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--site-inner-block-alpha, 0.96)), rgba(251, 241, 220, calc(var(--site-inner-block-alpha, 0.96) * 0.9))),
    var(--paper-texture);
}

.hf-surface {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--hf-surface-alpha, 0.9)), rgba(251, 241, 220, calc(var(--hf-surface-alpha, 0.9) * 0.86))),
    var(--paper-texture) !important;
  backdrop-filter: blur(5px);
}

.hf-surface-inner,
.hf-surface .home-carousel-frame,
.hf-surface .home-carousel-card {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, var(--hf-inner-surface-alpha, 0.96)), rgba(251, 241, 220, calc(var(--hf-inner-surface-alpha, 0.96) * 0.88))),
    var(--paper-texture) !important;
}

.hf-surface .rich-content,
.hf-surface-inner .rich-content {
  background: transparent !important;
}

.about-hero,
.about-section {
  gap: 18px 22px;
  padding: clamp(22px, 2.6vw, 34px);
  min-height: 0;
}

.about-hero-copy {
  display: grid;
  align-content: start;
  gap: 10px;
}

.about-section {
  row-gap: 10px;
}

.about-page-view .about-kicker,
.about-page-view h2,
.about-page-view .rich-content {
  margin: 0;
}

.about-page-view .rich-content + .rich-content {
  margin-top: 0;
}

.about-page-view .rich-content p {
  margin: 0 0 0.72em;
}

.home-carousel-frame {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 318px;
  padding: 10px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.home-carousel-head {
  width: 100%;
  min-height: 26px;
  padding: 0 2px;
  text-align: center;
}

.home-carousel-count {
  display: inline-flex;
  justify-content: center;
  padding: 4px 9px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.7);
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.home-carousel-track {
  width: 100%;
  min-height: 0;
  display: grid;
  justify-items: center;
}

.home-carousel-card {
  width: 100%;
  height: 232px;
  grid-template-rows: 132px auto auto auto;
  overflow: hidden;
}

.home-carousel-image {
  height: 132px;
  aspect-ratio: auto;
}

.home-carousel-card strong,
.home-carousel-card small,
.home-carousel-card em {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  white-space: normal;
}

.home-carousel-card strong {
  -webkit-line-clamp: 2;
}

.home-carousel-card small,
.home-carousel-card em {
  -webkit-line-clamp: 1;
}

.home-carousel-controls {
  justify-content: center;
  width: 100%;
}

.rich-text-toolbar select option {
  color: var(--ink);
}

.admin-home-content-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rich-text-source {
  display: none;
}

.rich-text-editor {
  display: grid;
  gap: 8px;
}

.rich-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.rich-text-toolbar button,
.rich-text-toolbar select {
  min-height: 32px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 760;
}

.rich-text-toolbar button {
  min-width: 34px;
  padding: 0 8px;
}

.rich-text-toolbar select {
  padding: 0 8px;
}

.rich-text-editable {
  min-height: 150px;
  max-height: min(42vh, 360px);
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(130, 96, 43, 0.2);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  color: var(--ink);
  line-height: 1.55;
}

.rich-text-editable:focus-visible {
  outline: 3px solid rgba(47, 111, 91, 0.2);
  outline-offset: 2px;
}

.legal-rich-editor .rich-text-editable {
  min-height: 280px;
  max-height: min(58vh, 460px);
  resize: vertical;
}

.travel-note-rich-editor .rich-text-editable {
  min-height: 130px;
  max-height: min(34vh, 260px);
}

button.is-loading {
  position: relative;
}

.site-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(48, 40, 31, 0.08);
}

.site-footer > span {
  color: var(--ink);
  font-weight: 900;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: center;
}

.site-footer button {
  position: relative;
  padding: 4px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #2f2a22;
  font-weight: 850;
  cursor: pointer;
}

.site-footer button + button::before {
  content: "•";
  position: absolute;
  left: -2px;
  color: rgba(47, 42, 34, 0.46);
}

.site-footer button:hover,
.site-footer button:focus-visible {
  color: var(--green-dark);
  background: rgba(47, 111, 91, 0.1);
  text-decoration: underline;
  outline: 2px solid rgba(47, 111, 91, 0.18);
  outline-offset: 2px;
}

.footer-info-card {
  width: min(780px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
}

.footer-info-content {
  color: var(--ink-soft);
  line-height: 1.6;
  white-space: normal;
}

.footer-info-content :is(h3, h4, p, ul, ol) {
  margin-top: 0;
}

.footer-info-content :is(p, ul, ol) {
  margin-bottom: 0.85em;
}

.footer-info-content :is(ul, ol) {
  padding-left: 1.35rem;
}

.footer-info-content a {
  color: var(--green-dark);
  font-weight: 850;
}

.admin-footer-text-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-footer-text-grid label {
  min-width: 0;
}

.collections-page-view {
  display: none;
}

.collections-page-view.active {
  display: grid;
  gap: 18px;
}

.collections-page-head,
.collections-filters,
.collection-card,
.collections-empty {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.95), rgba(251, 241, 220, 0.72)),
    var(--paper-texture);
  border-color: rgba(130, 96, 43, 0.2);
}

.collections-page-head {
  padding: clamp(24px, 3.5vw, 46px);
}

.collections-page-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.3rem, 5vw, 4.8rem);
  line-height: 0.98;
}

.collections-page-head p {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.1vw, 1.16rem);
  line-height: 1.55;
}

.collections-filter-toggle {
  display: none;
  justify-content: center;
  width: 100%;
}

.collections-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) repeat(6, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.collections-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.collections-filters input,
.collections-filters select {
  min-width: 0;
  min-height: 42px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-transform: none;
}

.collections-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.collection-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(48, 40, 31, 0.08);
}

.collection-card.active {
  border-color: rgba(47, 111, 91, 0.42);
  box-shadow:
    0 12px 28px rgba(48, 40, 31, 0.1),
    0 0 0 3px rgba(47, 111, 91, 0.08);
}

.collection-card-cover {
  min-width: 0;
  aspect-ratio: 16 / 7;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(47, 111, 91, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 18%, rgba(217, 139, 157, 0.22), transparent 28%),
    radial-gradient(circle at 20% 80%, rgba(183, 139, 50, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(47, 111, 91, 0.1), rgba(40, 87, 120, 0.12)),
    #fffdf7;
}

.collection-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collection-card-body {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.collection-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.collection-card-type,
.collection-card-updated {
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.collection-card-type {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid rgba(181, 93, 63, 0.2);
  border-radius: 999px;
  background: rgba(181, 93, 63, 0.1);
  color: var(--terracotta);
  text-transform: uppercase;
}

.collection-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.36rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.collection-card p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.collection-card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.collection-card-meta div {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(130, 96, 43, 0.14);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.5);
}

.collection-card-meta dt,
.collection-card-meta dd {
  margin: 0;
}

.collection-card-meta dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.collection-card-meta dd {
  min-width: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.collection-card button {
  justify-self: start;
  margin-top: 2px;
  max-width: 100%;
  white-space: normal;
}

.collections-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px;
  color: var(--muted);
  font-weight: 780;
}

.lexicon-page-view {
  display: none;
}

.lexicon-page-view.active {
  display: grid;
  gap: 18px;
}

.lexicon-hero,
.lexicon-controls,
.lexicon-dictionary,
.lexicon-detail,
.lexicon-currencies {
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(247, 233, 202, 0.66)),
    var(--paper-texture);
  border-color: rgba(130, 96, 43, 0.2);
}

.lexicon-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 300px);
  gap: clamp(18px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 4vw, 52px);
}

.lexicon-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2.8rem, 6vw, 5.8rem);
  line-height: 0.92;
}

.lexicon-subtitle,
.lexicon-hero p {
  max-width: 860px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.lexicon-subtitle {
  margin: 12px 0 8px;
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  font-weight: 760;
}

.lexicon-hero-card {
  min-height: 220px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px solid rgba(130, 96, 43, 0.22);
  border-radius: 10px;
  background:
    radial-gradient(circle at 80% 18%, rgba(217, 139, 157, 0.2), transparent 25%),
    radial-gradient(circle at 18% 82%, rgba(47, 111, 91, 0.18), transparent 30%),
    rgba(255, 255, 255, 0.46);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.lexicon-hero-card span {
  color: var(--terracotta);
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.lexicon-hero-card strong {
  color: var(--ink);
  font-size: 1.3rem;
}

.lexicon-hero-card em {
  color: var(--muted);
  font-style: normal;
  font-weight: 720;
}

.lexicon-controls,
.currency-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.currency-filters {
  grid-template-columns: minmax(240px, 1.7fr) repeat(4, minmax(145px, 1fr));
  margin-top: 14px;
}

.lexicon-controls label,
.currency-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.lexicon-controls input,
.lexicon-controls select,
.currency-filters input,
.currency-filters select {
  min-width: 0;
  min-height: 42px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 650;
  text-transform: none;
}

.lexicon-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 18px;
  align-items: start;
  overflow: visible;
}

.lexicon-page-view.active,
.lexicon-dictionary,
.lexicon-workbench {
  overflow: visible;
}

.lexicon-section-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.lexicon-section-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
}

.lexicon-section-head p {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.lexicon-count {
  flex: 0 0 auto;
  padding: 5px 10px;
  color: var(--green-dark);
  background: rgba(47, 111, 91, 0.1);
  border: 1px solid rgba(47, 111, 91, 0.18);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 860;
}

.lexicon-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.lexicon-admin-action[hidden] {
  display: none;
}

.lexicon-entry-list {
  display: grid;
  gap: 18px;
}

.lexicon-letter-group {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.lexicon-letter-group h4 {
  position: sticky;
  top: var(--lexicon-sticky-top);
  margin: 0;
  color: var(--terracotta);
  font-size: 2rem;
  line-height: 1;
  font-family: Georgia, "Times New Roman", serif;
}

.lexicon-letter-items {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(130, 96, 43, 0.16);
}

.lexicon-entry-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px 12px;
  border-bottom: 1px solid rgba(130, 96, 43, 0.16);
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.lexicon-entry-row:hover,
.lexicon-entry-row:focus-visible {
  background: rgba(47, 111, 91, 0.04);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 91, 0.12);
}

.lexicon-entry-row:focus-visible {
  outline: 3px solid rgba(47, 111, 91, 0.2);
  outline-offset: 2px;
}

.lexicon-entry-row.active {
  background: rgba(47, 111, 91, 0.055);
  box-shadow: inset 0 0 0 1px rgba(47, 111, 91, 0.12);
}

.lexicon-entry-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.lexicon-entry-main h5 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.08rem, 1.5vw, 1.42rem);
  line-height: 1.15;
  font-family: Georgia, "Times New Roman", serif;
}

.lexicon-entry-main p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.52;
}

.lexicon-row-etymology {
  color: #765a1d !important;
  font-size: 0.92rem;
}

.lexicon-row-actions,
.currency-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  align-content: start;
}

.lexicon-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.lexicon-badge,
.lexicon-type,
.currency-status,
.lexicon-presence {
  width: max-content;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 860;
  line-height: 1.2;
}

.lexicon-badge {
  color: var(--green-dark);
  background: rgba(47, 111, 91, 0.12);
  border: 1px solid rgba(47, 111, 91, 0.18);
}

.lexicon-type,
.currency-status {
  color: var(--terracotta);
  background: rgba(181, 93, 63, 0.1);
  border: 1px solid rgba(181, 93, 63, 0.18);
}

.lexicon-presence {
  color: var(--blue);
  background: rgba(40, 87, 120, 0.1);
  border: 1px solid rgba(40, 87, 120, 0.16);
}

.lexicon-anchor-link {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  font-size: 0.8rem;
  font-weight: 820;
  text-decoration: none;
}

.lexicon-edit-button {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(47, 111, 91, 0.08);
}

.lexicon-detail {
  position: sticky;
  top: var(--lexicon-sticky-top);
  z-index: 6;
  display: grid;
  gap: 14px;
  align-self: start;
  max-height: calc(100vh - var(--lexicon-sticky-top) - 16px);
  overflow: auto;
  padding: 18px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.lexicon-detail.is-fixed {
  position: fixed;
  top: var(--lexicon-fixed-top);
  left: var(--lexicon-fixed-left);
  width: var(--lexicon-fixed-width);
  max-height: calc(100vh - var(--lexicon-fixed-top) - 16px);
}

.lexicon-detail-head h3 {
  margin: 10px 0 8px;
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.5rem);
  line-height: 1;
}

.lexicon-detail-head p,
.lexicon-detail section p,
.lexicon-detail li {
  color: var(--ink-soft);
  line-height: 1.55;
}

.lexicon-detail section {
  padding-top: 12px;
  border-top: 1px solid rgba(130, 96, 43, 0.16);
}

.lexicon-detail section strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.etymology-note {
  padding: 13px !important;
  border: 1px solid rgba(181, 93, 63, 0.18) !important;
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 249, 230, 0.9), rgba(247, 231, 199, 0.72)),
    var(--paper-texture);
}

.lexicon-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.lexicon-detail-list div {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(130, 96, 43, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
}

.lexicon-detail-list dt,
.lexicon-detail-list dd {
  margin: 0;
}

.lexicon-detail-list dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
}

.lexicon-detail-list dd {
  color: var(--ink);
  font-weight: 780;
}

.lexicon-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.lexicon-chip-list button,
.lexicon-direct-link {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(47, 111, 91, 0.22);
  border-radius: 999px;
  background: rgba(47, 111, 91, 0.08);
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 820;
  text-decoration: none;
}

.lexicon-inline-link {
  display: inline;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-weight: 760;
  line-height: inherit;
  text-decoration: none;
}

.lexicon-inline-link:hover,
.lexicon-inline-link:focus-visible {
  color: #173f34;
  background: rgba(47, 111, 91, 0.08);
  outline: 2px solid rgba(47, 111, 91, 0.28);
  outline-offset: 2px;
}

.lexicon-inline-popover {
  position: fixed;
  z-index: var(--z-modal-content);
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(47, 111, 91, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.98), rgba(247, 233, 202, 0.94)),
    var(--paper-texture);
  box-shadow: 0 18px 42px rgba(22, 33, 44, 0.2);
}

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

.lexicon-inline-popover strong {
  padding-right: 34px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  line-height: 1.1;
}

.lexicon-inline-popover p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}

.lexicon-popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
}

.lexicon-currencies {
  padding: 18px;
}

.currency-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.42);
}

.currency-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.currency-table th,
.currency-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(130, 96, 43, 0.12);
  text-align: left;
  vertical-align: top;
}

.currency-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(255, 248, 230, 0.72);
}

.currency-table td {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.35;
}

.currency-table td strong,
.currency-table td span {
  display: block;
}

.currency-table td strong {
  color: var(--ink);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 18px;
}

.primary-action {
  background: var(--green);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 107, 87, 0.18);
}

.primary-action:hover {
  background: var(--green-dark);
}

.secondary-action,
.file-button {
  background: #fff;
  border-color: var(--line);
}

.danger-action {
  background: #fff;
  border-color: #e5bdc4;
  color: var(--ruby);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(132px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.metric {
  position: relative;
  min-width: 0;
  min-height: 94px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  padding: 15px 13px 14px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.96), rgba(251, 241, 220, 0.64)),
    var(--paper-texture);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(48, 40, 31, 0.06);
}

.metric:is(button) {
  appearance: none;
  width: 100%;
  font: inherit;
  color: inherit;
  text-align: left;
}

.metric-clickable {
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.metric-clickable:hover,
.metric-clickable:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(47, 107, 87, 0.38);
  box-shadow: 0 12px 26px rgba(48, 40, 31, 0.13);
  outline: none;
}

.metric-copy {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.metric-value {
  display: block;
  position: relative;
  font-size: clamp(1.18rem, 1.45vw, 1.72rem);
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.metric-icon {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  margin: 0;
  color: var(--green);
  background: rgba(47, 107, 87, 0.08);
  border: 1px solid rgba(47, 107, 87, 0.14);
  border-radius: 999px;
  font-size: 0.95rem;
  line-height: 1;
}

.metric-label {
  display: block;
  position: relative;
  margin-top: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.2;
}

.overview-layout-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(118px, auto);
  gap: 14px;
  margin-top: 14px;
}

.overview-block {
  grid-column: var(--overview-x, auto) / span var(--overview-w, 1);
  grid-row: var(--overview-y, auto) / span var(--overview-h, 1);
  min-width: 0;
}

.overview-block[hidden] {
  display: none;
}

.overview-kpi-block {
  display: grid;
  gap: 14px;
}

.overview-grid {
  display: contents;
}

.overview-map-panel {
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(248, 243, 233, 0.92)),
    var(--paper-texture);
  border-color: rgba(40, 87, 120, 0.16);
}

.overview-feature-row {
  display: contents;
}

.collection-story-panel {
  background: #efe0b5;
  border-color: #cfaf60;
}

.collection-story {
  position: relative;
  min-height: 430px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 36px 38px;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 16%, rgba(121, 78, 30, 0.13) 0 1px, transparent 2px),
    radial-gradient(circle at 83% 28%, rgba(99, 49, 17, 0.11) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 76%, rgba(158, 102, 37, 0.1) 0 1.2px, transparent 2.4px),
    repeating-linear-gradient(7deg, rgba(95, 65, 24, 0.045) 0 1px, transparent 1px 10px),
    linear-gradient(90deg, rgba(116, 68, 20, 0.16), transparent 9%, transparent 91%, rgba(116, 68, 20, 0.13)),
    #f6df9f;
  border: 1px solid rgba(119, 79, 29, 0.38);
  border-radius: 4px 7px 5px 9px;
  box-shadow:
    inset 0 0 34px rgba(107, 73, 28, 0.2),
    inset 0 0 0 1px rgba(255, 246, 212, 0.45),
    0 14px 26px rgba(73, 47, 17, 0.16);
  color: #3c2e17;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.04rem;
  line-height: 1.55;
}

.collection-story::before,
.collection-story::after {
  position: absolute;
  inset: 12px;
  content: "";
  border: 1px solid rgba(111, 80, 31, 0.18);
  pointer-events: none;
}

.collection-story::after {
  inset: auto 18px 13px 18px;
  height: 10px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(91, 59, 20, 0.18), transparent);
  filter: blur(4px);
}

.collection-story-category {
  position: relative;
  z-index: 1;
  width: max-content;
  padding: 4px 9px;
  border: 1px solid rgba(130, 96, 43, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: #6f501f;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.collection-story p {
  position: relative;
  z-index: 1;
  margin: 0;
  white-space: pre-wrap;
}

.overview-highlight-panel {
  overflow: hidden;
}

.overview-carousel {
  --carousel-gap: 16px;
  --carousel-ease: cubic-bezier(0.2, 0.78, 0.25, 1);
  min-height: clamp(430px, 42vw, 520px);
  display: grid;
  align-content: stretch;
  gap: 12px;
  overflow: hidden;
}

.overview-carousel-shell {
  position: relative;
  min-height: clamp(390px, 38vw, 470px);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.overview-carousel-viewport {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  outline: none;
}

.overview-carousel-viewport:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.2);
}

.overview-carousel-track {
  display: flex;
  gap: var(--carousel-gap);
  min-width: 0;
  transform: translateX(calc(var(--active-index, 0) * -1 * (100% + var(--carousel-gap))));
  transition: transform 560ms var(--carousel-ease);
  will-change: transform;
}

.overview-highlight-card {
  flex: 0 0 100%;
  min-width: 0;
  min-height: clamp(390px, 38vw, 470px);
  display: grid;
  grid-template-columns: minmax(220px, 42%) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(248, 244, 232, 0.92)),
    radial-gradient(circle at 10% 8%, rgba(207, 175, 96, 0.18), transparent 34%),
    #fbfaf6;
  color: var(--ink);
  text-align: left;
  box-shadow:
    0 18px 36px rgba(22, 33, 44, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.overview-highlight-card[aria-hidden="true"] {
  opacity: 0.72;
}

.overview-highlight-card:hover {
  border-color: rgba(47, 107, 87, 0.32);
}

.overview-highlight-media {
  width: 100%;
  min-width: 0;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(116, 138, 126, 0.26);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(233, 238, 232, 0.92), rgba(248, 244, 232, 0.92));
  color: var(--muted);
  font-size: clamp(2rem, 5vw, 4.6rem);
  font-weight: 900;
}

.overview-highlight-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.overview-highlight-content {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 10px;
}

.overview-highlight-badge {
  display: inline-flex;
  justify-self: start;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid rgba(130, 96, 43, 0.28);
  border-radius: 999px;
  background: rgba(246, 223, 159, 0.58);
  color: #6f501f;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.overview-highlight-card strong {
  display: block;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(1.3rem, 2vw, 2.05rem);
  line-height: 1.08;
}

.overview-highlight-meta,
.overview-highlight-content p {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.42;
}

.overview-highlight-content p {
  margin: 0;
  color: var(--ink-soft);
}

.overview-highlight-content .compact-action {
  justify-self: start;
}

.overview-highlight-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0;
}

.overview-highlight-facts div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(116, 138, 126, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.58);
}

.overview-highlight-facts dt,
.overview-highlight-facts dd {
  margin: 0;
}

.overview-highlight-facts dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.overview-highlight-facts dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 830;
}

.overview-carousel-nav {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--green);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(22, 33, 44, 0.08);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.overview-carousel-nav svg {
  width: 18px;
  height: 18px;
}

.overview-carousel-nav:hover,
.overview-carousel-nav:focus-visible {
  border-color: rgba(47, 107, 87, 0.42);
  background: #fff;
  transform: translateY(-1px);
}

.overview-carousel-nav:disabled {
  cursor: default;
  opacity: 0.42;
  transform: none;
}

.overview-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.overview-carousel-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d0d8d0;
  cursor: pointer;
  transition:
    width 220ms ease,
    background 220ms ease,
    transform 220ms ease;
}

.overview-carousel-dots button.active {
  width: 25px;
  background: var(--green);
}

.overview-carousel-dots button:focus-visible {
  outline: 2px solid rgba(47, 107, 87, 0.55);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .overview-carousel-track,
  .overview-carousel-nav,
  .overview-carousel-dots button {
    transition: none;
  }
}

@media (max-width: 980px) {
  .overview-carousel {
    min-height: 0;
  }

  .overview-carousel-shell {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .overview-carousel-viewport {
    grid-column: 1;
    grid-row: 1;
  }

  .overview-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .overview-carousel-nav:hover,
  .overview-carousel-nav:focus-visible {
    transform: translateY(calc(-50% - 1px));
  }

  .overview-carousel-nav.previous {
    left: 8px;
  }

  .overview-carousel-nav.next {
    right: 8px;
  }

  .overview-highlight-card {
    min-height: 0;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

  .overview-highlight-media {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 560px) {
  .overview-highlight-card {
    gap: 14px;
    padding: 14px;
  }

  .overview-highlight-media {
    aspect-ratio: 4 / 3;
  }

  .overview-highlight-content {
    align-content: start;
  }

  .overview-highlight-facts {
    grid-template-columns: 1fr;
  }

  .overview-carousel-nav {
    width: 38px;
    height: 38px;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(22, 33, 44, 0.06);
  padding: 18px;
}

.panel-title {
  margin-bottom: 14px;
  font-weight: 850;
}

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

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr minmax(32px, auto);
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: #e7ece6;
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  border-radius: inherit;
}

.currency-summary-table {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.currency-row {
  display: grid;
  grid-template-columns: minmax(70px, 0.7fr) minmax(130px, 1.4fr) 1fr;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1ed;
  font-size: 0.91rem;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px 180px 150px;
  gap: 10px;
  margin-bottom: 14px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--muted);
  transform: translateY(-50%);
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.search-field input {
  padding-left: 40px;
}

.book-layout {
  display: block;
}

.book-top-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.note-picker {
  margin: 0 0 14px;
  position: relative;
}

.note-picker summary {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 14px;
  border: 1px solid #cbd8cd;
  border-radius: var(--radius);
  background: #f9fbf7;
  box-shadow: 0 8px 22px rgba(22, 33, 44, 0.06);
  cursor: pointer;
  font-weight: 820;
  list-style: none;
}

.note-picker summary span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-picker summary::-webkit-details-marker {
  display: none;
}

.note-picker summary::after {
  content: "";
  justify-self: center;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.note-picker[open] summary::after {
  transform: rotate(225deg);
}

#notePickerCount {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 760;
}

.note-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  max-height: 350px;
  overflow: auto;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 34px rgba(22, 33, 44, 0.1);
}

.note-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.note-card.active {
  border-color: var(--green);
  box-shadow: inset 4px 0 0 var(--green);
}

.mini-note,
.banknote-art {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(36, 79, 117, 0.12), transparent 45%),
    linear-gradient(45deg, rgba(143, 51, 69, 0.1), transparent 55%),
    var(--paper);
  border: 1px solid var(--paper-edge);
}

.mini-note {
  height: 48px;
  display: grid;
  place-items: center;
}

.mini-note::after,
.banknote-art::after {
  content: "";
  position: absolute;
  inset: 9px;
  z-index: 2;
  border: 1px solid rgba(22, 33, 44, 0.16);
  border-radius: 4px;
  pointer-events: none;
}

.note-card-image {
  background:
    linear-gradient(45deg, rgba(130, 96, 43, 0.06) 25%, transparent 25% 75%, rgba(130, 96, 43, 0.06) 75%),
    linear-gradient(45deg, rgba(130, 96, 43, 0.06) 25%, transparent 25% 75%, rgba(130, 96, 43, 0.06) 75%),
    rgba(255, 253, 247, 0.86);
  background-position: 0 0, 6px 6px, 0 0;
  background-size: 12px 12px, 12px 12px, auto;
}

.note-card-image img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  padding: 3px;
  object-fit: contain;
}

.note-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.94rem;
}

.note-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.booklet {
  min-height: 640px;
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.4vw, 30px) clamp(88px, 7vw, 116px) 28px;
  border: 1px solid rgba(72, 45, 24, 0.35);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.12), transparent 140px),
    radial-gradient(circle at 80% 82%, rgba(53, 29, 13, 0.24), transparent 240px),
    repeating-linear-gradient(36deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 9px),
    linear-gradient(90deg, #5d3d27, #8b6846 49%, #5c3c26 51%, #876342);
  box-shadow:
    0 30px 70px rgba(22, 33, 44, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -18px 32px rgba(34, 18, 9, 0.18);
  perspective: 1900px;
}

.booklet::before {
  content: "";
  position: absolute;
  inset: 10px;
  z-index: 0;
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(20, 9, 4, 0.36), transparent 8%, transparent 92%, rgba(20, 9, 4, 0.34)),
    radial-gradient(ellipse at 50% 50%, rgba(255, 235, 186, 0.14), transparent 62%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 14px),
    #735338;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    inset 0 0 38px rgba(36, 20, 12, 0.35);
}

.booklet::after {
  content: "";
  position: absolute;
  top: 56px;
  bottom: 112px;
  left: 50%;
  z-index: 0;
  width: 86px;
  pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(27, 15, 8, 0.42), rgba(27, 15, 8, 0.12) 48%, transparent 72%);
  filter: blur(6px);
}

body.book-fullscreen-open {
  overflow: hidden;
}

.booklet.booklet-fullscreen {
  position: fixed;
  inset: clamp(8px, 2vw, 22px);
  z-index: var(--z-modal-overlay);
  min-height: auto;
  height: calc(100vh - clamp(16px, 4vw, 44px));
  overflow: auto;
  padding: clamp(14px, 2vw, 24px) clamp(54px, 6vw, 104px) 24px;
  border-radius: 22px;
  box-shadow:
    0 0 0 999vmax rgba(12, 18, 24, 0.66),
    0 34px 90px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.booklet.booklet-fullscreen .spread {
  height: min(1180px, calc(100vh - 148px));
  min-height: 620px;
}

.booklet-theme-modern {
  border-color: rgba(74, 91, 107, 0.24);
  background:
    linear-gradient(90deg, #d7dde2, #f2f5f7 49%, #cbd3da 51%, #eef2f5);
}

.booklet-theme-modern::before {
  background:
    linear-gradient(90deg, rgba(60, 72, 84, 0.18), transparent 8%, transparent 92%, rgba(60, 72, 84, 0.16)),
    #eef2f5;
}

.booklet-theme-modern .spread,
.booklet-theme-modern .page,
.booklet-theme-modern .turn-face {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent 70px),
    #f8fafb;
}

.booklet-theme-modern .region-ribbon {
  background: #2f6b87;
}

.booklet-theme-travel-journal {
  border-color: rgba(128, 88, 42, 0.32);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.18), transparent 140px),
    repeating-linear-gradient(0deg, rgba(60, 96, 128, 0.055) 0 1px, transparent 1px 28px),
    linear-gradient(90deg, #80613d, #b79a6c 49%, #765835 51%, #b28d5f);
}

.booklet-theme-travel-journal::before {
  background:
    linear-gradient(90deg, rgba(72, 46, 22, 0.28), transparent 8%, transparent 92%, rgba(72, 46, 22, 0.24)),
    repeating-linear-gradient(0deg, rgba(47, 107, 87, 0.08) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(47, 107, 87, 0.05) 0 1px, transparent 1px 24px),
    #d9c293;
}

.booklet-theme-travel-journal .spread,
.booklet-theme-travel-journal .page,
.booklet-theme-travel-journal .turn-face {
  background:
    repeating-linear-gradient(0deg, rgba(47, 107, 87, 0.075) 0 1px, transparent 1px 28px),
    var(--paper-texture),
    #f4e7c7;
}

.booklet-theme-travel-journal .region-ribbon {
  background: #8b6846;
}

.book-controls,
.spread,
.related-notes,
.empty-state {
  position: relative;
  z-index: 1;
}

.book-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.book-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px 9px;
  color: var(--green-dark);
  background: rgba(47, 107, 87, 0.1);
  border: 1px solid rgba(47, 107, 87, 0.22);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 850;
}

.book-filter-chip button {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  color: inherit;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(47, 107, 87, 0.22);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
}

.book-count {
  color: var(--muted);
  font-size: 0.92rem;
}

.spread {
  --page-stack-zone: clamp(42px, 3.3vw, 54px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  height: clamp(1180px, 78vw, 1320px);
  position: relative;
  background:
    linear-gradient(90deg, rgba(116, 76, 25, 0.2), transparent 5.5%, transparent 94.5%, rgba(116, 76, 25, 0.16)),
    var(--paper-texture),
    var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 0;
  overflow: visible;
  transform-style: preserve-3d;
  box-shadow:
    0 18px 38px rgba(22, 33, 44, 0.18),
    -18px 0 18px -24px rgba(61, 37, 19, 0.32),
    18px 0 18px -24px rgba(61, 37, 19, 0.32);
}

.spread::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 4;
  width: 72px;
  pointer-events: none;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, transparent, rgba(45, 28, 15, 0.28) 38%, rgba(255, 255, 255, 0.3) 50%, rgba(45, 28, 15, 0.28) 62%, transparent),
    radial-gradient(ellipse at center, rgba(30, 18, 10, 0.22), transparent 72%);
  mix-blend-mode: multiply;
}

.page {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  padding: clamp(18px, 2.2vw, 30px) clamp(32px, 3.4vw, 46px);
  background:
    var(--paper-texture),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 18px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 70px),
    var(--paper);
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.page-left {
  padding-left: clamp(68px, 6vw, 92px);
}

.page-right {
  padding-right: clamp(68px, 6vw, 92px);
}

.page + .page {
  border-left: 1px solid rgba(130, 96, 43, 0.24);
  background:
    var(--paper-texture),
    linear-gradient(270deg, rgba(0, 0, 0, 0.06), transparent 18px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.48), transparent 70px),
    var(--paper);
}

.book-page-heading {
  min-height: 24px;
  margin: 0 auto clamp(12px, 1.6vw, 20px);
  color: rgba(72, 45, 24, 0.72);
  font-family: var(--serif);
  font-size: clamp(0.86rem, 1.1vw, 1rem);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.25;
  text-align: center;
}

.book-page-body {
  min-width: 0;
}

.book-page-number {
  position: absolute;
  bottom: clamp(12px, 1.6vw, 18px);
  color: rgba(72, 45, 24, 0.58);
  font-family: var(--serif);
  font-size: 0.82rem;
  font-weight: 800;
  pointer-events: none;
}

.book-page-number-left {
  left: clamp(22px, 2.4vw, 34px);
}

.book-page-number-right {
  right: clamp(22px, 2.4vw, 34px);
}

.page-stack {
  position: absolute;
  top: -1px;
  bottom: -1px;
  z-index: 0;
  width: var(--page-stack-zone);
  pointer-events: none;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(226, 207, 158, 0.16)),
    repeating-linear-gradient(90deg, #fff6d9 0 8px, #e5d09a 8px 9px, #fbefd0 9px 17px, #c9ab68 17px 18px);
  box-shadow:
    inset 0 0 0 1px rgba(128, 88, 42, 0.26),
    inset 0 0 18px rgba(103, 66, 26, 0.16);
}

.page-stack-left {
  left: calc(var(--page-stack-zone) * -1);
  border-radius: 0;
  box-shadow:
    inset -10px 0 18px rgba(74, 48, 20, 0.22),
    inset 0 0 0 1px rgba(128, 88, 42, 0.26);
}

.page-stack-right {
  right: calc(var(--page-stack-zone) * -1);
  border-radius: 0;
  box-shadow:
    inset 10px 0 18px rgba(74, 48, 20, 0.22),
    inset 0 0 0 1px rgba(128, 88, 42, 0.26);
}

.page-edge-nav {
  position: absolute;
  top: -1px;
  bottom: -1px;
  z-index: 6;
  width: var(--page-stack-zone);
  border: 0;
  color: rgba(22, 33, 44, 0.66);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.72;
  transition:
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.page-edge-nav:hover {
  opacity: 1;
  color: var(--green);
  background: rgba(255, 250, 228, 0.28);
}

.page-edge-nav:disabled {
  cursor: wait;
  opacity: 0.35;
}

.spread.turn-next .page-edge-nav,
.spread.turn-prev .page-edge-nav {
  pointer-events: none;
  opacity: 0.35;
}

.page-edge-nav svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.3;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.55));
}

.page-edge-prev {
  left: calc(var(--page-stack-zone) * -1);
  border-radius: 0;
}

.page-edge-next {
  right: calc(var(--page-stack-zone) * -1);
  border-radius: 0;
}

.turn-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 7;
  width: 50%;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
}

.turn-leaf-next {
  left: 50%;
  transform-origin: left center;
  animation: turnNextSheet 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.turn-leaf-prev {
  left: 0;
  transform-origin: right center;
  animation: turnPrevSheet 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.turn-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: clamp(18px, 2.2vw, 30px) clamp(32px, 3.4vw, 46px);
  background:
    var(--paper-texture),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 70px),
    var(--paper);
  border: 1px solid rgba(130, 96, 43, 0.24);
  backface-visibility: hidden;
  box-shadow: 0 24px 45px rgba(22, 33, 44, 0.18);
}

.turn-face::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42px;
  pointer-events: none;
  opacity: 0.7;
}

.turn-face-back {
  transform: rotateY(180deg);
}

.turn-leaf-next .turn-face-front,
.turn-leaf-prev .turn-face-back {
  padding-right: clamp(68px, 6vw, 92px);
}

.turn-leaf-next .turn-face-back,
.turn-leaf-prev .turn-face-front {
  padding-left: clamp(68px, 6vw, 92px);
}

.turn-leaf-next .turn-face-front {
  background:
    var(--paper-texture),
    linear-gradient(270deg, rgba(0, 0, 0, 0.06), transparent 18px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 70px),
    var(--paper);
}

.turn-leaf-next .turn-face-front::after,
.turn-leaf-prev .turn-face-back::after {
  right: 0;
  background:
    radial-gradient(ellipse at right center, rgba(255, 255, 255, 0.56), transparent 58%),
    linear-gradient(90deg, transparent, rgba(63, 42, 22, 0.18));
  animation: curlEdgeNext 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.turn-leaf-next .turn-face-back,
.turn-leaf-prev .turn-face-front {
  background:
    var(--paper-texture),
    linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 18px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 70px),
    var(--paper);
}

.turn-leaf-prev .turn-face-back {
  background:
    var(--paper-texture),
    linear-gradient(270deg, rgba(0, 0, 0, 0.06), transparent 18px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), transparent 70px),
    var(--paper);
}

.turn-leaf-prev .turn-face-front::after,
.turn-leaf-next .turn-face-back::after {
  left: 0;
  background:
    radial-gradient(ellipse at left center, rgba(255, 255, 255, 0.56), transparent 58%),
    linear-gradient(270deg, transparent, rgba(63, 42, 22, 0.18));
  animation: curlEdgePrev 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.spread.turn-next .page-right,
.spread.turn-prev .page-left {
  animation: pageContentArrive 720ms ease both;
}

.spread.turn-next .page-left,
.spread.turn-prev .page-right {
  animation: pageContentSettle 720ms ease both;
}

@keyframes turnNextSheet {
  0% {
    transform: rotateY(0deg) translateZ(2px) skewY(0deg) scaleX(1);
    box-shadow: 0 20px 30px rgba(22, 33, 44, 0.12);
  }
  24% {
    transform: rotateY(-48deg) translateZ(18px) skewY(-0.9deg) scaleX(0.99);
    box-shadow: -20px 16px 34px rgba(22, 33, 44, 0.16);
  }
  48% {
    transform: rotateY(-104deg) translateZ(34px) skewY(-2deg) scaleX(0.965);
    box-shadow: -42px 22px 54px rgba(22, 33, 44, 0.22);
  }
  72% {
    transform: rotateY(-152deg) translateZ(18px) skewY(1.2deg) scaleX(0.985);
    box-shadow: -24px 16px 34px rgba(22, 33, 44, 0.16);
  }
  100% {
    transform: rotateY(-180deg) translateZ(1px) skewY(0deg) scaleX(1);
    box-shadow: 0 12px 20px rgba(22, 33, 44, 0.08);
  }
}

@keyframes turnPrevSheet {
  0% {
    transform: rotateY(0deg) translateZ(2px) skewY(0deg) scaleX(1);
    box-shadow: 0 20px 30px rgba(22, 33, 44, 0.12);
  }
  24% {
    transform: rotateY(48deg) translateZ(18px) skewY(0.9deg) scaleX(0.99);
    box-shadow: 20px 16px 34px rgba(22, 33, 44, 0.16);
  }
  48% {
    transform: rotateY(104deg) translateZ(34px) skewY(2deg) scaleX(0.965);
    box-shadow: 42px 22px 54px rgba(22, 33, 44, 0.22);
  }
  72% {
    transform: rotateY(152deg) translateZ(18px) skewY(-1.2deg) scaleX(0.985);
    box-shadow: 24px 16px 34px rgba(22, 33, 44, 0.16);
  }
  100% {
    transform: rotateY(180deg) translateZ(1px) skewY(0deg) scaleX(1);
    box-shadow: 0 12px 20px rgba(22, 33, 44, 0.08);
  }
}

@keyframes curlEdgeNext {
  0%,
  100% {
    width: 24px;
    opacity: 0.35;
  }
  46% {
    width: 70px;
    opacity: 0.84;
  }
}

@keyframes curlEdgePrev {
  0%,
  100% {
    width: 24px;
    opacity: 0.35;
  }
  46% {
    width: 70px;
    opacity: 0.84;
  }
}

@keyframes travelCurrentSpreadRelease {
  0%,
  34% {
    opacity: 1;
  }
  52%,
  100% {
    opacity: 0;
  }
}

@keyframes travelTargetSpreadReveal {
  0%,
  36% {
    opacity: 0;
  }
  54%,
  100% {
    opacity: 1;
  }
}

@keyframes pageContentArrive {
  0% {
    opacity: 0.25;
    transform: translateX(12px);
  }
  55% {
    opacity: 0.25;
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pageContentSettle {
  0% {
    filter: saturate(0.92);
  }
  100% {
    filter: saturate(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .turn-leaf,
  .turn-face,
  .spread.turn-next .page-right,
  .spread.turn-prev .page-left,
  .spread.turn-next .page-left,
  .spread.turn-prev .page-right {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}

.region-ribbon {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  background: var(--ruby);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.page-info {
  margin-top: 16px;
}

.note-title {
  margin: 14px 0 4px;
  font-size: clamp(1.8rem, 3vw, 3.4rem);
  line-height: 0.9;
  font-weight: 900;
}

.note-subtitle {
  color: var(--blue);
  font-size: 1.15rem;
  font-weight: 780;
}

.detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.detail {
  padding-top: 10px;
  border-top: 1px solid rgba(22, 33, 44, 0.14);
}

.detail span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.personal-note {
  margin-top: 24px;
  padding: 14px;
  border-left: 4px solid var(--gold);
  background: rgba(255, 255, 255, 0.45);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #3e4650;
}

.photo-stack {
  display: grid;
  gap: 16px;
}

.photo-frame {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.photo-frame span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.photo-image-shell {
  width: 100%;
  aspect-ratio: 2.18 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  background:
    linear-gradient(135deg, rgba(47, 107, 87, 0.08), rgba(209, 132, 55, 0.08)),
    rgba(255, 253, 246, 0.76);
  border: 1px solid rgba(130, 96, 43, 0.18);
  box-sizing: border-box;
}

.photo-image-shell img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

button.photo-image-shell {
  appearance: none;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

button.photo-image-shell:hover,
button.photo-image-shell:focus-visible {
  border-color: rgba(47, 107, 87, 0.48);
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.12);
}

button.photo-image-shell:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.42);
  outline-offset: 2px;
}

.turn-leaf .photo-image-shell {
  pointer-events: none;
}

.generic-book {
  display: grid;
  gap: 16px;
}

.generic-item-detail {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(18px, 3vw, 34px);
  min-height: 520px;
  padding: clamp(20px, 3vw, 36px);
  border: 1px solid var(--paper-edge);
  background:
    var(--paper-texture),
    linear-gradient(135deg, rgba(255, 255, 255, 0.52), rgba(251, 241, 220, 0.62)),
    var(--paper);
  box-shadow: 0 18px 38px rgba(22, 33, 44, 0.14);
}

.generic-item-media-grid {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.generic-item-media {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.generic-item-media > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.generic-item-content {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 14px;
}

.generic-item-content h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 3.5vw, 4rem);
  line-height: 0.96;
  overflow-wrap: anywhere;
}

.generic-detail-list {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.generic-note-card {
  grid-template-columns: 58px minmax(0, 1fr);
}

.generic-note-thumb {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.82);
  color: var(--green);
  font-weight: 900;
}

.generic-note-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.showcase-shell {
  min-height: auto;
  padding: clamp(16px, 2.5vw, 28px);
  overflow: visible;
  border: 1px solid rgba(207, 225, 231, 0.46);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34), rgba(177, 207, 218, 0.16)),
    rgba(248, 252, 253, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    inset 0 -18px 44px rgba(42, 73, 87, 0.08),
    0 24px 60px rgba(22, 33, 44, 0.16);
  backdrop-filter: blur(8px);
}

.showcase-shell::before,
.showcase-shell::after {
  display: none;
}

.showcase-view {
  display: grid;
  gap: clamp(18px, 2.5vw, 30px);
}

.showcase-header,
.showcase-country-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.showcase-header h3,
.showcase-country-header h4 {
  margin: 4px 0 0;
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1;
}

.showcase-header h3 {
  font-size: clamp(2rem, 4vw, 4.8rem);
}

.showcase-country-header h4 {
  font-size: clamp(1.35rem, 2.2vw, 2.2rem);
}

.showcase-header p,
.showcase-country-header span {
  margin: 0;
  color: var(--muted);
  font-weight: 850;
}

.showcase-header-meta {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: end;
  align-items: center;
  gap: 10px;
}

.showcase-sections {
  display: grid;
  gap: clamp(22px, 3vw, 38px);
}

.showcase-country-section {
  display: grid;
  gap: 12px;
}

.showcase-cabinet {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 2.5vw, 30px);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 18px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.34) 0 8%, transparent 8% 42%, rgba(255, 255, 255, 0.22) 42% 48%, transparent 48%),
    repeating-linear-gradient(0deg, transparent 0 196px, rgba(255, 255, 255, 0.48) 196px 199px, rgba(67, 94, 106, 0.18) 199px 203px),
    linear-gradient(180deg, rgba(232, 242, 245, 0.68), rgba(198, 216, 222, 0.34));
  box-shadow:
    inset 0 0 0 1px rgba(119, 158, 170, 0.22),
    inset 0 28px 72px rgba(255, 255, 255, 0.24),
    0 18px 34px rgba(22, 33, 44, 0.12);
}

.showcase-cabinet::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.42), transparent 18% 62%, rgba(255, 255, 255, 0.18) 76%, transparent),
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.32), transparent 28%);
  opacity: 0.7;
}

.showcase-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(18px, 2.4vw, 28px) clamp(14px, 2vw, 24px);
  align-items: end;
  overflow: visible;
}

.showcase-item {
  appearance: none;
  position: relative;
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: center;
  background: transparent;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}

.showcase-item:hover,
.showcase-item:focus-visible {
  z-index: 3;
  transform: scale(1.04);
  filter: none;
}

.showcase-item:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.38);
  outline-offset: 6px;
  border-radius: 12px;
}

.showcase-object {
  display: grid;
  justify-items: center;
  align-items: end;
  min-height: 148px;
}

.showcase-object-image {
  display: grid;
  place-items: end center;
  width: 100%;
  min-height: 112px;
  padding: 8px 8px 0;
}

.showcase-object-image img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 12px 12px rgba(22, 33, 44, 0.2));
}

.showcase-stand {
  width: min(112px, 72%);
  height: 24px;
  margin-top: -2px;
  border-radius: 50% 50% 12px 12px;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.44), transparent 58%),
    linear-gradient(180deg, rgba(232, 219, 186, 0.9), rgba(151, 118, 75, 0.75));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 10px 18px rgba(22, 33, 44, 0.16);
}

.showcase-item-caption {
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 10px;
  background: rgba(255, 253, 246, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.showcase-item-caption strong {
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.showcase-item-caption em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 750;
  line-height: 1.2;
}

.showcase-image-placeholder,
.generic-note-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 92px;
  padding: 10px;
  border: 1px dashed rgba(47, 107, 87, 0.32);
  border-radius: 12px;
  color: rgba(47, 107, 87, 0.8);
  background: rgba(255, 253, 246, 0.54);
  font-size: 0.82rem;
  font-weight: 850;
}

.generic-note-placeholder {
  min-height: 100%;
  border: 0;
  border-radius: 0;
  font-size: 0.66rem;
}

.showcase-empty {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 280px;
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 18px;
  background: rgba(248, 252, 253, 0.52);
  text-align: center;
}

/* These material variables make the CSS showcase ready for future texture/image/3D layers. */
.showcase-shell {
  --showcase-metal: #15191b;
  --showcase-metal-soft: #2f2b25;
  --showcase-bronze: #8a6b42;
  --showcase-bronze-dark: #4a3522;
  --showcase-glass: rgba(197, 228, 238, 0.24);
  --showcase-glass-line: rgba(255, 255, 255, 0.48);
  --showcase-back: #e8e0cd;
  --showcase-light: rgba(255, 236, 184, 0.72);
  --showcase-reflection: rgba(255, 255, 255, 0.42);
  --showcase-depth-shadow: rgba(12, 18, 24, 0.36);
  --showcase-panel-texture: none;
  --showcase-panel-texture-size: cover;
  --showcase-panel-texture-repeat: no-repeat;
  --showcase-panel-texture-opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.34);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 237, 193, 0.22), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(110, 150, 165, 0.22), transparent 32%),
    linear-gradient(135deg, rgba(30, 38, 42, 0.66), rgba(90, 76, 52, 0.22)),
    rgba(242, 247, 247, 0.36);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -28px 70px rgba(12, 18, 24, 0.16),
    0 28px 74px rgba(12, 18, 24, 0.22);
  backdrop-filter: none;
}

.showcase-country-section {
  gap: 14px;
  content-visibility: auto;
  contain-intrinsic-size: 620px;
}

.showcase-country-header {
  padding: 0 4px;
}

.showcase-country-header h4 {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(138, 107, 66, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 251, 235, 0.84), rgba(230, 214, 173, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 10px 22px rgba(12, 18, 24, 0.1);
}

.showcase-cabinet {
  isolation: isolate;
  min-height: 280px;
  padding: clamp(42px, 5vw, 68px) clamp(18px, 3vw, 36px) clamp(34px, 4vw, 54px);
  overflow: hidden;
  perspective: 1200px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 235, 174, 0.34), transparent 34%),
    linear-gradient(90deg, rgba(18, 23, 25, 0.3), transparent 10% 90%, rgba(18, 23, 25, 0.34)),
    linear-gradient(180deg, rgba(28, 34, 36, 0.94), rgba(64, 50, 33, 0.78));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 34px 62px rgba(255, 240, 198, 0.14),
    inset 0 -28px 70px rgba(0, 0, 0, 0.34),
    0 28px 48px rgba(12, 18, 24, 0.22);
  transform-style: preserve-3d;
}

.showcase-cabinet::before {
  z-index: 6;
  opacity: 0.5;
  background:
    linear-gradient(112deg, transparent 0 10%, rgba(255, 255, 255, 0.44) 11%, transparent 18% 52%, rgba(255, 255, 255, 0.24) 55%, transparent 63%),
    linear-gradient(72deg, transparent 0 70%, rgba(255, 255, 255, 0.2) 74%, transparent 83%);
  mix-blend-mode: screen;
}

.showcase-cabinet::after {
  content: "";
  position: absolute;
  inset: 16px;
  z-index: 1;
  pointer-events: none;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 24%),
    radial-gradient(circle at 50% 14%, rgba(255, 230, 169, 0.28), transparent 36%);
  box-shadow:
    inset 0 0 46px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.showcase-cabinet-back {
  position: absolute;
  inset: clamp(34px, 4vw, 54px) clamp(18px, 3vw, 34px) clamp(30px, 4vw, 48px);
  z-index: 0;
  border-radius: 16px;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.18), transparent 24%),
    radial-gradient(circle at 78% 6%, rgba(255, 232, 170, 0.12), transparent 28%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.16), transparent 18% 82%, rgba(0, 0, 0, 0.18)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 22px),
    linear-gradient(180deg, rgba(45, 54, 54, 0.78), rgba(30, 34, 32, 0.88));
  box-shadow:
    inset 0 24px 48px rgba(255, 255, 255, 0.08),
    inset 0 -30px 60px rgba(0, 0, 0, 0.2);
}

.showcase-cabinet-frame {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.showcase-cabinet-frame span {
  position: absolute;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 35%),
    linear-gradient(90deg, var(--showcase-metal), var(--showcase-bronze-dark), var(--showcase-metal));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.44),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

.showcase-frame-top,
.showcase-frame-bottom {
  right: 0;
  left: 0;
  height: 18px;
}

.showcase-frame-top {
  top: 0;
}

.showcase-frame-bottom {
  bottom: 0;
}

.showcase-frame-left,
.showcase-frame-right {
  top: 0;
  bottom: 0;
  width: 18px;
}

.showcase-frame-left {
  left: 0;
}

.showcase-frame-right {
  right: 0;
}

.showcase-lighting-layer {
  position: absolute;
  top: 18px;
  right: 26px;
  left: 26px;
  z-index: 4;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
}

.showcase-lighting-layer span {
  width: clamp(90px, 20vw, 220px);
  height: 122px;
  background: radial-gradient(ellipse at top, var(--showcase-light), rgba(255, 236, 184, 0.16) 38%, transparent 72%);
  opacity: 0.48;
}

.showcase-shelf-stack {
  position: relative;
  z-index: 3;
  display: grid;
  gap: clamp(28px, 4vw, 48px);
}

.showcase-shelf {
  position: relative;
  min-height: 230px;
  padding: clamp(26px, 3vw, 38px) clamp(12px, 2vw, 22px) 56px;
  border-radius: 15px;
  transform-style: preserve-3d;
}

.showcase-shelf::before {
  display: none;
}

.showcase-shelf-light {
  position: absolute;
  top: 0;
  right: 10%;
  left: 10%;
  z-index: 1;
  height: 92px;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 0%, rgba(255, 232, 173, 0.36), transparent 58%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 245, 210, 0.42), transparent 62%),
    radial-gradient(ellipse at 78% 0%, rgba(255, 232, 173, 0.32), transparent 58%);
  opacity: 0.46;
}

.showcase-grid {
  z-index: 2;
  grid-template-columns: repeat(auto-fit, minmax(150px, 210px));
  justify-content: center;
  align-items: end;
  gap: clamp(20px, 3vw, 34px) clamp(16px, 2.4vw, 28px);
}

.showcase-item {
  justify-self: center;
  width: min(100%, 210px);
}

.showcase-shelf-board {
  position: absolute;
  right: 8px;
  bottom: 22px;
  left: 8px;
  z-index: 2;
  height: 30px;
  border-radius: 7px 7px 14px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(180deg, #3b3127, #171b1c 58%, #080b0c);
  box-shadow:
    inset 0 1px 0 rgba(255, 247, 218, 0.28),
    inset 0 -2px 0 rgba(0, 0, 0, 0.6),
    0 18px 24px rgba(12, 18, 24, 0.28);
}

.showcase-shelf-board::before {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 100%;
  left: 16px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 169, 0.42), transparent);
}

.showcase-glass-overlay {
  position: absolute;
  inset: 18px;
  z-index: 7;
  pointer-events: none;
  border: 1px solid rgba(216, 241, 248, 0.32);
  border-radius: 16px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.18), transparent 16% 44%, rgba(255, 255, 255, 0.12) 47%, transparent 58%),
    linear-gradient(78deg, transparent 0 66%, rgba(255, 255, 255, 0.16) 69%, transparent 78%);
  box-shadow:
    inset 0 0 32px rgba(209, 236, 244, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.showcase-object {
  position: relative;
  min-height: 166px;
  perspective: 700px;
  transform-style: preserve-3d;
}

.showcase-object-spot {
  position: absolute;
  top: 10px;
  left: 50%;
  z-index: 0;
  width: 128px;
  height: 120px;
  pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 233, 180, 0.22), transparent 68%);
  opacity: 0.7;
}

.showcase-object-image {
  position: relative;
  z-index: 2;
  width: auto;
  max-width: 100%;
  min-height: 124px;
  background: transparent;
  transform: translateZ(22px);
}

.showcase-item-flat .showcase-object-image img {
  max-height: 112px;
  transform: rotateX(4deg) translateY(3px);
  transform-origin: center bottom;
  border-radius: 4px;
}

.showcase-item-object .showcase-object-image img {
  max-height: 128px;
}

.showcase-object-image img {
  filter: none;
}

.showcase-contact-shadow {
  position: relative;
  z-index: 1;
  width: min(118px, 78%);
  height: 20px;
  margin-top: -14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.1) 50%, transparent 72%);
}

.showcase-stand {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(124px, 76%);
  height: 34px;
  margin-top: -12px;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.showcase-stand-top,
.showcase-stand-face {
  grid-area: 1 / 1;
  display: block;
}

.showcase-stand-top {
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5), transparent 58%),
    linear-gradient(180deg, #d8c392, #82633c);
  transform: translateY(0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.showcase-stand-face {
  height: 24px;
  margin-top: 9px;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(180deg, #7d6340, #372819);
  clip-path: ellipse(50% 80% at 50% 0%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
}

.showcase-item:hover .showcase-object-spot,
.showcase-item:focus-visible .showcase-object-spot {
  opacity: 1;
  transform: translateX(-50%) scale(1.08);
}

.showcase-item-caption {
  position: relative;
  z-index: 3;
  overflow: hidden;
  border-color: rgba(83, 53, 23, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 236, 180, 0.22), transparent 34%),
    repeating-linear-gradient(90deg, rgba(91, 55, 24, 0.16) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, rgba(132, 84, 39, 0.92), rgba(60, 37, 20, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 243, 205, 0.24),
    inset 0 -14px 24px rgba(0, 0, 0, 0.22),
    0 8px 16px rgba(12, 18, 24, 0.16);
}

.showcase-item-caption::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--showcase-panel-texture);
  background-size: var(--showcase-panel-texture-size);
  background-repeat: var(--showcase-panel-texture-repeat);
  background-position: center;
  opacity: var(--showcase-panel-texture-opacity);
  mix-blend-mode: multiply;
}

.showcase-item-caption strong,
.showcase-item-caption em {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.showcase-item-caption strong {
  color: #fff7df;
}

.showcase-item-caption em {
  color: rgba(255, 247, 223, 0.78);
}

.showcase-image-placeholder {
  width: min(116px, 100%);
  min-height: 76px;
  padding: 8px;
  border-color: rgba(255, 231, 176, 0.28);
  color: rgba(255, 246, 220, 0.74);
  background: transparent;
  font-size: 0.72rem;
}

.showcase-shell .showcase-shelf,
.showcase-shell .showcase-grid,
.showcase-shell .showcase-item,
.showcase-shell .showcase-object,
.showcase-shell .showcase-object-image {
  background: transparent !important;
}

.showcase-shell .showcase-image-placeholder {
  background: transparent !important;
}

.travel-journal-shell {
  --travel-font: "Segoe Print", "Comic Sans MS", var(--serif);
  padding: clamp(18px, 3vw, 34px);
  overflow: visible;
  border-color: rgba(126, 92, 50, 0.24);
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 255, 255, 0.34), transparent 180px),
    linear-gradient(135deg, rgba(126, 92, 50, 0.22), rgba(238, 223, 190, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 22px 58px rgba(58, 41, 24, 0.16);
}

.travel-journal-shell::before,
.travel-journal-shell::after {
  display: none;
}

.travel-journal-shell[data-travel-background="white"] {
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 255, 255, 0.56), transparent 180px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(232, 226, 214, 0.72));
}

.travel-journal-shell[data-travel-background="paper"] {
  background:
    repeating-linear-gradient(0deg, rgba(74, 122, 151, 0.06) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(126, 92, 50, 0.045) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, #f5e4bd, #dbc18e);
}

.travel-journal-view {
  position: relative;
  z-index: 1;
  display: grid;
  gap: clamp(22px, 3vw, 34px);
}

.travel-journal-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
  border: 1px solid rgba(121, 82, 39, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(255, 250, 239, 0.86), rgba(246, 231, 196, 0.72));
  box-shadow: 0 14px 32px rgba(75, 50, 24, 0.12);
}

.travel-journal-header span,
.travel-page-header span,
.travel-page-header em {
  color: rgba(89, 62, 34, 0.66);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.travel-journal-header h3,
.travel-page-header h4 {
  margin: 0;
  color: var(--ink);
  font-family: var(--travel-font);
  letter-spacing: 0;
}

.travel-journal-header h3 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.travel-journal-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.travel-journal-meta p {
  margin: 0;
  color: rgba(61, 47, 33, 0.74);
  font-weight: 850;
}

.travel-add-item-button {
  justify-self: end;
  min-height: 34px;
  padding: 7px 12px;
  color: rgba(73, 49, 25, 0.86);
  border: 1px solid rgba(126, 92, 50, 0.24);
  border-radius: 10px 12px 9px 14px;
  background:
    linear-gradient(135deg, rgba(255, 244, 194, 0.94), rgba(242, 214, 126, 0.88));
  box-shadow:
    0 10px 18px rgba(83, 53, 23, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.68);
  font-family: var(--travel-font);
  font-weight: 900;
  cursor: pointer;
  transform: rotate(-1.5deg);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease;
}

.travel-add-item-button:hover,
.travel-add-item-button:focus-visible {
  transform: rotate(-1.5deg) translateY(-2px);
  box-shadow:
    0 14px 24px rgba(83, 53, 23, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

.travel-add-item-button:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.34);
  outline-offset: 3px;
}

.travel-journal-pages {
  display: grid;
  gap: clamp(24px, 4vw, 42px);
}

.travel-journal-stage {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: clamp(8px, 1.6vw, 18px) clamp(58px, 6vw, 86px) clamp(54px, 4.5vw, 72px);
}

.travel-journal-spread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  width: min(1180px, 100%);
  min-width: 920px;
  min-height: clamp(560px, 58vw, 740px);
  isolation: isolate;
  perspective: 1900px;
  perspective-origin: 50% 48%;
  transform-style: preserve-3d;
  filter: drop-shadow(0 28px 42px rgba(58, 41, 24, 0.22));
}

.travel-spread-page-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  pointer-events: none;
}

.travel-spread-current-layer {
  pointer-events: auto;
}

.travel-spread-target-layer {
  opacity: 0;
}

.travel-spread-turning .travel-spread-current-layer {
  animation: travelCurrentSpreadRelease 720ms ease both;
}

.travel-spread-turning .travel-spread-target-layer {
  animation: travelTargetSpreadReveal 720ms ease both;
}

.travel-cover-board,
.travel-page-depth {
  position: absolute;
  pointer-events: none;
}

.travel-cover-board {
  inset: -20px -34px -28px;
  z-index: 0;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(90deg, #12100d, #28221a 50%, #12100d);
  box-shadow:
    0 36px 52px rgba(26, 18, 10, 0.3),
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -12px 28px rgba(0, 0, 0, 0.38);
}

.travel-cover-board::after {
  content: "";
  position: absolute;
  inset: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
}

.travel-page-depth {
  top: 10px;
  bottom: -13px;
  z-index: 1;
  width: calc(50% - 12px);
  border-radius: 24px 9px 9px 24px;
  background:
    repeating-linear-gradient(180deg, rgba(255, 250, 232, 0.96) 0 6px, rgba(214, 190, 139, 0.86) 6px 7px),
    linear-gradient(135deg, rgba(255, 253, 246, 0.96), rgba(229, 207, 161, 0.92));
  box-shadow:
    0 12px 24px rgba(74, 48, 20, 0.16),
    inset 0 0 0 1px rgba(128, 88, 42, 0.2);
}

.travel-page-depth-left {
  left: -12px;
  transform: translateZ(-3px) rotate(-0.3deg);
}

.travel-page-depth-right {
  right: -12px;
  border-radius: 9px 24px 24px 9px;
  transform: translateZ(-3px) rotate(0.3deg);
}

.travel-edge-nav {
  position: absolute;
  top: 50%;
  z-index: 8;
  display: grid;
  place-items: center;
  width: clamp(44px, 4.2vw, 58px);
  height: clamp(58px, 5.2vw, 76px);
  padding: 0;
  border: 1px solid rgba(126, 92, 50, 0.28);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 253, 246, 0.94), rgba(236, 218, 177, 0.9));
  color: rgba(83, 53, 23, 0.82);
  box-shadow:
    0 16px 32px rgba(58, 41, 24, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transform: translateY(-50%);
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.travel-edge-nav svg {
  width: 24px;
  height: 24px;
}

.travel-edge-prev {
  left: clamp(8px, 1.8vw, 24px);
}

.travel-edge-next {
  right: clamp(8px, 1.8vw, 24px);
}

.travel-edge-nav:hover,
.travel-edge-nav:focus-visible {
  transform: translateY(-50%) scale(1.04);
  box-shadow:
    0 20px 38px rgba(58, 41, 24, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.travel-edge-nav:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.34);
  outline-offset: 4px;
}

.travel-edge-nav:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  transform: translateY(-50%);
}

.travel-journal-stage-turning .travel-edge-nav,
.travel-journal-stage-turning .travel-photo-item {
  pointer-events: none;
}

.travel-spread-turning .travel-edge-nav,
.travel-spread-turning .travel-alpha-tab,
.travel-spread-turning .travel-photo-item {
  pointer-events: none;
}

.travel-album-page {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(12px, 1.7vw, 18px);
  min-height: 100%;
  padding: clamp(24px, 3.4vw, 44px);
  overflow: visible;
  border: 1px solid rgba(126, 92, 50, 0.14);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.92), transparent 150px),
    repeating-linear-gradient(0deg, rgba(42, 108, 134, 0.032) 0 1px, transparent 1px 26px),
    linear-gradient(135deg, rgba(255, 254, 250, 0.99), rgba(246, 236, 214, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.58),
    inset 0 -26px 40px rgba(103, 73, 38, 0.05);
}

.travel-turn-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 14;
  width: 50%;
  pointer-events: none;
  transform-style: preserve-3d;
  transform-box: border-box;
  will-change: transform;
  filter: drop-shadow(0 26px 34px rgba(58, 41, 24, 0.24));
}

.travel-turn-leaf-next {
  left: 50%;
  transform-origin: left center;
  animation: turnNextSheet 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.travel-turn-leaf-prev {
  left: 0;
  transform-origin: right center;
  animation: turnPrevSheet 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.travel-turn-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  backface-visibility: hidden;
  box-shadow:
    0 30px 50px rgba(58, 41, 24, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.travel-turn-face-back {
  transform: rotateY(180deg);
}

.travel-turn-face .travel-album-page {
  width: 100%;
  height: 100%;
  min-height: 100%;
  transform: none;
  filter: none;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}

.travel-turn-face .travel-photo-item {
  pointer-events: none;
}

.travel-turn-face-front {
  z-index: 2;
}

.travel-turn-face-back {
  z-index: 1;
}

.travel-turn-leaf-next .travel-turn-face-front .travel-album-page,
.travel-turn-leaf-prev .travel-turn-face-back .travel-album-page {
  border-radius: 8px 26px 26px 8px;
}

.travel-turn-leaf-prev .travel-turn-face-front .travel-album-page,
.travel-turn-leaf-next .travel-turn-face-back .travel-album-page {
  border-radius: 26px 8px 8px 26px;
}

.travel-turn-face::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52px;
  pointer-events: none;
  opacity: 0.62;
}

.travel-turn-leaf-next .travel-turn-face-front::after,
.travel-turn-leaf-prev .travel-turn-face-back::after {
  right: 0;
  background:
    radial-gradient(ellipse at right center, rgba(255, 255, 255, 0.62), transparent 58%),
    linear-gradient(90deg, transparent, rgba(70, 44, 22, 0.2));
  animation: curlEdgeNext 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.travel-turn-leaf-prev .travel-turn-face-front::after,
.travel-turn-leaf-next .travel-turn-face-back::after {
  left: 0;
  background:
    radial-gradient(ellipse at left center, rgba(255, 255, 255, 0.62), transparent 58%),
    linear-gradient(270deg, transparent, rgba(70, 44, 22, 0.2));
  animation: curlEdgePrev 720ms cubic-bezier(0.18, 0.68, 0.2, 1) both;
}

.travel-album-page-left {
  border-radius: 26px 8px 8px 26px;
  transform: perspective(1400px) rotateY(1.2deg);
  transform-origin: right center;
}

.travel-album-page-right {
  grid-template-rows: auto minmax(0, 1fr);
  border-radius: 8px 26px 26px 8px;
  transform: perspective(1400px) rotateY(-1.2deg);
  transform-origin: left center;
}

.travel-album-page-left::after,
.travel-album-page-right::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 34px;
  pointer-events: none;
  z-index: 1;
}

.travel-album-page-left::after {
  right: -1px;
  background: linear-gradient(90deg, transparent, rgba(92, 63, 34, 0.16));
}

.travel-album-page-right::after {
  left: -1px;
  background: linear-gradient(90deg, rgba(92, 63, 34, 0.16), transparent);
}

.travel-journal-shell[data-travel-background="white"] .travel-album-page {
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 1), transparent 150px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.99), rgba(246, 248, 248, 0.98));
}

.travel-journal-shell[data-travel-background="paper"] .travel-album-page {
  background:
    repeating-linear-gradient(0deg, rgba(42, 108, 134, 0.052) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(126, 92, 50, 0.032) 0 1px, transparent 1px 26px),
    linear-gradient(135deg, rgba(252, 240, 214, 0.99), rgba(236, 215, 174, 0.98));
}

.travel-ring-binding {
  position: absolute;
  top: clamp(28px, 4vw, 46px);
  bottom: clamp(28px, 4vw, 46px);
  left: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 42px;
  transform: translateX(-50%);
  pointer-events: none;
}

.travel-ring-binding::before {
  content: "";
  position: absolute;
  inset: 0 17px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(83, 53, 23, 0.24), rgba(255, 255, 255, 0.52), rgba(83, 53, 23, 0.24));
  box-shadow: 0 0 18px rgba(83, 53, 23, 0.16);
}

.travel-ring-binding span {
  position: relative;
  display: block;
  width: 42px;
  height: 28px;
  border: 3px solid rgba(126, 92, 50, 0.58);
  border-left-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.26);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.55),
    0 4px 10px rgba(83, 53, 23, 0.18);
}

.travel-album-page .travel-page-header,
.travel-album-page .travel-page-note,
.travel-album-page .travel-page-side-note {
  position: relative;
  z-index: 2;
}

.travel-page-side-note {
  justify-self: end;
  align-self: start;
  display: grid;
  gap: 2px;
  min-width: 118px;
  padding: 12px 14px;
  color: rgba(83, 53, 23, 0.7);
  border: 1px solid rgba(83, 53, 23, 0.12);
  border-radius: 10px 12px 9px 14px;
  background: rgba(255, 247, 218, 0.82);
  box-shadow: 0 10px 18px rgba(83, 53, 23, 0.08);
  transform: rotate(2.4deg);
}

.travel-page-side-note-editable {
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.travel-page-side-note-editable:hover,
.travel-page-side-note-editable:focus-visible {
  border-color: rgba(47, 107, 87, 0.34);
  box-shadow: 0 14px 24px rgba(83, 53, 23, 0.14);
  transform: rotate(2.4deg) translateY(-2px);
}

.travel-page-side-note-editable:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.3);
  outline-offset: 3px;
}

.travel-page-side-note span {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.travel-page-side-note strong {
  font-family: var(--travel-font);
  font-size: 1.25rem;
  line-height: 1;
}

.travel-page-side-note-content {
  display: grid;
  gap: 4px;
  max-width: 18ch;
}

.travel-page-side-note-content > * {
  margin: 0;
}

.travel-page-side-note-content p,
.travel-page-side-note-content li {
  font-size: 0.9rem;
  line-height: 1.25;
}

.travel-page-side-note-content ul,
.travel-page-side-note-content ol {
  padding-left: 1.1em;
}

.travel-page-side-note small {
  color: rgba(83, 53, 23, 0.48);
  font-size: 0.66rem;
  font-weight: 850;
}

.travel-note-empty {
  color: rgba(83, 53, 23, 0.48);
  font-style: italic;
}

.travel-page-side-note-editor {
  width: min(230px, 100%);
  transform: rotate(1.2deg);
}

.travel-page-side-note-editor textarea {
  width: 100%;
  min-height: 112px;
  padding: 9px;
  border: 1px solid rgba(83, 53, 23, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 246, 0.82);
  color: rgba(43, 34, 24, 0.92);
  font: inherit;
  resize: vertical;
}

.travel-note-editor-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.travel-sticker {
  position: absolute;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  color: rgba(47, 107, 87, 0.52);
  border: 2px solid rgba(47, 107, 87, 0.24);
  font-family: var(--serif);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.travel-sticker-route {
  right: clamp(18px, 3vw, 36px);
  bottom: clamp(18px, 3vw, 34px);
  width: 86px;
  height: 44px;
  border-radius: 50%;
  transform: rotate(-8deg);
}

.travel-journal-page {
  position: relative;
  display: grid;
  gap: clamp(16px, 2.6vw, 26px);
  min-height: 420px;
  padding: clamp(22px, 4vw, 42px);
  overflow: visible;
  border: 1px solid rgba(126, 92, 50, 0.16);
  border-radius: 28px 24px 30px 22px;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.72), transparent 160px),
    repeating-linear-gradient(0deg, rgba(42, 108, 134, 0.04) 0 1px, transparent 1px 26px),
    linear-gradient(135deg, rgba(255, 253, 246, 0.96), rgba(246, 234, 207, 0.94));
  box-shadow:
    0 18px 42px rgba(75, 50, 24, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.travel-journal-shell[data-travel-background="white"] .travel-journal-page {
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.9), transparent 160px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 246, 0.94));
}

.travel-journal-shell[data-travel-background="paper"] .travel-journal-page {
  background:
    repeating-linear-gradient(0deg, rgba(42, 108, 134, 0.06) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(126, 92, 50, 0.045) 0 1px, transparent 1px 26px),
    linear-gradient(135deg, rgba(250, 237, 205, 0.98), rgba(231, 207, 160, 0.96));
}

.travel-journal-page::before,
.travel-journal-page::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.travel-journal-page::before {
  top: 16px;
  right: clamp(24px, 5vw, 54px);
  width: 78px;
  height: 20px;
  border-radius: 999px;
  background: rgba(227, 198, 128, 0.44);
  box-shadow: 0 2px 10px rgba(83, 53, 23, 0.12);
  transform: rotate(3deg);
}

.travel-journal-page::after {
  right: 24px;
  bottom: 20px;
  width: 92px;
  height: 1px;
  background: rgba(83, 53, 23, 0.22);
  transform: rotate(-4deg);
}

.travel-page-header {
  display: grid;
  gap: 4px;
  max-width: 680px;
}

.travel-page-header h4 {
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.9;
}

.travel-page-note {
  max-width: 44ch;
  margin: 0;
  color: rgba(71, 54, 38, 0.72);
  font-family: var(--travel-font);
  font-weight: 750;
  transform: rotate(-1deg);
}

.travel-page-number {
  position: absolute;
  bottom: clamp(14px, 2vw, 24px);
  z-index: 3;
  color: rgba(83, 53, 23, 0.48);
  font-family: var(--travel-font);
  font-size: 0.82rem;
  font-weight: 850;
  pointer-events: none;
}

.travel-page-number-left {
  left: clamp(22px, 3vw, 38px);
}

.travel-page-number-right {
  right: clamp(22px, 3vw, 38px);
}

.travel-journal-shell[data-travel-font="script"] {
  --travel-font: "Segoe Script", "Bradley Hand ITC", cursive;
}

.travel-journal-shell[data-travel-font="comic"] {
  --travel-font: "Comic Sans MS", "Segoe Print", cursive;
}

.travel-journal-shell[data-travel-font="georgia"] {
  --travel-font: Georgia, serif;
}

.travel-journal-shell[data-travel-font="garamond"] {
  --travel-font: Garamond, "Times New Roman", serif;
}

.travel-journal-shell[data-travel-font="serif"] {
  --travel-font: var(--serif);
}

.travel-journal-shell[data-travel-font="trebuchet"] {
  --travel-font: "Trebuchet MS", Arial, sans-serif;
}

.travel-journal-shell[data-travel-font="courier"] {
  --travel-font: "Courier New", Courier, monospace;
}

.travel-journal-shell[data-travel-font="soft"] {
  --travel-font: Inter, ui-sans-serif, system-ui, sans-serif;
}

.travel-journal-shell[data-travel-font="site"] {
  --travel-font: inherit;
}

.travel-photo-board {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 34px);
  padding: clamp(8px, 1.5vw, 18px) 0 8px;
}

.travel-album-page .travel-photo-board {
  align-content: center;
  min-height: 0;
  padding-top: 4px;
}

.travel-photo-board-right {
  align-content: start;
}

.travel-journal-shell[data-travel-density="airy"] .travel-photo-board {
  gap: clamp(26px, 4vw, 48px);
}

.travel-journal-shell[data-travel-density="dense"] .travel-photo-board {
  gap: clamp(12px, 2vw, 22px);
}

.travel-photo-item {
  --travel-rotate: 0deg;
  --travel-offset-y: 0px;
  --travel-tape-rotate: 0deg;
  position: relative;
  display: grid;
  gap: 10px;
  width: clamp(150px, 18vw, 230px);
  padding: 10px 10px 14px;
  color: inherit;
  text-align: left;
  background: #fffdf7;
  border: 1px solid rgba(93, 63, 32, 0.12);
  border-radius: 8px;
  box-shadow:
    0 16px 26px rgba(75, 50, 24, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.74);
  transform: translateY(var(--travel-offset-y)) rotate(var(--travel-rotate));
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.travel-photo-open {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.travel-photo-edit {
  justify-self: start;
  margin-bottom: 2px;
  padding: 5px 9px;
  border: 1px solid rgba(47, 107, 87, 0.26);
  border-radius: 999px;
  color: var(--green);
  background: rgba(255, 253, 247, 0.9);
  font-size: 0.72rem;
  font-weight: 850;
  cursor: pointer;
}

.travel-photo-edit:hover,
.travel-photo-edit:focus-visible,
.travel-photo-open:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.16);
}

.travel-journal-spread .travel-photo-item {
  width: clamp(128px, 12.4vw, 188px);
}

.travel-journal-spread .travel-photo-small {
  width: clamp(118px, 11.3vw, 166px);
}

.travel-journal-spread .travel-photo-large {
  width: clamp(148px, 14.2vw, 214px);
}

.travel-photo-small {
  width: clamp(138px, 16vw, 204px);
}

.travel-photo-large {
  width: clamp(174px, 20vw, 258px);
}

.travel-photo-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 62px;
  height: 20px;
  border-radius: 3px;
  background: rgba(228, 203, 146, 0.58);
  box-shadow: 0 2px 8px rgba(83, 53, 23, 0.1);
  transform: translateX(-50%) rotate(var(--travel-tape-rotate));
  pointer-events: none;
}

.travel-photo-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgba(236, 228, 210, 0.8), rgba(255, 255, 255, 0.9));
}

.travel-photo-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 7px 10px rgba(12, 18, 24, 0.12));
}

.travel-photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 128px;
  padding: 10px;
  color: rgba(83, 53, 23, 0.58);
  border: 1px dashed rgba(83, 53, 23, 0.18);
  border-radius: 5px;
  background: rgba(83, 53, 23, 0.04);
  font-size: 0.78rem;
  font-weight: 850;
  text-align: center;
}

.travel-photo-caption {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.travel-photo-caption strong {
  color: rgba(43, 34, 24, 0.92);
  font-family: var(--serif);
  font-size: 1rem;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.travel-photo-caption em {
  color: rgba(71, 54, 38, 0.66);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.travel-photo-item:hover,
.travel-photo-item:focus-visible {
  z-index: 4;
  box-shadow:
    0 22px 34px rgba(75, 50, 24, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.82);
  transform: translateY(calc(var(--travel-offset-y) - 4px)) rotate(var(--travel-rotate)) scale(1.035);
}

.travel-photo-item:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.38);
  outline-offset: 5px;
}

.travel-journal-empty {
  display: grid;
  place-items: center;
  min-height: 320px;
  gap: 8px;
  padding: 36px;
  color: rgba(71, 54, 38, 0.74);
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(42, 108, 134, 0.045) 0 1px, transparent 1px 26px),
    rgba(255, 253, 246, 0.86);
  border: 1px dashed rgba(126, 92, 50, 0.22);
  border-radius: 24px;
}

.travel-empty-note {
  align-self: center;
  justify-self: center;
  max-width: 24ch;
  padding: 14px 16px;
  color: rgba(83, 53, 23, 0.58);
  border: 1px dashed rgba(83, 53, 23, 0.16);
  border-radius: 12px;
  background: rgba(255, 253, 246, 0.52);
  font-family: var(--travel-font);
  font-weight: 750;
  text-align: center;
  transform: rotate(-2deg);
}

.travel-journal-empty .travel-add-item-button {
  justify-self: center;
  margin-top: 8px;
}

.travel-journal-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.travel-journal-navigation span {
  min-width: 86px;
  color: rgba(61, 47, 33, 0.72);
  font-weight: 900;
  text-align: center;
}

.travel-alphabet-tabs-wrap {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  pointer-events: none;
}

.travel-alphabet-tabs {
  position: absolute;
  bottom: clamp(-44px, -3vw, -30px);
  display: flex;
  gap: clamp(2px, 0.38vw, 5px);
  pointer-events: auto;
}

.travel-alphabet-tabs-left {
  left: clamp(70px, 7vw, 132px);
  right: calc(50% + clamp(38px, 4vw, 72px));
  justify-content: flex-end;
}

.travel-alphabet-tabs-right {
  left: calc(50% + clamp(38px, 4vw, 72px));
  right: clamp(70px, 7vw, 132px);
  justify-content: flex-start;
}

.travel-alpha-tab {
  --tab-hue: calc(48 + (var(--tab-index, 0) * 17));
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(24px, 2.3vw, 32px);
  height: clamp(32px, 3.2vw, 42px);
  padding: 0;
  color: rgba(48, 38, 27, 0.84);
  border: 1px solid rgba(72, 50, 24, 0.18);
  border-radius: 7px 7px 14px 14px;
  background:
    linear-gradient(180deg, hsla(var(--tab-hue), 86%, 78%, 0.96), hsla(calc(var(--tab-hue) + 8), 74%, 64%, 0.94));
  box-shadow:
    0 10px 15px rgba(58, 41, 24, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-family: var(--travel-font);
  font-size: 0.88rem;
  font-weight: 950;
  transform:
    translateY(calc(7px + (var(--side-index, 0) % 4) * 2px))
    rotate(calc(-3deg + (var(--tab-index, 0) % 5) * 1.4deg));
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.travel-alpha-tab:hover,
.travel-alpha-tab:focus-visible,
.travel-alpha-tab.active {
  filter: saturate(1.08);
  transform:
    translateY(calc(1px + (var(--side-index, 0) % 4) * 2px))
    rotate(calc(-3deg + (var(--tab-index, 0) % 5) * 1.4deg));
  box-shadow:
    0 15px 22px rgba(58, 41, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.travel-alpha-tab.active {
  color: rgba(28, 39, 34, 0.96);
  border-color: rgba(47, 107, 87, 0.42);
}

.travel-alpha-tab:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.34);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: no-preference) {
  .showcase-glass-overlay {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .travel-photo-item,
  .travel-photo-item:hover,
  .travel-photo-item:focus-visible,
  .travel-turn-leaf,
  .travel-turn-face,
  .travel-alpha-tab {
    transform: none;
    animation-duration: 1ms !important;
    transition: none;
  }
}

@keyframes showcaseGlassSweep {
  0%,
  72%,
  100% {
    opacity: 0.62;
    transform: translateX(0);
  }
  82% {
    opacity: 0.86;
    transform: translateX(10px);
  }
}

.showcase-detail-card {
  box-sizing: border-box;
  width: min(1380px, calc(100vw - 10px));
  max-height: calc(100vh - 10px);
  overflow: visible;
  padding: clamp(6px, 1vw, 12px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(34, 28, 22, 0.22);
  box-shadow: 0 30px 90px rgba(12, 18, 24, 0.38);
  backdrop-filter: none;
}

.showcase-detail-body {
  display: block;
  overflow: visible;
}

#showcaseItemModal {
  padding: 5px;
  overflow: auto;
}

.showcase-postcard {
  position: relative;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(340px, 1.16fr);
  width: min(1240px, calc((100vh - 34px) * 1.78), 100%);
  margin: 0 auto;
  gap: clamp(20px, 2.6vw, 38px);
  aspect-ratio: 1.78 / 1;
  min-height: min(660px, calc(100vh - 34px));
  padding: clamp(24px, 3.2vw, 40px);
  overflow: hidden;
  border: 1px solid rgba(132, 93, 49, 0.24);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.5), transparent 24%),
    repeating-linear-gradient(0deg, rgba(94, 73, 45, 0.045) 0 1px, transparent 1px 22px),
    linear-gradient(135deg, #fff7df, #ead6a8);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 22px 56px rgba(12, 18, 24, 0.22);
}

.showcase-postcard::before {
  content: "";
  position: absolute;
  top: clamp(22px, 4vw, 42px);
  bottom: clamp(22px, 4vw, 42px);
  left: 47.5%;
  border-left: 1px dashed rgba(83, 53, 23, 0.24);
  pointer-events: none;
}

.showcase-postcard::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(83, 53, 23, 0.08);
  border-radius: 14px;
  pointer-events: none;
}

.showcase-postcard-airmail {
  position: absolute;
  left: clamp(22px, 3vw, 38px);
  bottom: clamp(14px, 2vw, 26px);
  z-index: 2;
  color: rgba(143, 51, 69, 0.5);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transform: rotate(-1.4deg);
}

.showcase-postcard-cancel {
  position: absolute;
  top: clamp(28px, 4vw, 48px);
  right: clamp(250px, 25vw, 360px);
  z-index: 2;
  width: 108px;
  height: 52px;
  border: 2px solid rgba(47, 107, 87, 0.22);
  border-radius: 50%;
  transform: rotate(-9deg);
  pointer-events: none;
}

.showcase-postcard-cancel::before,
.showcase-postcard-cancel::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  height: 1px;
  background: rgba(47, 107, 87, 0.22);
}

.showcase-postcard-cancel::before {
  top: 17px;
}

.showcase-postcard-cancel::after {
  bottom: 17px;
}

.showcase-postcard-route {
  position: absolute;
  top: clamp(18px, 3vw, 32px);
  right: clamp(20px, 3vw, 38px);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 122px;
  height: 36px;
  color: rgba(83, 53, 23, 0.5);
  border: 1px solid rgba(83, 53, 23, 0.18);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(4deg);
}

.showcase-postcard-edit {
  position: absolute;
  top: clamp(64px, 6vw, 88px);
  right: clamp(22px, 3vw, 42px);
  z-index: 4;
  min-height: 32px;
  padding: 6px 11px;
  color: rgba(83, 53, 23, 0.78);
  border: 1px solid rgba(83, 53, 23, 0.2);
  border-radius: 999px;
  background: rgba(255, 250, 232, 0.78);
  box-shadow: 0 8px 16px rgba(83, 53, 23, 0.1);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.showcase-postcard-edit:hover,
.showcase-postcard-edit:focus-visible {
  color: rgba(34, 48, 40, 0.94);
  border-color: rgba(47, 107, 87, 0.32);
  background: rgba(255, 253, 246, 0.94);
}

.showcase-postcard-edit:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.3);
  outline-offset: 3px;
}

.showcase-postcard-message,
.showcase-postcard-address {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: clamp(12px, 2vw, 18px);
  min-width: 0;
  min-height: 0;
}

.showcase-postcard-message h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  line-height: 0.92;
  overflow-wrap: anywhere;
}

.showcase-postcard-message p {
  margin: 0;
  max-width: 52ch;
  color: rgba(61, 47, 33, 0.82);
  font-weight: 650;
  line-height: 1.52;
  white-space: normal;
  overflow-wrap: anywhere;
}

.showcase-postcard-postmark {
  position: absolute;
  right: clamp(8px, 2vw, 22px);
  bottom: clamp(8px, 2vw, 22px);
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 2px solid rgba(47, 107, 87, 0.34);
  border-radius: 50%;
  color: rgba(47, 107, 87, 0.44);
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(-12deg);
}

.showcase-postcard-address {
  grid-template-rows: auto auto minmax(0, 1fr);
  justify-items: stretch;
  padding-left: clamp(18px, 2.4vw, 34px);
}

.showcase-postcard-stamp {
  justify-self: end;
  display: grid;
  place-items: center;
  width: min(100%, 260px);
  max-height: clamp(118px, 22vh, 190px);
  aspect-ratio: 1.15 / 0.8;
  padding: 10px;
  border: 1px solid rgba(83, 53, 23, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(247, 239, 218, 0.9));
  outline: 1px dashed rgba(83, 53, 23, 0.28);
  outline-offset: -6px;
  box-shadow:
    0 10px 22px rgba(83, 53, 23, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
  transform: rotate(1.5deg);
}

.showcase-postcard-stamp-button {
  appearance: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.showcase-postcard-stamp-button:hover,
.showcase-postcard-stamp-button:focus-visible {
  transform: rotate(1.5deg) translateY(-2px);
  box-shadow:
    0 14px 24px rgba(83, 53, 23, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.76);
}

.showcase-postcard-stamp-button:focus-visible {
  outline: 3px solid rgba(47, 107, 87, 0.38);
  outline-offset: 4px;
}

.showcase-postcard-stamp img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 10px 12px rgba(12, 18, 24, 0.12));
}

.showcase-postcard-stamp .showcase-image-placeholder {
  width: min(160px, 100%);
  min-height: 82px;
  color: rgba(83, 53, 23, 0.58);
  border-color: rgba(83, 53, 23, 0.18);
  background: rgba(83, 53, 23, 0.04);
}

.showcase-postcard-to {
  color: rgba(83, 53, 23, 0.72);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.showcase-postcard-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 0;
  min-height: 0;
  overflow: visible;
}

.showcase-postcard-list div {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(83, 53, 23, 0.24);
}

.showcase-postcard-list dt {
  color: rgba(83, 53, 23, 0.58);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.showcase-postcard-list dd {
  margin: 0;
  color: rgba(43, 34, 24, 0.9);
  font-family: var(--serif);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.18;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (min-width: 761px) and (max-height: 740px) {
  .showcase-postcard {
    aspect-ratio: auto;
    min-height: 0;
  }
}

.banknote-art {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  color: var(--ink);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 900;
  text-align: center;
}

.lightbox-open {
  overflow: hidden;
}

.image-lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-overlay);
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 32px);
  background: rgba(13, 18, 24, 0.82);
  backdrop-filter: blur(4px);
}

.image-lightbox-modal[hidden] {
  display: none !important;
}

.image-lightbox {
  position: relative;
  width: min(1120px, 100%);
  max-height: min(94vh, 900px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: clamp(14px, 2vw, 22px);
  overflow: hidden;
  border: 1px solid rgba(255, 253, 246, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(255, 253, 246, 0.98), rgba(239, 233, 219, 0.96)),
    var(--paper);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

.image-lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(255, 253, 246, 0.92);
}

.image-lightbox-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  padding-right: 52px;
}

.image-lightbox-title {
  min-width: min(340px, 100%);
  display: grid;
  gap: 2px;
}

.image-lightbox-title strong {
  color: var(--ink);
  font-size: clamp(1rem, 2vw, 1.35rem);
  overflow-wrap: anywhere;
}

.image-lightbox-title span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.image-lightbox-tools {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.image-lightbox-stage {
  position: relative;
  min-height: 0;
  display: grid;
}

.image-lightbox-viewport {
  height: min(62vh, 620px);
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 20%, rgba(47, 107, 87, 0.08), transparent 30%),
    rgba(255, 253, 246, 0.72);
  cursor: zoom-in;
  touch-action: none;
}

.image-lightbox-viewport.zoomed {
  cursor: grab;
}

.image-lightbox-viewport.dragging {
  cursor: grabbing;
}

.image-lightbox-viewport img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  user-select: none;
  will-change: transform;
  transition: transform 120ms ease;
}

.image-lightbox-side {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 54px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(47, 107, 87, 0.2);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.9);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(22, 33, 44, 0.18);
  transform: translateY(-50%);
  cursor: pointer;
}

.image-lightbox-side svg {
  width: 22px;
  height: 22px;
}

.image-lightbox-side.previous {
  left: 12px;
}

.image-lightbox-side.next {
  right: 12px;
}

.image-lightbox-face-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.image-lightbox-face-tabs .active {
  border-color: rgba(47, 107, 87, 0.44);
  background: rgba(47, 107, 87, 0.13);
  color: var(--green);
}

#imageLightbox.image-lightbox-modal {
  z-index: calc(var(--z-modal-overlay) + 120);
  padding: 0;
  background: rgba(4, 7, 11, 0.88);
  backdrop-filter: blur(2px);
}

.image-lightbox-modal .image-lightbox {
  width: 100%;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  place-items: center;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.image-lightbox-modal .image-lightbox-head,
.image-lightbox-modal .image-lightbox-tools,
.image-lightbox-modal .image-lightbox-face-tabs,
.image-lightbox-modal .image-lightbox-side {
  display: none !important;
}

.image-lightbox-modal .image-lightbox-close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 5;
  color: #fffdf6;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.34);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.image-lightbox-modal .image-lightbox-close:hover,
.image-lightbox-modal .image-lightbox-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.image-lightbox-modal .image-lightbox-stage,
.image-lightbox-modal .image-lightbox-viewport {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.image-lightbox-modal .image-lightbox-stage {
  display: grid;
  place-items: center;
}

.image-lightbox-modal .image-lightbox-viewport {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.image-lightbox-modal .image-lightbox-viewport img {
  max-width: min(96vw, 1700px);
  max-height: 94vh;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.5));
  cursor: zoom-in;
}

.image-lightbox-modal .image-lightbox-viewport.zoomed img {
  cursor: grab;
}

.image-lightbox-modal .image-lightbox-viewport.dragging img {
  cursor: grabbing;
}

.conversion-card {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(47, 107, 87, 0.25);
  border-radius: var(--radius);
  background: rgba(47, 107, 87, 0.08);
}

.conversion-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: baseline;
}

.conversion-row + .conversion-row {
  padding-top: 7px;
  border-top: 1px solid rgba(47, 107, 87, 0.16);
}

.conversion-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.conversion-row strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.conversion-row.main strong {
  font-size: 1.12rem;
}

.conversion-row em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 720;
}

.rate-panel,
.qr-card {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(36, 79, 117, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.muted-panel {
  color: var(--muted);
}

.rate-panel strong,
.qr-card strong {
  display: block;
}

.rate-panel span,
.qr-card span,
.rate-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.rate-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.compact-action {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.rate-chart {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 8px;
}

.chart-grid {
  fill: none;
  stroke: rgba(22, 33, 44, 0.13);
  stroke-width: 1;
}

.chart-area {
  fill: rgba(47, 107, 87, 0.14);
  stroke: none;
}

.chart-line {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-dot {
  fill: var(--ruby);
  stroke: #fff;
  stroke-width: 2;
}

.chart-point-dot {
  fill: var(--ruby);
  stroke: none;
  stroke-width: 0;
  opacity: 0;
  transition:
    opacity 150ms ease,
    stroke-width 150ms ease;
}

.chart-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 0;
  pointer-events: all;
}

.chart-hover-line {
  opacity: 0;
  stroke: rgba(143, 51, 69, 0.32);
  stroke-width: 1.5;
  stroke-dasharray: 3 4;
  transition: opacity 150ms ease;
}

.chart-tooltip {
  opacity: 0;
  pointer-events: none;
  transition: opacity 150ms ease;
}

.chart-tooltip-bg {
  fill: #fff;
  stroke: rgba(143, 51, 69, 0.28);
  shape-rendering: crispEdges;
}

.chart-tooltip-text {
  fill: var(--ink);
  stroke: none;
  stroke-width: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 9px;
  font-weight: 560;
  letter-spacing: 0;
  dominant-baseline: middle;
  text-anchor: middle;
}

.chart-point:hover .chart-hover-line,
.chart-point:focus .chart-hover-line {
  opacity: 1;
}

.chart-point:hover .chart-point-dot,
.chart-point:focus .chart-point-dot {
  opacity: 1;
  stroke-width: 2;
}

.chart-point:hover .chart-tooltip,
.chart-point:focus .chart-tooltip {
  opacity: 1;
}

.rate-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}

.map-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(36, 79, 117, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}

.map-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.map-card-head strong {
  display: block;
}

.map-card-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.leaflet-map,
.map-image {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 778 / 450;
  background:
    linear-gradient(180deg, #eef5f1, #d8e7df),
    #fff;
  border-radius: 8px;
}

.leaflet-map {
  border: 1px solid rgba(36, 79, 117, 0.16);
  isolation: isolate;
  z-index: 0;
}

.leaflet-container {
  font: inherit;
  z-index: 0;
}

.country-count-marker {
  background: transparent;
  border: 0;
}

.country-count-marker span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--region-color, var(--ruby));
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow:
    0 4px 14px rgba(22, 33, 44, 0.32),
    0 0 0 5px color-mix(in srgb, var(--region-color, var(--ruby)) 24%, transparent);
  font-size: 0.76rem;
  font-weight: 900;
}

.country-summary-popup .leaflet-popup-content {
  width: min(300px, 72vw);
  margin: 12px;
}

.country-popup-card {
  display: grid;
  gap: 10px;
}

.country-popup-card header {
  display: grid;
  gap: 2px;
}

.country-popup-card header strong {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 900;
}

.country-popup-card header span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.country-popup-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.country-popup-stats span {
  display: grid;
  gap: 1px;
  padding: 6px;
  color: var(--muted);
  background: #f2efe6;
  border: 1px solid #ded6c4;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 760;
}

.country-popup-stats strong {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
}

.country-popup-stats .wide {
  grid-column: 1 / -1;
}

.country-popup-list {
  display: grid;
  gap: 7px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.country-popup-note {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 6px;
  color: var(--ink);
  background: #fbfaf5;
  border: 1px solid #ded6c4;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
}

.country-popup-note:hover,
.country-popup-note:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.16);
}

.country-popup-note > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.country-popup-note strong,
.country-popup-note em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.country-popup-note strong {
  font-size: 0.84rem;
  font-weight: 900;
}

.country-popup-note em {
  color: var(--muted);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 720;
}

.country-popup-thumb {
  display: grid;
  place-items: center;
  width: 54px;
  height: 32px;
  overflow: hidden;
  color: #314238;
  background:
    linear-gradient(135deg, rgba(47, 107, 87, 0.18), rgba(209, 132, 55, 0.18)),
    #fffdf7;
  border: 1px solid rgba(22, 33, 44, 0.16);
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 900;
}

.country-popup-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.world-map {
  display: block;
  min-height: 320px;
}

.overview-world-map {
  min-height: 560px;
}

.map-unavailable {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.map-unavailable strong {
  display: block;
  color: var(--ink);
}

.map-marker {
  position: absolute;
  width: 13px;
  height: 13px;
  background: var(--point-color, var(--ruby));
  border: 2px solid #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 4px 12px rgba(22, 33, 44, 0.24);
}

.map-label {
  position: absolute;
  padding: 2px 5px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(22, 33, 44, 0.08);
  transform: translateY(-50%);
  font-size: 0.7rem;
  font-weight: 850;
  white-space: nowrap;
}

.map-pulse {
  position: absolute;
  width: 26px;
  height: 26px;
  background: color-mix(in srgb, var(--point-color, var(--ruby)) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--point-color, var(--ruby)) 40%, transparent);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  animation: mapPulse 1.8s ease-out infinite;
}

@keyframes mapPulse {
  0% {
    opacity: 0.95;
    width: 12px;
    height: 12px;
  }
  100% {
    opacity: 0;
    width: 34px;
    height: 34px;
  }
}

.overview-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 18px;
  align-items: start;
}

.overview-map-point {
  position: absolute;
  width: 0;
  height: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--region-color);
  transform: translate(-50%, -50%);
}

.overview-map-bubble {
  position: absolute;
  display: block;
  left: 0;
  top: 0;
  background: color-mix(in srgb, var(--region-color) 34%, transparent);
  border: 2px solid var(--region-color);
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.overview-map-core {
  position: absolute;
  display: block;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  background: var(--region-color);
  border: 1.7px solid #fff;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.map-legend {
  display: grid;
  gap: 8px;
  align-content: start;
}

.map-legend-item {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #edf1ed;
  font-size: 0.88rem;
}

.map-legend-item span {
  width: 12px;
  height: 12px;
  background: var(--region-color);
  border-radius: 999px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--region-color) 16%, transparent);
}

.map-legend-item strong {
  overflow-wrap: anywhere;
}

.map-legend-item em {
  color: var(--muted);
  font-style: normal;
  font-weight: 750;
}

.qr-card {
  display: grid;
  grid-template-columns: 1fr 92px;
  align-items: center;
  gap: 12px;
}

.qr-card img {
  width: 92px;
  height: 92px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.presentation-mode-trial {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(47, 107, 87, 0.18);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.9);
  color: var(--ink);
}

.book-controls .presentation-mode-trial {
  flex: 1 1 320px;
  margin: 0;
}

.presentation-mode-trial.compact {
  min-width: min(100%, 360px);
  padding: 7px 9px;
}

.presentation-mode-trial.compact strong {
  font-size: 0.78rem;
}

.presentation-mode-trial.compact span {
  font-size: 0.74rem;
}

.presentation-mode-trial div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.presentation-mode-trial strong {
  font-size: 0.9rem;
}

.presentation-mode-trial span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.presentation-mode-trial label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.presentation-mode-trial select {
  min-width: 150px;
}

.presentation-mode-trial-card {
  max-width: min(520px, calc(100vw - 28px));
}

.item-qr-modal-card {
  width: min(520px, calc(100vw - 28px));
}

.item-qr-preview {
  display: grid;
  place-items: center;
  margin: 16px 0;
  padding: 18px;
  border: 1px solid rgba(36, 79, 117, 0.18);
  border-radius: 12px;
  background: #fff;
}

.item-qr-preview img {
  width: min(280px, 72vw);
  height: min(280px, 72vw);
  image-rendering: pixelated;
}

.item-qr-url-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.item-qr-url-label input {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.82rem;
}

.item-qr-status {
  min-height: 1.2em;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
}

.item-qr-actions {
  justify-content: center;
}

.showcase-postcard-qr {
  margin-top: 10px;
  justify-content: center;
}

@media (max-width: 720px) {
  .presentation-mode-trial {
    align-items: stretch;
    flex-direction: column;
  }

  .presentation-mode-trial label,
  .presentation-mode-trial select {
    width: 100%;
  }
}

.related-notes {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(255, 247, 219, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 250, 235, 0.22), rgba(61, 37, 19, 0.12)),
    rgba(72, 45, 24, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.related-notes-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #fff7df;
}

.related-notes-head span {
  color: rgba(255, 247, 223, 0.78);
  font-size: 0.78rem;
  font-weight: 820;
  text-transform: uppercase;
}

.related-notes-head strong {
  font-size: 1rem;
}

.related-note-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.related-note {
  flex: 0 0 148px;
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid rgba(216, 222, 215, 0.82);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(22, 33, 44, 0.1);
}

.related-note:hover {
  border-color: var(--green);
  transform: translateY(-1px);
}

.related-note.selected {
  border-color: var(--green);
  background:
    linear-gradient(180deg, rgba(47, 107, 87, 0.2), rgba(255, 255, 255, 0.96)),
    #fff;
  box-shadow:
    0 10px 20px rgba(22, 33, 44, 0.16),
    inset 0 0 0 3px rgba(47, 107, 87, 0.55);
}

.related-selected-label {
  min-height: 22px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  color: #fff !important;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.7rem !important;
  font-weight: 860;
}

.related-note-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1.85 / 1;
  min-height: 76px;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(47, 107, 87, 0.08), rgba(209, 132, 55, 0.08)),
    rgba(255, 253, 246, 0.78);
}

.related-note-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.related-note-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.related-note strong {
  line-height: 1.1;
}

.related-note > span:not(.related-note-art) {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-note-country {
  display: flex !important;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.related-note-flag {
  flex: 0 0 auto;
  color: inherit !important;
  font-size: 0.95rem !important;
  line-height: 1;
}

.related-note-year {
  color: var(--blue) !important;
  font-weight: 760;
}

.visibility-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.visibility-badge.public {
  color: #265f4d;
  background: rgba(47, 107, 87, 0.12);
  border: 1px solid rgba(47, 107, 87, 0.2);
}

.visibility-badge.private {
  color: #8f3345;
  background: rgba(217, 139, 157, 0.16);
  border: 1px solid rgba(143, 51, 69, 0.2);
}

.related-empty {
  margin: 0;
  color: rgba(255, 247, 223, 0.82);
  font-size: 0.92rem;
}

.empty-state {
  padding: 30px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
}

.note-form {
  display: grid;
  gap: 14px;
}

.collection-edit-panel,
.modifier-panel,
.note-launch-panel,
.data-tools-panel,
.collection-delete-panel {
  margin-bottom: 14px;
}

.modifier-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.modifier-subtabs[hidden],
.modifier-panel[hidden],
.modifier-general-panel[hidden] {
  display: none;
}

.modifier-subtabs button {
  min-height: 40px;
  padding: 9px 13px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.modifier-subtabs button.active {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.overview-config-form,
.overview-config-section {
  display: grid;
  gap: 14px;
}

.overview-config-section {
  padding: 14px;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.62);
}

.booklet-config-form {
  display: grid;
  gap: 14px;
}

.booklet-theme-grid {
  align-items: stretch;
}

.booklet-theme-preview {
  min-height: 132px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid rgba(130, 96, 43, 0.22);
  border-radius: 12px;
  background:
    var(--paper-texture),
    linear-gradient(135deg, #f6e7c4, #dfc28a);
  color: var(--ink);
  box-shadow: inset 0 0 24px rgba(83, 53, 23, 0.12);
}

.booklet-theme-preview span {
  width: 42px;
  height: 6px;
  border-radius: 999px;
  background: rgba(130, 96, 43, 0.38);
}

.booklet-theme-preview strong {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.booklet-theme-preview em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.88rem;
}

.booklet-theme-preview[data-book-theme="modern"] {
  border-color: rgba(74, 91, 107, 0.2);
  background: linear-gradient(135deg, #f8fafb, #dbe2e8);
}

.booklet-theme-preview[data-book-theme="travel-journal"] {
  background:
    repeating-linear-gradient(0deg, rgba(47, 107, 87, 0.08) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(47, 107, 87, 0.04) 0 1px, transparent 1px 22px),
    linear-gradient(135deg, #f4e7c7, #d2b279);
}

.showcase-panel-texture-editor {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.showcase-panel-texture-preview {
  --showcase-panel-texture: none;
  --showcase-panel-texture-size: cover;
  --showcase-panel-texture-repeat: no-repeat;
  --showcase-panel-texture-opacity: 0;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 134px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(83, 53, 23, 0.26);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 247, 219, 0.2), transparent 32%),
    repeating-linear-gradient(90deg, rgba(76, 46, 22, 0.14) 0 1px, transparent 1px 24px),
    linear-gradient(135deg, #76502b, #3f2817);
  color: #fff7df;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -20px 34px rgba(0, 0, 0, 0.18);
}

.showcase-panel-texture-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: var(--showcase-panel-texture);
  background-size: var(--showcase-panel-texture-size);
  background-repeat: var(--showcase-panel-texture-repeat);
  background-position: center;
  opacity: var(--showcase-panel-texture-opacity);
  mix-blend-mode: multiply;
}

.showcase-panel-texture-preview span {
  position: relative;
  z-index: 1;
  color: inherit;
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.showcase-panel-texture-controls {
  align-items: end;
}

.travel-journal-controls label {
  align-content: start;
}

.travel-journal-note-control {
  grid-column: 1 / -1;
}

.travel-journal-controls input[type="range"] {
  width: 100%;
}

.travel-journal-controls .range-value {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.field-help-text {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}

.country-match-hint:empty,
.currency-match-hint:empty {
  display: none;
}

.country-match-hint.success,
.currency-match-hint.success {
  color: var(--green-dark);
}

.country-match-hint.warning,
.currency-match-hint.warning {
  color: var(--terracotta);
}

.custom-country-editor textarea {
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.overview-config-section > div:first-child {
  display: grid;
  gap: 3px;
}

.overview-config-section > div:first-child span,
.muted-text,
.collection-creation-note {
  color: var(--muted);
}

.overview-blocks-editor {
  display: grid;
  gap: 12px;
}

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

.overview-builder-toolbar > div {
  display: grid;
  gap: 2px;
}

.overview-builder-toolbar span,
.overview-add-menu > strong + div + span {
  color: var(--muted);
}

.overview-dashboard-editor {
  --overview-row-height: 112px;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(var(--overview-editor-rows, 8), var(--overview-row-height));
  gap: 8px;
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(47, 107, 87, 0.13), rgba(130, 96, 43, 0.12)),
    #e5eadd;
  border: 1px solid rgba(47, 107, 87, 0.36);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 0 0 1px rgba(47, 107, 87, 0.08);
}

.overview-grid-cell {
  position: relative;
  z-index: 1;
  grid-column: var(--cell-x) / span 1;
  grid-row: var(--cell-y) / span 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.56), rgba(246, 240, 227, 0.5));
  border: 1px dashed rgba(47, 107, 87, 0.46);
  border-radius: 10px;
  cursor: pointer;
  color: rgba(47, 107, 87, 0.72);
  font-weight: 900;
  font-size: 1.16rem;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.overview-grid-cell:hover,
.overview-grid-cell:focus-visible {
  background: rgba(255, 253, 247, 0.84);
  border-color: rgba(47, 107, 87, 0.74);
  color: var(--green);
  transform: scale(1.015);
}

.overview-dashboard-block {
  position: relative;
  z-index: 2;
  grid-column: var(--x) / span var(--w);
  grid-row: var(--y) / span var(--h);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-content: space-between;
  gap: 7px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
  background: linear-gradient(180deg, #fffdf8, #fbf5e8);
  border: 1px solid rgba(47, 107, 87, 0.3);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(22, 33, 44, 0.13);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
  touch-action: none;
}

.overview-dashboard-block:hover,
.overview-dashboard-block:focus-within {
  background: linear-gradient(180deg, #fffefa, #f9f0dd);
  border-color: rgba(47, 107, 87, 0.48);
  box-shadow: 0 18px 38px rgba(22, 33, 44, 0.18);
}

.overview-dashboard-block.is-dragging,
.overview-dashboard-block.is-resizing {
  z-index: 8;
  border-color: rgba(47, 107, 87, 0.72);
  box-shadow: 0 24px 54px rgba(22, 33, 44, 0.26);
  opacity: 0.92;
  transform: scale(1.01);
}

.overview-dashboard-block header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.overview-dashboard-block header > .overview-block-icon {
  display: none;
}

.overview-drag-handle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: grab;
}

.overview-drag-handle:active,
.overview-editor-pointer-active .overview-drag-handle {
  cursor: grabbing;
}

.overview-block-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--green);
  background: rgba(47, 107, 87, 0.1);
  border-radius: 8px;
  font-weight: 900;
}

.overview-dashboard-block input {
  width: 100%;
  min-width: 0;
  padding: 5px 7px;
  font-weight: 850;
}

.overview-block-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.94rem;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-dashboard-block small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-dashboard-block footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  align-items: center;
  min-width: 0;
  padding-right: 12px;
}

.overview-dashboard-block footer .compact-action {
  min-width: 0;
  min-height: 30px;
  padding: 6px 7px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.overview-block-controls,
.overview-block-resize {
  display: none;
}

.overview-resize-handle {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 14px;
  height: 14px;
  padding: 0;
  background:
    linear-gradient(135deg, transparent 0 48%, rgba(47, 107, 87, 0.55) 49% 56%, transparent 57%),
    linear-gradient(135deg, transparent 0 66%, rgba(47, 107, 87, 0.55) 67% 74%, transparent 75%);
  border: 0;
  cursor: nwse-resize;
  opacity: 0.74;
}

.overview-dashboard-block:hover .overview-resize-handle,
.overview-resize-handle:focus-visible {
  opacity: 1;
}

.overview-add-menu {
  display: grid;
  gap: 9px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 9px;
}

.overview-add-menu[hidden] {
  display: none;
}

.overview-add-menu > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.overview-add-menu button[data-overview-add-block] {
  justify-content: flex-start;
  text-align: left;
}

.overview-add-menu button[data-overview-add-block] > span:last-child {
  display: grid;
  gap: 2px;
}

.overview-add-menu button[data-overview-add-block] small {
  color: var(--muted);
  font-weight: 650;
  line-height: 1.25;
}

.overview-builder-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}

.overview-block-config-card {
  width: min(780px, calc(100vw - 30px));
  max-height: min(92vh, 860px);
  overflow: auto;
}

.overview-block-config-body {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.overview-block-config-note {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: rgba(247, 242, 230, 0.72);
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 10px;
}

.overview-block-config-note span {
  color: var(--muted);
}

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

.overview-config-modal-grid small,
.form-grid small[data-overview-map-help] {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.3;
}

.overview-map-preview-shell-modal {
  max-width: 520px;
}

.overview-map-preview-modal {
  min-height: 190px;
  height: 210px;
}

.overview-records-editor-modal {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  max-height: min(42vh, 360px);
  overflow: auto;
  padding-right: 4px;
}

.overview-records-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.place-search-field {
  position: relative;
}

.place-suggestions {
  position: absolute;
  z-index: 10040;
  right: 0;
  left: 0;
  top: calc(100% + 6px);
  display: grid;
  max-height: 280px;
  overflow: auto;
  background: #fffdf8;
  border: 1px solid rgba(47, 107, 87, 0.22);
  border-radius: 9px;
  box-shadow: 0 18px 38px rgba(22, 33, 44, 0.18);
}

.place-suggestions[hidden] {
  display: none;
}

.place-suggestions button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(130, 96, 43, 0.1);
  text-align: left;
  cursor: pointer;
}

.place-suggestions button:hover,
.place-suggestions button:focus-visible {
  background: rgba(47, 107, 87, 0.08);
}

.place-suggestions button strong,
.place-suggestions button span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.place-suggestions button span,
.place-suggestion-empty {
  color: var(--muted);
  font-size: 0.82rem;
}

.place-suggestion-empty {
  padding: 10px 11px;
}

.overview-map-preview-shell {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.78);
  border: 1px solid rgba(47, 107, 87, 0.18);
  border-radius: 12px;
}

.overview-map-preview-head,
.overview-map-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.overview-map-preview-head span,
.overview-map-preview-actions span {
  color: var(--muted);
  font-size: 0.88rem;
}

.overview-map-preview {
  min-height: 210px;
  height: 230px;
  overflow: hidden;
  border: 1px solid rgba(47, 107, 87, 0.24);
  border-radius: 12px;
  background: #e7efe7;
}

.toggle-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 850;
}

.toggle-line span {
  overflow-wrap: anywhere;
}

.note-launch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-card.note-form-card {
  --note-modal-pad: 22px;
  width: min(1560px, calc(100vw - 32px));
  max-height: min(92vh, 960px);
  overflow: auto;
  padding-top: 0;
  padding-bottom: 0;
  scroll-padding-top: 96px;
  scroll-padding-bottom: 92px;
}

.note-form-card .auth-close {
  position: sticky;
  top: 12px;
  justify-self: end;
  z-index: 5;
  margin: 12px 0 -50px;
  background: rgba(255, 253, 247, 0.95);
  border-color: rgba(130, 96, 43, 0.2);
  backdrop-filter: blur(8px);
}

.note-form-card > strong,
.note-form-card > span {
  position: sticky;
  z-index: 4;
  margin-inline: calc(var(--note-modal-pad) * -1);
  padding-inline: var(--note-modal-pad) 72px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.98), rgba(255, 253, 247, 0.92)),
    var(--paper-texture);
  backdrop-filter: blur(8px);
}

.note-form-card > strong {
  top: 0;
  padding-top: 18px;
  padding-bottom: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
}

.note-form-card > span {
  top: 50px;
  padding-top: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(130, 96, 43, 0.18);
}

.note-form-card .note-form > .form-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  margin: 0 calc(var(--note-modal-pad) * -1);
  padding: 13px var(--note-modal-pad) 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(255, 253, 247, 0.98)),
    var(--paper-texture);
  border-top: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -10px 24px rgba(22, 33, 44, 0.08);
  backdrop-filter: blur(8px);
}

.collection-edit-form {
  display: grid;
  gap: 14px;
}

.modifier-general-panel .collection-edit-form > .form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}

.collection-fields-editor {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.62);
}

.collection-fields-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.collection-fields-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
}

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

.collection-field-row {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(47, 107, 87, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(248, 243, 233, 0.62)),
    var(--paper-texture);
  box-shadow: 0 8px 18px rgba(22, 33, 44, 0.06);
}

.collection-field-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(130, 96, 43, 0.14);
}

.collection-field-card-head strong {
  min-width: 0;
  color: var(--ink);
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.collection-field-card-head span {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 3px 7px;
  color: var(--green);
  background: rgba(47, 107, 87, 0.1);
  border: 1px solid rgba(47, 107, 87, 0.14);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
  text-align: center;
}

.collection-field-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(118px, 0.72fr) minmax(78px, 0.45fr);
  gap: 10px;
  min-width: 0;
}

.collection-field-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.collection-field-options label:not(.collection-field-select-options) {
  min-width: 0;
}

.field-label-text {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.field-help {
  position: relative;
  z-index: 5;
  width: 17px;
  height: 17px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: var(--green);
  background: rgba(47, 107, 87, 0.1);
  border: 1px solid rgba(47, 107, 87, 0.24);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  cursor: help;
}

.field-help::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 8px);
  width: min(260px, 74vw);
  padding: 8px 10px;
  color: #fffdf7;
  background: rgba(34, 49, 41, 0.96);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(22, 33, 44, 0.22);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.field-help:hover::after,
.field-help:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.field-help:focus-visible {
  outline: 2px solid rgba(47, 107, 87, 0.38);
  outline-offset: 2px;
}

.field-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(130, 96, 43, 0.14);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 820;
  line-height: 1.1;
  white-space: nowrap;
}

.field-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--green);
}

.field-toggle:has(input:checked) {
  color: var(--green);
  background: rgba(47, 107, 87, 0.1);
  border-color: rgba(47, 107, 87, 0.22);
}

.collection-field-select-options {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
}

.collection-field-remove {
  grid-column: 1 / -1;
  justify-self: start;
}

.collection-field-select-options.hidden {
  display: none;
}

.dynamic-item-form[hidden],
#noteForm[hidden] {
  display: none;
}

.dynamic-fields {
  display: grid;
  gap: 14px;
}

.dynamic-image-field {
  align-content: start;
}

.dynamic-image-preview {
  min-height: 86px;
  display: grid;
  place-items: center;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.7);
}

.dynamic-image-preview:empty {
  display: none;
}

.dynamic-image-preview img {
  max-width: 100%;
  max-height: 150px;
  object-fit: contain;
}

.checkbox-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body:not(.is-admin) #noteForm,
body:not(.is-admin) #dynamicItemForm,
body:not(.is-admin) #noteLaunchPanel,
body:not(.is-admin) #collectionEditPanel,
body:not(.is-admin) .data-tools-panel,
body:not(.is-admin) .collection-delete-panel {
  display: none;
}

.admin-gate {
  display: grid;
  gap: 8px;
  place-items: start;
  margin-bottom: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(22, 33, 44, 0.06);
}

.admin-gate[hidden] {
  display: none !important;
}

.admin-gate strong {
  font-size: 1rem;
}

.admin-gate span {
  color: var(--muted);
}

.save-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: var(--z-toast);
  padding: 11px 14px;
  color: #fff;
  background: var(--green);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(22, 33, 44, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition:
    opacity 170ms ease,
    transform 170ms ease;
}

.save-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.save-toast.error {
  background: var(--ruby);
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-overlay);
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 33, 44, 0.38);
  backdrop-filter: blur(8px);
  isolation: isolate;
}

.auth-modal[hidden] {
  display: none;
}

.auth-card {
  position: relative;
  z-index: var(--z-modal-content);
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card.showcase-detail-card {
  width: min(1380px, calc(100vw - 10px));
  max-height: calc(100vh - 10px);
  overflow: visible;
  padding: clamp(6px, 1vw, 12px);
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(34, 28, 22, 0.22);
  box-shadow: 0 30px 90px rgba(12, 18, 24, 0.38);
  backdrop-filter: none;
}

.auth-card > strong {
  font-size: 1.2rem;
}

.auth-card > span {
  color: var(--muted);
}

.auth-card > span.error {
  color: var(--ruby);
  font-weight: 800;
}

.site-content-card {
  width: min(760px, 100%);
  max-height: min(92vh, 820px);
  overflow: auto;
}

.site-content-card textarea {
  resize: vertical;
  min-height: 120px;
}

.site-content-card label[hidden],
.site-content-card .upload-field[hidden] {
  display: none;
}

.site-content-preview {
  min-height: 150px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffdf7;
}

.site-content-preview[hidden] {
  display: none;
}

.site-content-preview img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.lexicon-edit-card {
  width: min(980px, 100%);
  max-height: min(92vh, 900px);
  overflow: auto;
}

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

.lexicon-edit-card textarea {
  resize: vertical;
}

.lexicon-edit-card [hidden] {
  display: none !important;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  background: #eef2ed;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.auth-tabs button {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(22, 33, 44, 0.08);
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.password-control input {
  min-width: 0;
}

.password-toggle {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.password-toggle:hover {
  background: #e9eee8;
}

.password-strength,
.auth-dev-link {
  padding: 10px 12px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.86rem;
}

.password-strength {
  display: grid;
  gap: 8px;
}

.password-strength[hidden] {
  display: none;
}

.password-strength > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

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

.password-strength i {
  display: block;
  height: 8px;
  overflow: hidden;
  background: #e4e9e1;
  border-radius: 999px;
}

.password-strength i::before {
  content: "";
  display: block;
  width: var(--password-strength-width, 0%);
  height: 100%;
  background: var(--password-strength-color, #c64a4a);
  border-radius: inherit;
  transition:
    width 160ms ease,
    background-color 160ms ease;
}

.password-strength[data-strength="empty"] {
  --password-strength-width: 0%;
  --password-strength-color: #c64a4a;
}

.password-strength[data-strength="weak"] {
  --password-strength-width: 25%;
  --password-strength-color: #c64a4a;
}

.password-strength[data-strength="medium"] {
  --password-strength-width: 50%;
  --password-strength-color: #d98231;
}

.password-strength[data-strength="good"] {
  --password-strength-width: 75%;
  --password-strength-color: #d9b72f;
}

.password-strength[data-strength="strong"] {
  --password-strength-width: 100%;
  --password-strength-color: var(--green);
}

.auth-dev-link {
  color: var(--green-dark);
  font-weight: 850;
  text-decoration: none;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.profile-card {
  width: min(720px, 100%);
  max-height: min(90vh, 920px);
  overflow: auto;
}

.profile-public {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-avatar {
  width: 86px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 8px 18px rgba(22, 33, 44, 0.12);
  font-size: 2rem;
  font-weight: 900;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-public strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.profile-public p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.profile-edit[hidden] {
  display: none;
}

.profile-info-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 22px rgba(22, 33, 44, 0.06);
}

.profile-info-card-head {
  display: grid;
  gap: 3px;
  padding-bottom: 2px;
}

.profile-info-card-head strong,
.profile-info-card > strong {
  font-family: var(--serif);
  font-size: 1.05rem;
}

.profile-info-card-head span,
.profile-info-card > span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.profile-info-card .auth-actions {
  justify-content: flex-start;
  margin-top: 2px;
}

.profile-info-danger {
  border-color: rgba(150, 61, 75, 0.34);
  background: rgba(255, 253, 247, 0.96);
}

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

.profile-actions[hidden] {
  display: none;
}

.profile-cropper {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-cropper[hidden] {
  display: none;
}

.profile-crop-preview {
  position: relative;
  width: 190px;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(47, 107, 87, 0.13), rgba(36, 79, 117, 0.1)),
    #fff;
  border: 1px solid rgba(47, 107, 87, 0.22);
  border-radius: 18px;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.52);
}

.profile-crop-preview::after {
  content: "";
  position: absolute;
  inset: 18px;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow:
    0 0 0 999px rgba(22, 33, 44, 0.16),
    0 0 0 1px rgba(22, 33, 44, 0.12);
}

.profile-crop-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(var(--crop-x, 0), var(--crop-y, 0)) scale(var(--crop-zoom, 1));
  transform-origin: center;
}

.profile-crop-controls {
  display: grid;
  gap: 10px;
}

.profile-crop-controls label {
  display: grid;
  gap: 5px;
}

.profile-crop-controls input[type="range"] {
  min-height: 26px;
  padding: 0;
}

.profile-crop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 2;
}

.profile-collections {
  display: grid;
  gap: 10px;
}

.profile-collections:empty {
  display: none;
}

.profile-collections-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
  text-transform: uppercase;
}

.profile-collections-head span {
  min-width: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.78rem;
}

.profile-collection-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-collection-card.active {
  border-color: rgba(47, 107, 87, 0.46);
  box-shadow: inset 4px 0 0 var(--green);
}

.profile-open-collection {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.profile-open-collection strong {
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}

.profile-open-collection span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.profile-open-collection:hover strong {
  color: var(--green-dark);
}

.profile-collection-rename {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.profile-collection-rename input {
  min-width: 0;
}

.profile-collections-empty {
  margin: 0;
  padding: 10px;
  color: var(--muted);
  background: #f7faf6;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

body.profile-modal-open {
  overflow: hidden;
}

.profile-card {
  width: min(1320px, calc(100vw - 32px));
  max-height: min(90vh, 920px);
  display: grid;
  gap: 16px;
  padding: 24px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: auto;
}

.profile-page-view {
  padding: 18px 0 36px;
}

.profile-page-view.active {
  display: block;
}

.profile-page-view .profile-card {
  width: min(1500px, 100%);
  max-height: none;
  overflow: visible;
}

.profile-card > strong {
  color: var(--ink);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  letter-spacing: 0;
}

.profile-card > span {
  color: var(--muted);
}

.profile-card > span.error {
  color: var(--ruby);
  font-weight: 850;
}

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

.profile-summary div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-summary strong {
  color: var(--green-dark);
  font-size: 1.35rem;
  line-height: 1;
}

.profile-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-tabs {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  padding: 6px;
  overflow-x: auto;
  background: rgba(47, 111, 91, 0.08);
  border: 1px solid rgba(47, 111, 91, 0.12);
  border-radius: 999px;
}

.profile-tabs button {
  min-height: 40px;
  padding: 0 16px;
  color: var(--ink-soft);
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 850;
}

.profile-tabs button.active {
  color: #fff;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(47, 111, 91, 0.18);
}

.profile-tab-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.profile-tab-panel[hidden] {
  display: none;
}

.profile-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  background: rgba(255, 253, 247, 0.78);
  border: 1px solid rgba(223, 213, 193, 0.86);
  border-radius: var(--radius);
}

.profile-panel-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.profile-panel-head strong {
  color: var(--ink);
  font-size: 1.02rem;
}

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

.profile-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.profile-collection-card {
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  background: linear-gradient(135deg, #fffdf7, #f8f2e6);
  box-shadow: 0 12px 26px rgba(22, 33, 44, 0.08);
}

.profile-collection-cover {
  width: 86px;
  min-width: 86px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--green-dark);
  background:
    linear-gradient(135deg, rgba(47, 111, 91, 0.14), rgba(183, 139, 50, 0.13)),
    #f7faf6;
  border: 1px solid rgba(47, 111, 91, 0.16);
  border-radius: var(--radius);
  font-size: 1.4rem;
  font-weight: 900;
}

.profile-collection-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-collection-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.profile-collection-title-row,
.profile-collection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.profile-collection-title-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.98rem;
  text-overflow: ellipsis;
}

.profile-collection-meta,
.profile-collection-body small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.profile-collection-body p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.visibility-pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.visibility-pill.private {
  background: var(--terracotta);
}

.profile-achievements {
  display: grid;
  gap: 16px;
}

.profile-achievements-note,
.profile-records-empty,
.profile-password-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-achievements-note span,
.profile-records-empty span {
  color: var(--muted);
  font-size: 0.88rem;
}

.profile-achievement-grid {
  display: grid;
  gap: 14px;
}

.achievement-wall {
  display: grid;
  gap: 14px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(112, 78, 43, 0.16), rgba(42, 71, 58, 0.14)),
    repeating-linear-gradient(90deg, rgba(122, 85, 48, 0.12) 0 18px, rgba(255, 253, 247, 0.08) 18px 36px),
    #ede4d2;
  border: 1px solid rgba(93, 68, 42, 0.28);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: inset 0 0 0 5px rgba(255, 253, 247, 0.44), 0 18px 42px rgba(22, 33, 44, 0.12);
}

.achievement-wall-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255, 253, 247, 0.8);
  border: 1px solid rgba(93, 68, 42, 0.18);
  border-radius: var(--radius);
}

.achievement-wall-header strong {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.achievement-wall-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

.profile-achievement-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(135deg, #fffdf7, #f7faf6);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 26px rgba(22, 33, 44, 0.07);
}

.achievement-wall-row {
  grid-template-columns: minmax(170px, 220px) minmax(0, 1fr);
  align-items: center;
  background: rgba(255, 253, 247, 0.82);
  border-color: rgba(93, 68, 42, 0.18);
}

.achievement-wall-row .profile-achievement-head,
.achievement-wall-row p,
.achievement-wall-row .achievement-next {
  grid-column: 1;
}

.achievement-wall-row .achievement-badge-row {
  grid-column: 2;
  grid-row: 1 / span 3;
}

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

.profile-achievement-head > div {
  display: flex;
  gap: 8px;
  align-items: center;
}

.profile-achievement-head span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.profile-achievement-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-weight: 900;
}

.profile-achievement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.achievement-badge-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 2px 2px 8px;
  scrollbar-width: thin;
}

.achievement-badge {
  display: grid;
  flex: 0 0 138px;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  color: var(--ink);
  background: #f0f1ee;
  border: 1px solid rgba(109, 116, 111, 0.28);
  border-radius: var(--radius);
  opacity: 0.78;
  scroll-snap-align: start;
}

.achievement-badge.unlocked {
  opacity: 1;
  color: #fff;
  background: linear-gradient(135deg, var(--badge-color, var(--green)), rgba(30, 32, 36, 0.76));
  border-color: color-mix(in srgb, var(--badge-color, var(--green)) 70%, #ffffff);
  box-shadow: 0 10px 20px color-mix(in srgb, var(--badge-color, var(--green)) 24%, transparent);
}

.achievement-badge.locked {
  background: linear-gradient(135deg, #eeeeeb, color-mix(in srgb, var(--badge-color, #6d746f) 20%, #f7f5ef));
  border-color: color-mix(in srgb, var(--badge-color, #6d746f) 36%, #cfc9bd);
}

.achievement-badge em {
  color: inherit;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  opacity: 0.8;
  text-transform: uppercase;
}

.achievement-badge.belt-white.unlocked {
  background: #fffdf7;
}

.achievement-badge.belt-yellow.unlocked {
  background: #f7e7a4;
}

.achievement-badge.belt-orange.unlocked {
  background: #e9a36f;
}

.achievement-badge.belt-green.unlocked {
  color: #fff;
  background: var(--green);
}

.achievement-badge.belt-blue.unlocked {
  color: #fff;
  background: var(--blue);
}

.achievement-badge.belt-brown.unlocked {
  color: #fff;
  background: #76513a;
}

.achievement-badge.belt-black.unlocked {
  color: #f6d27b;
  background: #202124;
  border-color: rgba(246, 210, 123, 0.48);
}

.achievement-badge.belt-silver.unlocked,
.achievement-badge.belt-gold.unlocked,
.achievement-badge.belt-platinum.unlocked,
.achievement-badge.belt-diamond.unlocked {
  color: #202124;
}

.achievement-badge.belt-challenger.unlocked {
  color: #fff8d7;
  background: linear-gradient(135deg, #245cf0, #1d2d64 58%, #d8a72f);
}

.achievement-badge.record-achievement {
  border-radius: 18px 18px 12px 12px;
}

.achievement-badge.record-achievement.unlocked {
  background: linear-gradient(135deg, var(--badge-color, #6e4995), #271d3d);
}

.achievement-badge.record-achievement.locked {
  background: linear-gradient(135deg, #ece9ee, color-mix(in srgb, var(--badge-color, #6e4995) 18%, #f8f5ef));
}

.records-wall-row {
  background: linear-gradient(135deg, rgba(110, 73, 149, 0.13), rgba(255, 253, 247, 0.88));
}

.record-icon {
  background: #6e4995;
}

.achievement-badge.locked.belt-white {
  background: linear-gradient(135deg, #f3f2ee, #fffdf7);
  border-color: rgba(170, 160, 140, 0.38);
}

.achievement-badge.locked.belt-yellow {
  background: linear-gradient(135deg, #f1f1ed, rgba(247, 231, 164, 0.42));
  border-color: rgba(204, 176, 72, 0.32);
}

.achievement-badge.locked.belt-orange {
  background: linear-gradient(135deg, #f1f1ed, rgba(233, 163, 111, 0.34));
  border-color: rgba(191, 101, 47, 0.28);
}

.achievement-badge.locked.belt-green {
  background: linear-gradient(135deg, #eef1ee, rgba(47, 111, 91, 0.22));
  border-color: rgba(47, 111, 91, 0.28);
}

.achievement-badge.locked.belt-blue {
  background: linear-gradient(135deg, #eef0f1, rgba(36, 61, 92, 0.22));
  border-color: rgba(36, 61, 92, 0.28);
}

.achievement-badge.locked.belt-brown {
  background: linear-gradient(135deg, #f1efec, rgba(118, 81, 58, 0.22));
  border-color: rgba(118, 81, 58, 0.28);
}

.achievement-badge.locked.belt-black {
  color: #4b4b4b;
  background: linear-gradient(135deg, #ededeb, rgba(32, 33, 36, 0.18));
  border-color: rgba(32, 33, 36, 0.3);
}

.achievement-badge-medal {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 900;
}

.achievement-badge.locked .achievement-badge-medal {
  color: #6f746f;
  background: rgba(255, 255, 255, 0.62);
}

.achievement-badge strong,
.achievement-badge small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.achievement-badge small {
  color: inherit;
  font-size: 0.75rem;
  opacity: 0.78;
}

.achievement-progress {
  height: 5px;
  overflow: hidden;
  background: rgba(22, 33, 44, 0.13);
  border-radius: 999px;
}

.achievement-progress span {
  display: block;
  height: 100%;
  background: currentColor;
  opacity: 0.7;
}

.profile-password-panel {
  background: #f7faf6;
}

.profile-password-panel strong {
  color: var(--ink);
}

.achievement-next {
  color: var(--muted);
  font-weight: 780;
}

.profile-rankings,
.profile-records-panel {
  display: grid;
  gap: 16px;
}

.profile-ranking-card,
.profile-record-card {
  min-width: 0;
  padding: 14px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 26px rgba(22, 33, 44, 0.06);
}

.profile-ranking-head,
.profile-records-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.profile-ranking-head > div:first-child {
  display: grid;
  gap: 4px;
}

.profile-ranking-head span,
.profile-records-head span,
.profile-empty-note {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

.profile-render-error {
  padding: 12px 14px;
  background: rgba(126, 32, 43, 0.08);
  border: 1px solid rgba(126, 32, 43, 0.22);
  border-radius: 10px;
}

.profile-ranking-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.profile-ranking-controls label {
  display: grid;
  gap: 4px;
  min-width: 150px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-ranking-controls select {
  min-height: 38px;
  padding: 0 34px 0 10px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 780;
  text-transform: none;
}

.profile-ranking-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.84rem;
}

.profile-ranking-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.profile-ranking-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.profile-ranking-table th,
.profile-ranking-table td {
  padding: 8px 6px;
  text-align: left;
  border-top: 1px solid rgba(223, 213, 193, 0.7);
}

.profile-ranking-table th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.profile-ranking-table tr.current-user td {
  color: var(--green-dark);
  background: rgba(47, 111, 91, 0.08);
  font-weight: 850;
}

.profile-ranking-table tr.rank-1 td {
  background: rgba(224, 173, 65, 0.16);
  border-top-color: rgba(191, 140, 32, 0.34);
}

.profile-ranking-table tr.rank-2 td {
  background: rgba(164, 170, 174, 0.18);
  border-top-color: rgba(128, 136, 142, 0.34);
}

.profile-ranking-table tr.rank-3 td {
  background: rgba(186, 124, 63, 0.16);
  border-top-color: rgba(153, 93, 38, 0.34);
}

.profile-ranking-table tr.current-user.rank-1 td,
.profile-ranking-table tr.current-user.rank-2 td,
.profile-ranking-table tr.current-user.rank-3 td {
  color: var(--ink);
  font-weight: 900;
}

.ranking-rank {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 900;
}

.ranking-user {
  display: inline-flex;
  min-width: 0;
  gap: 8px;
  align-items: center;
}

.ranking-avatar {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.ranking-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-records-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.profile-record-card {
  display: grid;
  gap: 7px;
}

.profile-record-card.available {
  background: linear-gradient(135deg, color-mix(in srgb, var(--record-color, #6e4995) 18%, transparent), #fffdf7 58%);
  border-color: color-mix(in srgb, var(--record-color, #6e4995) 42%, #ffffff);
}

.profile-record-card.mine {
  background: linear-gradient(135deg, color-mix(in srgb, var(--record-color, #6e4995) 28%, #fffdf7), rgba(247, 239, 255, 0.92));
  border-color: color-mix(in srgb, var(--record-color, #6e4995) 66%, #ffffff);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--record-color, #6e4995) 18%, transparent);
}

.profile-record-card.empty {
  opacity: 0.68;
}

.profile-record-title {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.profile-record-crown {
  width: 28px;
  height: 28px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--record-color, #6e4995);
  border-radius: 999px;
  font-weight: 900;
}

.profile-record-card.empty .profile-record-crown {
  color: var(--muted);
  background: rgba(109, 116, 111, 0.16);
}

.profile-record-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.profile-record-card span {
  color: #5e397e;
  font-size: 0.84rem;
  font-weight: 850;
}

.profile-record-card.empty span {
  color: var(--muted);
}

.achievement-medal-board {
  --achievement-medal-size: clamp(72px, 5.8vw, 92px);
  --achievement-record-medal-size: var(--achievement-medal-size);
  --achievement-medal-gap: clamp(8px, 1vw, 14px);
  position: relative;
  isolation: isolate;
  overflow: visible;
  background:
    linear-gradient(rgba(255, 253, 247, var(--achievement-board-overlay, 0.18)), rgba(255, 253, 247, var(--achievement-board-overlay, 0.18))),
    var(--achievement-board-bg, none),
    linear-gradient(135deg, rgba(112, 78, 43, 0.18), rgba(42, 71, 58, 0.16)),
    repeating-linear-gradient(90deg, rgba(122, 85, 48, 0.12) 0 18px, rgba(255, 253, 247, 0.08) 18px 36px),
    #ede4d2;
  background-position: center, var(--achievement-board-position, center), center, center, center;
  background-repeat: no-repeat, var(--achievement-board-repeat, no-repeat), no-repeat, repeat, repeat;
  background-size: cover, var(--achievement-board-size, cover), cover, auto, auto;
}

.achievement-medal-board.has-custom-background {
  background:
    linear-gradient(rgba(255, 253, 247, var(--achievement-board-overlay, 0.18)), rgba(255, 253, 247, var(--achievement-board-overlay, 0.18))),
    var(--achievement-board-bg, none),
    #ede4d2;
  background-position: center, var(--achievement-board-position, center), center;
  background-repeat: no-repeat, var(--achievement-board-repeat, no-repeat), repeat;
  background-size: cover, var(--achievement-board-size, cover), auto;
}

.achievement-medal-board .profile-achievement-grid {
  gap: 12px;
  min-width: 0;
}

.achievement-medal-board.compact {
  --achievement-medal-size: clamp(54px, 5.5vw, 68px);
  --achievement-record-medal-size: var(--achievement-medal-size);
  --achievement-medal-gap: 7px;
  border-radius: 12px;
}

.achievement-medal-board.compact .achievement-wall-header {
  padding-bottom: 8px;
}

.achievement-medal-board.compact .achievement-wall-header span {
  display: none;
}

.achievement-medal-board .achievement-wall-row {
  display: grid;
  grid-template-columns: minmax(132px, 180px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 14px;
  overflow: visible;
  background: rgba(255, 253, 247, 0.05);
  border: 1.5px solid rgba(93, 68, 42, 0.48);
  border-radius: var(--radius);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.2),
    0 8px 18px rgba(37, 29, 20, 0.12);
}

.achievement-medal-board.compact .achievement-wall-row {
  grid-template-columns: minmax(98px, 124px) minmax(0, 1fr);
  gap: 8px;
  padding: 9px;
  border-radius: 11px;
}

.achievement-medal-board .profile-achievement-head {
  display: grid;
  gap: 4px;
  align-content: center;
  padding: 8px 9px;
  background: rgba(255, 253, 247, 0.66);
  border: 1px solid rgba(255, 253, 247, 0.56);
  border-radius: 10px;
  backdrop-filter: blur(4px);
}

.achievement-medal-board.compact .profile-achievement-head {
  gap: 2px;
  padding: 6px;
}

.achievement-medal-board .profile-achievement-head strong {
  font-family: var(--serif);
  font-size: 1.08rem;
}

.achievement-medal-board.compact .profile-achievement-head strong {
  font-size: 0.9rem;
}

.achievement-medal-board .profile-achievement-head span,
.achievement-medal-board .profile-achievement-head small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.achievement-medal-row {
  display: flex;
  gap: var(--achievement-medal-gap);
  align-items: center;
  justify-content: space-between;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  padding: 20px 18px 22px;
  scrollbar-width: thin;
}

.achievement-medal-board.compact .achievement-medal-row {
  justify-content: space-between;
  overflow-x: visible;
  overflow-y: visible;
  padding: 16px 14px 18px;
}

.achievement-medal {
  position: relative;
  width: var(--achievement-medal-size);
  height: var(--achievement-medal-size);
  flex: 0 0 var(--achievement-medal-size);
  display: grid;
  place-items: center;
  padding: clamp(4px, 0.7vw, 8px);
  color: var(--badge-color, var(--green));
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: help;
  filter: drop-shadow(0 8px 9px rgba(22, 33, 44, 0.2));
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease;
}

.achievement-medal-board.compact .achievement-medal {
  padding: 4px;
}

.achievement-medal.record-medal {
  width: var(--achievement-record-medal-size);
  height: var(--achievement-record-medal-size);
  flex-basis: var(--achievement-record-medal-size);
}

.achievement-medal[data-profile-toggle-badge] {
  cursor: pointer;
}

.achievement-medal:hover,
.achievement-medal:focus-visible {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 12px 12px rgba(22, 33, 44, 0.26));
  outline: none;
}

.achievement-medal:focus-visible {
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.28);
}

.achievement-medal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent !important;
}

.achievement-medal.locked {
  opacity: 0.7;
  filter: grayscale(0.8) drop-shadow(0 5px 7px rgba(22, 33, 44, 0.14));
}

.achievement-medal.locked img {
  background: transparent !important;
}

.achievement-medal.displayed {
  box-shadow:
    0 0 0 3px #e0b23d,
    0 0 0 6px rgba(47, 107, 87, 0.42),
    0 0 18px rgba(216, 167, 47, 0.42);
}

.achievement-medal.displayed::after {
  content: "✓";
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: #2f3f33;
  background: #f4d46c;
  border: 2px solid #fffdf7;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.achievement-medal-fallback {
  width: 86%;
  height: 86%;
  display: grid;
  place-items: center;
  color: color-mix(in srgb, var(--badge-color, var(--green)) 75%, #222);
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.78), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--badge-color, var(--green)) 72%, #fff), color-mix(in srgb, var(--badge-color, var(--green)) 45%, #222));
  border: 1px solid color-mix(in srgb, var(--badge-color, var(--green)) 66%, #fff);
  border-radius: 999px;
  font-weight: 900;
}

.badge-detail-card {
  width: min(620px, calc(100vw - 28px));
  max-height: min(88vh, 760px);
  overflow-y: auto;
}

.badge-detail-content {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.badge-detail-visual {
  display: grid;
  place-items: center;
  min-height: 190px;
  background:
    radial-gradient(circle, rgba(255, 253, 247, 0.78), rgba(47, 107, 87, 0.08)),
    #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.achievement-medal.detail-medal {
  width: 138px;
  height: 138px;
  flex-basis: 138px;
  cursor: default;
}

.achievement-medal.detail-medal .achievement-medal-fallback {
  width: 118px;
  height: 118px;
  font-size: 1.7rem;
}

.badge-detail-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.badge-detail-copy > span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge-detail-copy h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.55rem;
}

.badge-detail-copy strong {
  color: var(--muted);
}

.badge-detail-copy dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.badge-detail-copy dl div {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.badge-detail-copy dt,
.badge-detail-copy dd {
  margin: 0;
}

.badge-detail-copy dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.achievement-medal.locked .achievement-medal-fallback {
  color: #626762;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.82), transparent 30%),
    linear-gradient(135deg, #ececea, color-mix(in srgb, var(--badge-color, #6d746f) 20%, #ddd8cd));
}

body.achievement-unlock-open {
  overflow: hidden;
}

.achievement-unlock-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal-overlay) + 20);
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 42px);
  color: #fffdf7;
  background: rgba(16, 25, 31, 0.62);
  backdrop-filter: blur(5px);
  animation: achievementUnlockOverlayIn 180ms ease-out both;
}

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

.achievement-unlock-card {
  width: min(680px, calc(100vw - 32px));
  max-height: min(90vh, 820px);
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2.2vw, 20px);
  padding: clamp(24px, 4vw, 40px);
  overflow-y: auto;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(240, 213, 139, 0.2), transparent 42%),
    linear-gradient(145deg, rgba(255, 253, 247, 0.14), rgba(255, 253, 247, 0.06)),
    rgba(20, 34, 49, 0.24);
  border: 1px solid rgba(255, 253, 247, 0.32);
  border-radius: 20px;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform-origin: 50% 46%;
  animation: achievementUnlockCardIn 240ms ease-out both;
}

.achievement-unlock-medal {
  --badge-color: #6e4995;
  width: clamp(150px, 20vw, 210px);
  height: clamp(150px, 20vw, 210px);
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 999px;
  filter:
    drop-shadow(0 22px 32px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 20px color-mix(in srgb, var(--badge-color) 52%, transparent));
  animation: achievementUnlockMedalIn 470ms cubic-bezier(0.2, 0.82, 0.24, 1) 80ms both;
}

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

.achievement-unlock-medal img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: transparent !important;
}

.achievement-unlock-fallback {
  display: none !important;
  width: 74%;
  height: 74%;
  display: grid;
  place-items: center;
  color: #fffdf7;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--badge-color) 82%, #fff), color-mix(in srgb, var(--badge-color) 62%, #111));
  border: 2px solid color-mix(in srgb, var(--badge-color) 58%, #fff);
  border-radius: 999px;
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.achievement-unlock-copy {
  max-width: 600px;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 0;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.26);
}

.achievement-unlock-kicker,
.achievement-unlock-copy > strong,
.achievement-unlock-copy h3,
.achievement-unlock-progress,
.achievement-unlock-meta,
.achievement-unlock-copy p,
.achievement-unlock-actions {
  opacity: 0;
  transform: translateY(8px);
  animation: achievementUnlockTextIn 240ms ease-out both;
}

.achievement-unlock-kicker {
  color: #ead090;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  animation-delay: 220ms;
}

.achievement-unlock-copy > strong {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  line-height: 1;
  animation-delay: 280ms;
}

.achievement-unlock-copy h3 {
  margin: 0;
  max-width: min(100%, 520px);
  padding: 9px 18px;
  color: #fffdf7;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--badge-color, #6e4995) 46%, rgba(255, 253, 247, 0.16)), rgba(255, 253, 247, 0.1)),
    rgba(20, 34, 49, 0.18);
  border: 1px solid color-mix(in srgb, var(--badge-color, #6e4995) 48%, rgba(255, 253, 247, 0.32));
  border-radius: 999px;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2.2vw, 1.72rem);
  line-height: 1.16;
  text-wrap: balance;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  animation-delay: 340ms;
}

.achievement-unlock-progress {
  padding: 4px 9px;
  color: rgba(255, 253, 247, 0.82);
  background: rgba(255, 253, 247, 0.11);
  border: 1px solid rgba(255, 253, 247, 0.22);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 850;
  animation-delay: 370ms;
}

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

.achievement-unlock-meta {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  padding: 6px 12px;
  color: rgba(255, 253, 247, 0.88);
  background: rgba(255, 253, 247, 0.1);
  border: 1px solid rgba(255, 253, 247, 0.22);
  border-radius: 999px;
  font-size: clamp(0.84rem, 1.4vw, 0.96rem);
  font-weight: 850;
  line-height: 1.25;
  animation-delay: 400ms;
}

.achievement-unlock-meta[hidden],
.achievement-unlock-condition[hidden] {
  display: none;
}

.achievement-unlock-copy p:not(.achievement-unlock-meta) {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 253, 247, 0.9);
  font-size: clamp(0.98rem, 1.8vw, 1.08rem);
  line-height: 1.55;
  animation-delay: 460ms;
}

.achievement-unlock-condition {
  max-width: 560px;
  padding: 8px 13px;
  color: rgba(255, 253, 247, 0.86) !important;
  background: rgba(255, 253, 247, 0.12);
  border: 1px solid rgba(255, 253, 247, 0.24);
  border-radius: 999px;
  font-size: clamp(0.84rem, 1.4vw, 0.94rem) !important;
  line-height: 1.35 !important;
  animation-delay: 500ms !important;
}

.achievement-unlock-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  animation-delay: 580ms;
}

.achievement-unlock-actions button {
  min-height: 44px;
  border-radius: 999px;
}

.achievement-unlock-actions .primary-action {
  color: #142231;
  background: #f0d58b;
  border-color: rgba(240, 213, 139, 0.8);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.achievement-unlock-actions .primary-action:hover {
  background: #f5de9f;
}

.achievement-unlock-actions .secondary-action {
  color: #fffdf7;
  background: rgba(255, 253, 247, 0.12);
  border-color: rgba(255, 253, 247, 0.36);
}

.achievement-unlock-actions .secondary-action:hover {
  background: rgba(255, 253, 247, 0.18);
}

.achievement-unlock-modal[data-unlock-type="record"] .achievement-unlock-kicker {
  color: #ddc1ff;
}

@keyframes achievementUnlockOverlayIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes achievementUnlockCardIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes achievementUnlockMedalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.84);
  }
  70% {
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes achievementUnlockTextIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .achievement-unlock-modal,
  .achievement-unlock-card,
  .achievement-unlock-medal,
  .achievement-unlock-kicker,
  .achievement-unlock-copy > strong,
  .achievement-unlock-copy h3,
  .achievement-unlock-progress,
  .achievement-unlock-meta,
  .achievement-unlock-copy p,
  .achievement-unlock-actions {
    animation-duration: 1ms;
    animation-delay: 0ms;
    transition: none;
  }
}

@media (max-width: 620px) {
  .achievement-unlock-modal {
    padding: 14px;
  }

  .achievement-unlock-card {
    width: min(100%, calc(100vw - 20px));
    max-height: min(92vh, 760px);
    padding: 20px 16px;
    border-radius: 16px;
  }

  .achievement-unlock-medal {
    width: min(58vw, 190px);
    height: min(58vw, 190px);
  }

  .achievement-unlock-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .achievement-unlock-actions button {
    width: 100%;
  }
}

.admin-board-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  align-items: start;
  overflow: hidden;
}

.admin-board-image-card {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.admin-board-image-card .admin-image-preview {
  width: 100%;
  max-width: 100%;
  min-height: 150px;
  max-height: 260px;
  overflow: hidden;
}

.admin-board-image-card[data-admin-board-image-card="background"] .admin-image-preview {
  aspect-ratio: 16 / 9;
}

.admin-board-image-card[data-admin-board-image-card="locked"] .admin-image-preview {
  width: min(100%, 260px);
  aspect-ratio: 1;
  justify-self: center;
}

.admin-board-image-card .admin-image-preview img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-board-image-card .image-background-options,
.site-setting-image-control[data-site-setting-image-card="backgroundImageUrl"] .image-background-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
  padding-top: 4px;
}

.admin-board-copy-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 253, 247, 0.74);
}

.admin-board-copy-settings label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.admin-board-copy-settings input {
  width: 100%;
}

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

.admin-settings-layout {
  display: grid;
  gap: 14px;
}

.admin-settings-card {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 14px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 20px rgba(22, 33, 44, 0.06);
}

.admin-settings-card-wide {
  grid-column: 1 / -1;
}

.admin-settings-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-settings-card-head {
  display: grid;
  gap: 3px;
}

.admin-settings-card-head strong {
  font-family: var(--serif);
  font-size: 1.02rem;
}

.admin-settings-card-head span,
.admin-settings-card label {
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-settings-card input,
.admin-settings-card select,
.admin-settings-card textarea {
  width: 100%;
}

.admin-settings-options-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.admin-settings-options-grid-compact {
  grid-template-columns: minmax(220px, 360px);
}

.admin-image-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  align-items: start;
}

.admin-main-image-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.site-setting-image-control[data-site-setting-image-card="backgroundImageUrl"] {
  grid-column: span 2;
}

.image-background-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 4px;
}

.legacy-background-options-card {
  display: none !important;
}

.admin-board-options-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.admin-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.site-setting-image-control {
  align-content: start;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  background: rgba(255, 253, 247, 0.72);
}

.site-setting-image-control .upload-field {
  min-height: 0;
  padding: 8px;
}

.site-setting-image-control .compact-action {
  width: 100%;
  justify-content: center;
}

.admin-image-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-image-editor > div:first-child {
  display: grid;
  gap: 3px;
}

.admin-image-editor span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-image-preview {
  min-height: 86px;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  background-color: #fbfaf6;
  background-image:
    linear-gradient(45deg, rgba(109, 116, 111, 0.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(109, 116, 111, 0.18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(109, 116, 111, 0.18) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(109, 116, 111, 0.18) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border: 1px dashed rgba(109, 116, 111, 0.32);
  border-radius: 10px;
}

.admin-image-preview img {
  max-width: 100%;
  max-height: 108px;
  object-fit: contain;
  background: transparent;
}

.admin-legal-editor {
  min-width: 0;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.64);
  overflow: hidden;
}

.admin-legal-editor summary {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.admin-legal-editor summary span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-legal-editor-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.admin-badge-cropper {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(47, 107, 87, 0.24);
  border-radius: 10px;
  background: rgba(255, 253, 247, 0.72);
}

.admin-badge-cropper[hidden] {
  display: none;
}

.admin-badge-crop-stage {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 1;
  justify-self: center;
  overflow: hidden;
  background-color: #fbfaf6;
  background-image:
    linear-gradient(45deg, rgba(109, 116, 111, 0.18) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(109, 116, 111, 0.18) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(109, 116, 111, 0.18) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(109, 116, 111, 0.18) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border: 2px solid rgba(47, 107, 87, 0.34);
  border-radius: 12px;
  cursor: grab;
  touch-action: none;
}

.admin-badge-crop-stage:active {
  cursor: grabbing;
}

.admin-badge-crop-stage img {
  position: absolute;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: transparent;
  user-select: none;
  pointer-events: none;
}

.admin-badge-crop-frame {
  position: absolute;
  inset: 50%;
  width: min(76%, 240px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 253, 247, 0.95);
  border-radius: 12px;
  box-shadow:
    0 0 0 999px rgba(22, 33, 44, 0.46),
    0 0 0 3px rgba(47, 107, 87, 0.82),
    inset 0 0 0 1px rgba(47, 107, 87, 0.52);
  pointer-events: none;
}

.crop-helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-badge-crop-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  background: rgba(255, 253, 247, 0.94);
  border-top: 1px solid rgba(47, 107, 87, 0.12);
}

.admin-medal-row {
  align-items: stretch;
  justify-content: flex-start;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  padding: 12px 6px 18px;
  scrollbar-width: thin;
}

.admin-medal-card {
  width: 190px;
  flex: 0 0 190px;
  display: grid;
  gap: 7px;
  justify-items: center;
  align-content: start;
  min-width: 0;
  padding: 12px;
  text-align: center;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.admin-medal-card .achievement-medal {
  width: min(132px, 100%);
  max-width: 132px;
  height: 132px;
  flex: 0 0 132px;
  padding: 8px;
  cursor: default;
  background-color: rgba(255, 255, 255, 0.42);
  background-image:
    linear-gradient(45deg, rgba(47, 107, 87, 0.1) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(47, 107, 87, 0.1) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(47, 107, 87, 0.1) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(47, 107, 87, 0.1) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  border-radius: 18px;
  filter: none;
  box-shadow: 0 8px 14px rgba(22, 33, 44, 0.12);
}

.admin-medal-card .achievement-medal img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.admin-medal-card strong,
.admin-medal-card span,
.admin-medal-card em {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.admin-medal-actions {
  display: grid;
  gap: 6px;
  width: 100%;
  margin-top: auto;
}

.admin-medal-actions .compact-action {
  width: 100%;
  justify-content: center;
}

@media (max-width: 820px) {
  .site-setting-image-control[data-site-setting-image-card="backgroundImageUrl"] {
    grid-column: auto;
  }

  .admin-board-copy-settings,
  .admin-settings-grid,
  .admin-settings-fields-grid {
    grid-template-columns: 1fr;
  }

  .admin-settings-options-grid,
  .admin-board-image-card .image-background-options,
  .site-setting-image-control[data-site-setting-image-card="backgroundImageUrl"] .image-background-options {
    grid-template-columns: 1fr;
  }

  .admin-settings-actions {
    justify-content: stretch;
  }

  .admin-settings-actions button {
    width: 100%;
  }

  .achievement-medal-board .achievement-wall-row {
    grid-template-columns: 1fr;
  }

  .achievement-medal-row {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    padding: 18px 14px 22px;
  }

  .owner-summary-achievements .achievement-medal-board.compact .achievement-wall-row {
    grid-template-columns: 1fr;
  }

  .owner-summary-achievements .achievement-medal-board.compact .achievement-medal-row {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
  }
}

.owner-summary-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: #f4efe3;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.owner-summary-tabs button {
  flex: 1 1 0;
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.owner-summary-tabs button.active {
  color: #fff;
  background: var(--green);
}

.owner-summary-collections,
.owner-summary-achievements {
  display: grid;
  gap: 10px;
}

.owner-summary-collections article,
.owner-summary-best-badge {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: center;
  padding: 10px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.owner-summary-collections article span,
.owner-summary-best-badge > span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.owner-summary-collections article button,
.owner-summary-best-badge .achievement-medal {
  grid-row: span 2;
}

.owner-summary-activity {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(255, 253, 247, 0.92);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.owner-summary-activity-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.owner-summary-activity-head strong {
  color: var(--ink);
}

.owner-summary-activity-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.owner-summary-activity-list {
  display: grid;
  gap: 8px;
}

.owner-summary-activity-item {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid rgba(47, 107, 87, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.owner-summary-activity-item:hover,
.owner-summary-activity-item:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 107, 87, 0.12);
}

.owner-summary-activity-item span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 780;
}

.owner-summary-activity-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-summary-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
}

.owner-summary-overview-card {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 253, 247, 0.78);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: var(--radius);
}

.owner-summary-collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.owner-summary-collection-card {
  width: 100%;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--collection-accent, #2f6f5b) 30%, transparent);
  border-left: 4px solid var(--collection-accent, #2f6f5b);
  border-radius: 10px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--collection-accent, #2f6f5b) 18%, transparent), transparent 48%),
    rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.owner-summary-collection-card:hover,
.owner-summary-collection-card:focus-visible {
  border-color: var(--collection-accent, var(--green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--collection-accent, #2f6f5b) 16%, transparent);
}

.owner-summary-collection-cover {
  width: 70px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--collection-accent, #2f6f5b) 22%, transparent), rgba(183, 139, 50, 0.12)),
    #f7faf6;
  color: var(--collection-accent, var(--green-dark));
  font-weight: 950;
}

.owner-summary-collection-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.owner-summary-collection-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.owner-summary-collection-copy strong,
.owner-summary-collection-copy em,
.owner-summary-collection-copy small {
  min-width: 0;
  overflow: hidden;
}

.owner-summary-collection-copy strong {
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-summary-collection-copy em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-summary-collection-copy small {
  display: -webkit-box;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.owner-summary-overview-activity .owner-summary-activity {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.owner-summary-overview-activity .owner-summary-activity-list {
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.owner-summary-mini-medals {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.owner-summary-mini-medals .achievement-medal,
.owner-summary-best-badge .achievement-medal {
  width: 46px;
  height: 46px;
  flex-basis: 46px;
}

.owner-summary-achievements .achievement-medal-board.compact .achievement-wall-row {
  grid-template-columns: minmax(96px, 122px) minmax(0, 1fr);
  align-items: center;
  overflow: visible;
}

.owner-summary-achievements .achievement-medal-board.compact {
  --achievement-medal-size: clamp(52px, 4.6vw, 62px);
  --achievement-record-medal-size: var(--achievement-medal-size);
  --achievement-medal-gap: 6px;
  overflow: visible;
}

.owner-summary-achievements .achievement-medal-board.compact .achievement-medal-row {
  justify-content: space-between;
  overflow-x: visible;
  overflow-y: visible;
  padding: 16px 12px 18px;
}

.owner-summary-achievements .achievement-medal-board.compact .achievement-medal {
  padding: 4px;
}

@media (max-width: 820px) {
  .owner-summary-achievements .achievement-medal-board.compact .achievement-wall-row {
    grid-template-columns: 1fr;
  }

  .owner-summary-achievements .achievement-medal-board.compact .achievement-medal-row {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
  }

  .owner-summary-overview-layout {
    grid-template-columns: 1fr;
  }

  .owner-summary-collection-grid {
    grid-template-columns: 1fr;
  }
}

.danger-zone {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff8f8;
  border: 1px solid #e5bdc4;
  border-radius: var(--radius);
}

.danger-zone strong {
  color: var(--ruby);
}

.danger-zone span {
  color: var(--muted);
  font-size: 0.86rem;
}

.message-card {
  width: min(1080px, 100%);
  max-height: min(90vh, 900px);
  overflow: visible;
}

.message-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.message-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, auto));
  justify-content: start;
  gap: 6px;
  padding: 5px;
  background: #eef2ed;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.message-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-weight: 820;
  cursor: pointer;
}

.message-tab.active {
  background: #fff;
  box-shadow: 0 6px 14px rgba(22, 33, 44, 0.08);
}

.message-tab-badge,
.message-state {
  min-width: 22px;
  display: inline-grid;
  place-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dfe8e1;
  color: var(--green-dark);
  font-size: 0.76rem;
  font-weight: 900;
}

.message-layout {
  display: grid;
  grid-template-columns: minmax(270px, 0.92fr) minmax(0, 1.18fr);
  gap: 14px;
  min-height: min(68vh, 650px);
  overflow: visible;
}

.message-list-panel,
.message-reader {
  min-width: 0;
  min-height: 0;
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.message-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: min(68vh, 650px);
  overflow: auto;
  padding: 10px;
}

.message-item {
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(22, 33, 44, 0.04);
}

.message-item.unread {
  border-color: rgba(47, 107, 87, 0.4);
  box-shadow: inset 4px 0 0 var(--green);
}

.message-item.selected {
  border-color: rgba(47, 107, 87, 0.52);
  background: #f0f6f1;
}

.message-peer {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.message-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-peer strong,
.message-peer small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-peer small {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 720;
}

.message-preview,
.message-empty {
  margin: 0;
  color: #3e4650;
  line-height: 1.45;
}

.message-preview {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.message-empty {
  padding: 14px;
  color: var(--muted);
  background: #f7faf6;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.message-state {
  justify-self: start;
  background: #eef2ed;
  color: var(--muted);
}

.message-state.unread {
  background: var(--green);
  color: #fff;
}

.message-reader {
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: min(68vh, 650px);
  overflow: auto;
  padding: 12px;
}

.message-detail-card,
.message-detail-empty {
  display: grid;
  gap: 14px;
  padding: 14px;
  background:
    radial-gradient(circle at 10% 8%, rgba(207, 175, 96, 0.13), transparent 32%),
    #fffdf8;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: var(--radius);
}

.message-detail-empty {
  min-height: 220px;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.message-detail-empty strong {
  color: var(--ink);
  font-size: 1.08rem;
}

.message-detail-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.message-detail-header .message-avatar {
  width: 48px;
  height: 48px;
}

.message-detail-header strong,
.message-detail-header span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-detail-header strong {
  font-size: 1.18rem;
}

.message-detail-header span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.message-detail-meta div {
  min-width: 0;
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(116, 138, 126, 0.2);
  border-radius: 7px;
}

.message-detail-meta dt,
.message-detail-meta dd {
  margin: 0;
}

.message-detail-meta dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 860;
  text-transform: uppercase;
}

.message-detail-meta dd {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.message-detail-body {
  margin: 0;
  padding: 14px;
  min-height: 150px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(116, 138, 126, 0.18);
  border-radius: var(--radius);
  line-height: 1.55;
}

.message-detail-actions,
.message-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.message-form {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.message-form[hidden] {
  display: none;
}

.message-recipient-picker {
  position: relative;
  z-index: 20;
}

.message-recipient-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 10020;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 30px rgba(22, 33, 44, 0.13);
}

.message-recipient-results[hidden] {
  display: none;
}

.message-recipient-option {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 820;
  cursor: pointer;
}

.message-recipient-option:hover,
.message-recipient-option.active {
  background: #edf4ef;
}

.message-recipient-option .message-avatar {
  width: 34px;
  height: 34px;
}

.message-recipient-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 720;
}

.message-form.empty-recipient {
  border-color: rgba(201, 126, 0, 0.28);
}

.admin-page-view {
  display: none;
}

.admin-page-view.active {
  display: block;
}

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.admin-page-header h2 {
  margin-bottom: 4px;
}

.admin-page-header span {
  color: var(--muted);
}

.admin-page-header span.error {
  color: var(--ruby);
  font-weight: 850;
}

.admin-quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.admin-quick-stats div {
  display: grid;
  gap: 3px;
  padding: 12px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(22, 33, 44, 0.06);
}

.admin-quick-stats strong {
  color: var(--green-dark);
  font-size: 1.45rem;
}

.admin-quick-stats span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 820;
  text-transform: uppercase;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px;
  background: rgba(47, 111, 91, 0.07);
  border: 1px solid rgba(47, 111, 91, 0.16);
  border-radius: var(--radius);
}

.admin-tabs button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--green-dark);
  background: transparent;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.admin-tabs button:hover,
.admin-tabs button:focus-visible,
.admin-tabs button.active {
  background: #fffdf7;
  border-color: rgba(47, 111, 91, 0.22);
  box-shadow: 0 8px 20px rgba(22, 33, 44, 0.07);
}

.admin-tab-panel {
  display: grid;
  gap: 14px;
}

.admin-tab-panel[hidden] {
  display: none;
}

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

.admin-panel-toolbar span {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.admin-filters input,
.admin-filters select {
  min-height: 40px;
  min-width: 180px;
  padding: 0 10px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.admin-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.86rem;
}

.admin-table th,
.admin-table td {
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid rgba(223, 213, 193, 0.72);
}

.admin-table th {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.admin-table tr.is-banned td {
  background: rgba(143, 51, 69, 0.08);
}

.site-admin-list {
  display: grid;
  gap: 12px;
}

.admin-badge-category {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-badge-editor-card {
  width: min(620px, 100%);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: 0;
}

.admin-badge-editor-card > .auth-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 0 -22px;
  padding: 12px 22px 18px;
  background:
    linear-gradient(rgba(255, 253, 247, 0), var(--surface) 18%),
    var(--surface);
  border-top: 1px solid var(--line);
}

.admin-badge-preview {
  display: grid;
  padding: 10px;
  background: rgba(47, 111, 91, 0.06);
  border: 1px solid rgba(47, 111, 91, 0.14);
  border-radius: var(--radius);
}

.profile-name-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 8px;
  max-width: 100%;
  vertical-align: middle;
}

.profile-name-badge {
  display: inline-flex;
  min-height: 30px;
  max-width: min(220px, 100%);
  flex: 0 1 auto;
  justify-content: flex-start;
  gap: 6px;
  align-items: center;
  padding: 3px 9px 3px 4px;
  overflow: hidden;
  color: var(--green-dark);
  background: rgba(47, 111, 91, 0.1);
  border: 1px solid rgba(47, 111, 91, 0.18);
  border-radius: 999px;
  font-size: clamp(0.68rem, 1.5vw, 0.78rem);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name-badge img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
  background: transparent;
}

.profile-name-badge > span[aria-hidden="true"] {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
}

.profile-name-badge-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-name-badge.record {
  color: #5e397e;
  background: rgba(110, 73, 149, 0.13);
  border-color: rgba(110, 73, 149, 0.28);
}

.profile-displayed-status {
  display: grid;
  gap: 4px;
  padding: 12px;
  background: rgba(110, 73, 149, 0.08);
  border: 1px solid rgba(110, 73, 149, 0.18);
  border-radius: var(--radius);
}

.profile-displayed-status span,
.muted-cell {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-displayed-badges,
.profile-displayed-slots {
  display: grid;
  gap: 8px;
}

.profile-displayed-slots {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-displayed-slot {
  min-height: 42px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed rgba(109, 116, 111, 0.32);
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 780;
}

.profile-displayed-slot.filled {
  color: var(--ink);
  background: #fffdf7;
  border-style: solid;
}

.badge-wear-button {
  margin-top: 2px;
}

.site-admin-user {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf6;
}

.site-admin-user.is-banned {
  border-color: rgba(143, 51, 69, 0.38);
  background: #fff4f4;
}

.site-admin-user-head,
.site-admin-collection {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.site-admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.ban-badge {
  display: inline-grid;
  min-height: 20px;
  place-items: center;
  margin-left: 7px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--ruby);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
  vertical-align: middle;
}

.site-admin-user-head strong,
.site-admin-user-head small,
.site-admin-collection strong,
.site-admin-collection small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-admin-user-head small,
.site-admin-collection small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.site-admin-collections {
  display: grid;
  gap: 7px;
  padding-left: 52px;
}

.site-admin-collection {
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.site-admin-collection.reportable {
  grid-template-columns: minmax(0, 1fr) auto;
}

.collection-report-action {
  grid-column: 1 / -1;
  justify-self: start;
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 38px;
  width: 38px;
  min-height: 38px;
  padding: 0;
}

fieldset {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(22, 33, 44, 0.06);
}

legend {
  padding: 0 8px;
  color: var(--green);
  font-weight: 850;
}

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

label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 780;
}

.upload-field {
  display: grid;
  gap: 6px;
}

.upload-status {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 4px 8px;
  color: #586270;
  background: #eef3ed;
  border: 1px solid #d7dfd4;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 820;
  line-height: 1.2;
}

.upload-status.loading {
  color: #6a4f08;
  background: #fff3c5;
  border-color: #dfc56d;
}

.upload-status.ready {
  color: #235642;
  background: #e5f2eb;
  border-color: #b9d8c7;
}

.upload-status.error {
  color: #7d2637;
  background: #fde8ec;
  border-color: #e6a8b4;
}

label input,
label select,
label textarea {
  margin-top: 6px;
  color: var(--ink);
  font-weight: 500;
}

.wide-label {
  display: block;
  margin-top: 14px;
}

.photo-preview-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.photo-preview {
  min-height: 155px;
  border: 1px dashed #b8c2b8;
  border-radius: var(--radius);
  background: #f9fbf7;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.photo-preview img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
}

.photo-loading {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.form-actions,
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sync-status {
  min-height: 24px;
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.import-report {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-item {
  padding: 12px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.report-item strong {
  display: block;
  font-size: 1.45rem;
}

.report-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr);
  }

  .site-nav {
    justify-content: start;
  }

  .site-header .account-panel {
    grid-column: span 2;
  }

  .site-brand-copy strong {
    font-size: clamp(1.18rem, 2.4vw, 1.72rem);
  }

  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: visible;
  }

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

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

  .modifier-general-panel .collection-edit-form > .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-block {
    grid-column: span 2 !important;
    grid-row: auto !important;
  }

  .book-layout,
  .overview-grid,
  .site-admin-page-grid {
    grid-template-columns: 1fr;
  }

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

  .collections-results-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  }

  .lexicon-hero,
  .lexicon-workbench,
  .lexicon-controls,
  .currency-filters {
    grid-template-columns: 1fr;
  }

  .lexicon-detail {
    position: static;
    max-height: none;
    overflow: visible;
  }

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

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

  .note-list {
    grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
    max-height: none;
  }
}

@media (min-width: 900px) and (max-width: 1100px) {
  .lexicon-workbench {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  }

  .lexicon-detail {
    position: sticky;
    top: var(--lexicon-sticky-top);
    max-height: calc(100vh - var(--lexicon-sticky-top) - 16px);
    overflow: auto;
  }
}

@media (max-width: 980px) {
  .about-page-view.active {
    grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr);
  }
}

@media (max-width: 760px) {
  .about-page-view.active,
  .about-action-grid,
  .home-carousel-track,
  .admin-footer-text-grid {
    grid-template-columns: 1fr;
  }

  .about-page-view.active {
    grid-template-areas:
      "site"
      "author"
      "carousel"
      "share";
  }

  .about-section,
  .about-hero,
  .about-action-grid,
  .about-action-card[data-site-content-key="about.shareCta"] {
    height: auto;
  }

  .about-hero {
    grid-template-columns: 1fr;
  }

  .about-section {
    grid-template-columns: 1fr;
  }

  .about-section > :not(.about-section-image),
  .about-section-image {
    grid-column: 1;
  }

  .about-section-image {
    grid-row: auto;
    justify-self: start;
    width: min(100%, 180px);
  }

  .about-portrait {
    width: min(100%, 180px);
    justify-self: start;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-shell {
    width: min(100% - 20px, 1440px);
    padding-top: 14px;
  }

  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .site-brand {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .site-brand-copy strong {
    font-size: clamp(1.16rem, 6vw, 1.58rem);
  }

  .site-brand-copy span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.78rem;
  }

  .site-logo {
    width: 50px;
    height: 50px;
  }

  .site-logo-image {
    width: 44px;
    height: 44px;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    overflow: visible;
  }

  .site-nav-link {
    min-width: 0;
    padding: 0 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar,
  .section-heading,
  .admin-page-header {
    align-items: start;
    flex-direction: column;
  }

  .admin-filters,
  .admin-filters input,
  .admin-filters select,
  .admin-tabs button {
    width: 100%;
  }

  .profile-displayed-slots {
    grid-template-columns: 1fr;
  }

  .collection-title-block {
    grid-template-columns: 1fr;
  }

  .collection-quick-actions {
    width: 100%;
    min-width: 0;
    justify-items: start;
  }

  .collection-actions-list {
    justify-content: start;
  }

  .account-panel {
    width: 100%;
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
  }

  .account-buttons {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .site-header .account-panel {
    grid-column: auto;
    height: auto;
    grid-template-columns: 1fr;
  }

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

  .collection-heading h1,
  .collection-hero h1 {
    max-width: none;
  }

  .collection-switcher {
    width: 100%;
    max-width: none;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    white-space: nowrap;
  }

  .auth-tabs {
    grid-template-columns: 1fr;
  }

  .auth-modal {
    align-items: start;
    padding: 10px;
    overflow: auto;
  }

  .auth-card,
  .site-content-card,
  .lexicon-edit-card,
  .message-card,
  .auth-card.note-form-card {
    width: min(100%, 95vw);
    max-height: calc(100vh - 20px);
    padding: 16px;
    overflow: auto;
  }

  .auth-card.note-form-card {
    --note-modal-pad: 16px;
    padding-top: 0;
    padding-bottom: 0;
  }

  .message-card {
    width: min(100%, 720px);
    max-height: calc(100vh - 24px);
    overflow: auto;
  }

  .message-toolbar {
    grid-template-columns: 1fr;
  }

  .message-tabs {
    grid-template-columns: 1fr;
  }

  .filters,
  .form-grid,
  .modifier-general-panel .collection-edit-form > .form-grid,
  .collection-field-main,
  .overview-config-card-grid,
  .photo-preview-row,
  .import-report,
  .profile-cropper,
  .profile-collection-rename,
  .message-layout,
  .overview-feature-row,
  .about-hero,
  .about-action-grid,
  .generic-item-detail,
  .showcase-detail-body,
  .collections-filters,
  .collection-card,
  .lexicon-detail-list,
  .overview-map-layout {
    grid-template-columns: 1fr;
  }

  .showcase-header,
  .showcase-country-header {
    align-items: start;
    flex-direction: column;
  }

  .showcase-shell {
    padding: 12px;
  }

  .showcase-cabinet {
    padding: 34px 14px 26px;
    border-radius: 14px;
  }

  .showcase-cabinet-back {
    inset: 26px 12px 22px;
  }

  .showcase-cabinet-frame span {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

  .showcase-frame-top,
  .showcase-frame-bottom {
    height: 12px;
  }

  .showcase-frame-left,
  .showcase-frame-right {
    width: 12px;
  }

  .showcase-lighting-layer {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  .showcase-lighting-layer span {
    height: 76px;
  }

  .showcase-shelf-stack {
    gap: 22px;
  }

  .showcase-shelf {
    min-height: 210px;
    padding: 22px 8px 46px;
  }

  .showcase-grid {
    grid-template-columns: repeat(auto-fit, minmax(126px, 176px));
    justify-content: center;
    gap: 18px 12px;
  }

  .showcase-item {
    width: min(100%, 176px);
  }

  .showcase-object {
    min-height: 132px;
  }

  .showcase-object-image img {
    max-height: 104px;
  }

  .showcase-panel-texture-editor {
    grid-template-columns: 1fr;
  }

  #showcaseItemModal {
    overflow: auto;
    padding: 8px;
  }

  .auth-card.showcase-detail-card {
    max-height: none;
    overflow: visible;
  }

  .showcase-postcard {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
    aspect-ratio: auto;
    min-height: 0;
    padding: 20px;
  }

  .showcase-postcard::before {
    display: none;
  }

  .showcase-postcard-stamp {
    justify-self: center;
    width: min(100%, 280px);
  }

  .showcase-postcard-address {
    padding-left: 0;
  }

  .showcase-postcard-edit {
    top: 56px;
    right: 18px;
  }

  .showcase-postcard-list {
    grid-template-columns: 1fr;
  }

  .travel-journal-shell {
    padding: 14px;
    overflow-x: auto;
  }

  .travel-journal-header {
    display: grid;
    align-items: start;
  }

  .travel-journal-meta {
    justify-items: start;
    text-align: left;
  }

  .travel-add-item-button {
    justify-self: start;
  }

  .travel-journal-page {
    min-height: 0;
    padding: 22px 14px;
    border-radius: 18px;
  }

  .travel-journal-stage {
    justify-content: start;
    padding-inline: 46px;
  }

  .travel-journal-spread {
    grid-template-columns: 1fr 1fr;
    min-width: 760px;
    min-height: 540px;
  }

  .travel-album-page {
    padding: 22px 18px;
  }

  .travel-ring-binding {
    width: 32px;
  }

  .travel-ring-binding::before {
    inset-inline: 13px;
  }

  .travel-ring-binding span {
    width: 32px;
    height: 22px;
  }

  .travel-page-header h4 {
    font-size: clamp(2rem, 13vw, 3.2rem);
  }

  .travel-photo-board {
    gap: 18px 12px;
  }

  .travel-photo-item,
  .travel-photo-small,
  .travel-photo-large {
    width: 132px;
  }

  .collections-filter-toggle {
    display: flex;
  }

  .collections-filters {
    display: none;
  }

  .collections-filters.open {
    display: grid;
  }

  .collections-page-head {
    padding: 22px;
  }

  .collections-page-head h2 {
    font-size: clamp(2rem, 14vw, 3.3rem);
  }

  .collections-results-grid {
    grid-template-columns: 1fr;
  }

  .collection-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .collection-card-cover {
    aspect-ratio: 16 / 7;
    min-height: 118px;
  }

  .collection-card button {
    justify-self: stretch;
  }

  .about-hero,
  .lexicon-hero {
    min-height: 0;
    padding: 22px;
  }

  .lexicon-hero-card {
    min-height: 150px;
  }

  .lexicon-entry-grid {
    grid-template-columns: 1fr;
  }

  .lexicon-letter-group,
  .lexicon-entry-row,
  .lexicon-edit-grid {
    grid-template-columns: 1fr;
  }

  .lexicon-letter-group h4 {
    position: static;
  }

  .lexicon-row-actions,
  .currency-actions {
    justify-content: flex-start;
  }

  .about-portrait {
    width: min(100%, 220px);
  }

  .message-layout {
    min-height: 0;
  }

  .message-list,
  .message-reader {
    max-height: none;
  }

  .message-toolbar {
    align-items: stretch;
  }

  .message-tabs {
    width: 100%;
  }

  .message-detail-meta {
    grid-template-columns: 1fr;
  }

  .message-detail-actions,
  .message-form-actions {
    justify-content: stretch;
  }

  .message-detail-actions button,
  .message-form-actions button {
    flex: 1 1 160px;
  }

  .profile-crop-preview {
    width: min(100%, 260px);
  }

  .profile-crop-actions {
    grid-column: auto;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow-x: visible;
  }

  .overview-layout-grid,
  .collection-fields-builder,
  .overview-blocks-editor,
  .overview-records-editor {
    grid-template-columns: 1fr;
  }

  .overview-block {
    grid-column: span 1 !important;
    grid-row: auto !important;
  }

  .overview-dashboard-editor {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .overview-grid-cell {
    display: none;
  }

  .overview-dashboard-block {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }

  .overview-dashboard-block {
    touch-action: auto;
  }

  .overview-map-preview {
    min-height: 170px;
    height: 190px;
  }

  .overview-config-modal-grid,
  .overview-records-editor-modal {
    grid-template-columns: 1fr;
  }

  .overview-map-preview-modal {
    min-height: 160px;
    height: 180px;
  }

  .collection-field-options {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 104px;
    padding: 13px 11px;
  }

  .metric-value {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .overview-world-map {
    min-height: 0;
  }

  .booklet {
    padding: 16px 12px 20px;
  }

  .generic-item-detail {
    min-height: 0;
    padding: 16px;
  }

  .generic-item-content h3 {
    font-size: clamp(1.7rem, 10vw, 2.5rem);
  }

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

  .page,
  .page-left,
  .page-right,
  .turn-face {
    padding: 18px;
  }

  .world-map {
    min-height: 0;
  }

  .turn-leaf {
    display: none;
  }

  .page-stack {
    display: none;
  }

  .page-edge-nav {
    width: 44px;
  }

  .page + .page {
    border-left: 0;
    border-top: 1px solid rgba(130, 96, 43, 0.24);
  }

  .detail-list,
  .currency-row,
  .bar-row,
  .qr-card {
    grid-template-columns: 1fr;
  }

  .bar-row {
    gap: 6px;
  }

  .image-lightbox-modal {
    padding: 8px;
  }

  .image-lightbox {
    width: 100%;
    max-height: calc(100vh - 16px);
    padding: 12px;
  }

  .image-lightbox-head {
    padding-right: 44px;
  }

  .image-lightbox-tools {
    width: 100%;
    margin-left: 0;
  }

  .image-lightbox-viewport {
    height: min(56vh, 460px);
    min-height: 240px;
  }

  .image-lightbox-side {
    width: 38px;
    height: 48px;
  }

  .image-lightbox-side.previous {
    left: 6px;
  }

  .image-lightbox-side.next {
    right: 6px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 14px, 1440px);
  }

  .site-header,
  .collection-hero,
  .panel {
    border-radius: 10px;
  }

  .site-header {
    padding: 8px;
  }

  .site-brand {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 9px;
  }

  .site-logo {
    width: 46px;
    height: 46px;
  }

  .site-logo-image {
    width: 40px;
    height: 40px;
  }

  .global-search input {
    min-height: 44px;
    font-size: 0.88rem;
  }

  .collection-result {
    grid-template-columns: 1fr;
  }

  .collection-result.has-thumb {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .collection-result.has-thumb .global-result-type {
    grid-column: 2;
    justify-self: start;
  }

  .global-result-thumb {
    width: 46px;
    height: 38px;
  }

  .site-nav-link {
    min-height: 38px;
    padding: 0 6px;
    font-size: 0.84rem;
  }

  .collection-card-meta,
  .country-popup-stats,
  .lexicon-detail-list,
  .message-detail-meta {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
  }

  .overview-feature-row,
  .overview-grid {
    gap: 10px;
  }

  .overview-world-map,
  .leaflet-map,
  .map-image {
    min-height: 260px;
  }

  .booklet {
    padding: 12px 8px 16px;
    border-radius: 12px;
  }

  .book-controls {
    flex-wrap: wrap;
  }

  .related-note {
    flex-basis: 132px;
  }

  .image-lightbox {
    border-radius: 12px;
  }

  .image-lightbox-title {
    min-width: 0;
  }

  .image-lightbox-tools .compact-action {
    flex: 1 1 72px;
  }

  .currency-table {
    min-width: 760px;
  }

  .lexicon-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .lexicon-head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  .profile-edit {
    grid-template-columns: 1fr;
  }

  .profile-card {
    width: min(100%, 96vw);
    max-height: calc(100vh - 18px);
    padding: 16px;
    border-radius: 14px;
  }

  .profile-public {
    grid-template-columns: 64px minmax(0, 1fr);
    padding: 12px;
  }

  .profile-avatar {
    width: 64px;
    font-size: 1.45rem;
  }

  .profile-tabs {
    border-radius: 12px;
  }

  .profile-tabs button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.88rem;
  }

  .profile-panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-panel-head .compact-action {
    width: 100%;
  }

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

  .profile-collections-grid {
    grid-template-columns: 1fr;
  }

  .profile-collection-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .profile-collection-cover {
    width: 72px;
    min-width: 72px;
  }

  .achievement-badge-row {
    padding-bottom: 8px;
  }

  .achievement-wall {
    --achievement-medal-size: clamp(50px, 14vw, 60px);
    --achievement-record-medal-size: var(--achievement-medal-size);
    padding: 12px;
  }

  .achievement-wall-header {
    align-items: stretch;
    flex-direction: column;
  }

  .achievement-wall-row {
    grid-template-columns: 1fr;
  }

  .achievement-medal-board .achievement-wall-row {
    grid-template-columns: 1fr;
  }

  .achievement-medal-row {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
    padding: 18px 14px 22px;
  }

  .achievement-wall-row .profile-achievement-head,
  .achievement-wall-row p,
  .achievement-wall-row .achievement-next,
  .achievement-wall-row .achievement-badge-row {
    grid-column: 1;
    grid-row: auto;
  }

  .achievement-badge {
    flex: 0 0 150px;
  }

  .badge-detail-content {
    grid-template-columns: 1fr;
  }

  .owner-summary-head {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .owner-summary-avatar {
    margin: 0 auto;
  }

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

  .owner-summary-actions {
    display: grid;
  }

  .profile-ranking-controls,
  .profile-ranking-controls label {
    width: 100%;
  }

  .profile-crop-actions {
    grid-column: 1;
  }
}

@media (max-width: 380px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    grid-template-columns: 1fr;
  }

  .account-avatar {
    width: 78px;
    height: 78px;
  }

  .profile-summary {
    grid-template-columns: 1fr;
  }

  .owner-summary-stats {
    grid-template-columns: 1fr;
  }
}

.achievement-medal-board-scroll {
  box-sizing: border-box;
  width: min(100%, 1320px);
  max-width: 100%;
  margin-inline: auto;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 10px 16px;
  border: 1px solid rgba(93, 68, 42, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.24), rgba(90, 63, 39, 0.08)),
    var(--paper-texture);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
  scrollbar-width: thin;
}

.profile-achievements,
.owner-summary-achievements {
  overflow-x: visible;
  overflow-y: visible;
}

.owner-summary-achievements {
  max-width: 100%;
  min-width: 0;
}

.owner-summary-achievements .achievement-medal-board-scroll {
  width: min(100%, 1320px);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
}

.achievement-medal-board {
  --achievement-medal-size: 88px;
  --achievement-record-medal-size: var(--achievement-medal-size);
  --achievement-medal-gap: 12px;
  width: 1280px;
  min-width: 1280px;
  max-width: none;
  margin-inline: auto;
}

.achievement-medal-board.compact {
  --achievement-medal-size: 62px;
  --achievement-record-medal-size: var(--achievement-medal-size);
  --achievement-medal-gap: 7px;
  width: 900px;
  min-width: 900px;
}

.achievement-medal-board .achievement-wall-row,
.owner-summary-achievements .achievement-medal-board.compact .achievement-wall-row {
  grid-template-columns: minmax(132px, 180px) minmax(0, 1fr);
  overflow: visible;
}

.achievement-medal-board.compact .achievement-wall-row,
.owner-summary-achievements .achievement-medal-board.compact .achievement-wall-row {
  grid-template-columns: minmax(98px, 124px) minmax(0, 1fr);
}

.achievement-medal-board .achievement-medal-row,
.owner-summary-achievements .achievement-medal-board.compact .achievement-medal-row {
  justify-content: space-between;
  overflow: visible;
  min-width: 0;
}

.achievement-medal-board .achievement-medal,
.achievement-medal-board .achievement-medal.record-medal {
  width: var(--achievement-medal-size);
  height: var(--achievement-medal-size);
  flex: 0 0 var(--achievement-medal-size);
}

.ranking-user-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.ranking-user-button:hover,
.ranking-user-button:focus-visible {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
  outline: none;
}

.ranking-profile-marker {
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.profile-record-medal {
  width: 44px;
  height: 44px;
  display: inline-grid;
  flex: 0 0 44px;
  place-items: center;
}

.profile-record-medal img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: transparent !important;
}

.profile-record-medal .achievement-medal-fallback {
  width: 36px;
  height: 36px;
  font-size: 0.92rem;
}

.profile-record-title-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.profile-record-title-copy strong,
.profile-record-title-copy em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.owner-summary-rankings {
  display: grid;
  gap: 12px;
}

.owner-summary-rankings .profile-ranking-card {
  padding: 12px;
}

.owner-summary-rankings .profile-ranking-table-wrap {
  max-height: 320px;
  overflow: auto;
}

/* Landing page refactor */
.landing-home-view.active {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: none;
  align-items: stretch;
  gap: 18px;
}

.landing-home-view > :not(.home-landing) {
  display: none !important;
}

.home-landing {
  display: grid;
  gap: 18px;
}

.home-landing :is(h1, h2, h3) {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0;
}

.home-landing .rich-content {
  color: var(--ink-soft);
}

.home-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(30px, 5vw, 70px);
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.22);
  box-shadow: 0 22px 55px rgba(48, 40, 31, 0.13);
}

.home-hero-copy {
  display: grid;
  gap: 16px;
  max-width: 690px;
}

.home-hero h1 {
  max-width: 720px;
  font-size: clamp(2.25rem, 5vw, 4.55rem);
  line-height: 1.04;
}

.home-hero-text {
  max-width: 660px;
  font-size: clamp(1rem, 1.15vw, 1.18rem);
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.home-hero-actions .primary-action,
.home-hero-actions .secondary-action {
  min-height: 54px;
  padding-inline: 22px;
}

.home-hero-visual {
  min-height: 320px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 52% 48%, rgba(255, 253, 247, 0.92), transparent 48%),
    radial-gradient(circle at 50% 50%, rgba(183, 139, 50, 0.18), transparent 62%),
    linear-gradient(135deg, rgba(255, 253, 247, 0.48), rgba(251, 241, 220, 0.28));
}

.home-hero-visual img {
  width: min(100%, 430px);
  max-height: 390px;
  object-fit: contain;
  filter: drop-shadow(0 18px 24px rgba(48, 40, 31, 0.16));
}

.home-hero-visual.is-empty span {
  width: min(78%, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid rgba(183, 139, 50, 0.42);
  border-radius: 999px;
  color: var(--green-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 900;
  background:
    radial-gradient(circle at 60% 22%, rgba(217, 139, 157, 0.18), transparent 70px),
    rgba(255, 253, 247, 0.5);
}

.home-stats-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  padding: 18px 24px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(48, 40, 31, 0.08);
}

.home-stat-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px auto;
  grid-template-areas:
    "icon value"
    "icon label";
  gap: 2px 14px;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-right: 1px solid rgba(130, 96, 43, 0.18);
}

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

.home-stat-icon {
  grid-area: icon;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(183, 139, 50, 0.32);
  border-radius: 10px;
  color: #9a6d1d;
  background: rgba(255, 253, 247, 0.58);
}

.home-stat-icon svg {
  width: 28px;
  height: 28px;
}

.home-stat-item strong {
  grid-area: value;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1;
}

.home-stat-item span:last-child {
  grid-area: label;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 760;
}

.home-featured,
.home-steps,
.home-author,
.home-final-cta {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(48, 40, 31, 0.1);
}

.home-section-head {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}

.home-section-head.compact {
  margin-bottom: 18px;
}

.home-section-head h2 {
  margin-top: 8px;
  font-size: clamp(1.65rem, 2.4vw, 2.45rem);
}

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

.home-feature-card {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(210px, 270px) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.2);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(48, 40, 31, 0.09);
}

.home-feature-cover {
  min-height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(47, 111, 91, 0.16), rgba(183, 139, 50, 0.18)),
    var(--paper-texture);
}

.home-feature-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-feature-cover.is-empty span {
  color: rgba(20, 34, 49, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 2vw, 2rem);
  font-weight: 900;
  text-align: center;
}

.home-feature-body {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 22px;
}

.home-feature-body h3 {
  font-size: clamp(1.35rem, 2vw, 2.05rem);
  line-height: 1.1;
}

.home-feature-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}

.home-feature-count {
  color: var(--ink-soft);
  font-weight: 880;
}

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

.home-step-card {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: 12px;
}

.home-step-card:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -22px;
  width: 18px;
  border-top: 2px solid rgba(183, 139, 50, 0.36);
}

.home-step-image {
  width: 110px;
  height: 110px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.64);
}

.home-step-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-step-image.is-empty span {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.2rem;
  font-weight: 900;
}

.home-step-number {
  position: absolute;
  top: 18px;
  left: 118px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #806018;
  background: rgba(239, 220, 178, 0.95);
  font-weight: 950;
}

.home-step-card h3 {
  padding-left: 34px;
  margin-bottom: 8px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 1rem;
}

.home-step-card .rich-content {
  padding-left: 34px;
  font-size: 0.92rem;
}

.home-author {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
}

.home-author .about-portrait {
  width: 92px;
  height: 92px;
  align-self: center;
}

.home-author-copy {
  display: grid;
  gap: 8px;
}

.home-author h2,
.home-final-cta h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.home-final-cta {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}

.home-final-cta .about-action-image {
  width: 160px;
  height: 110px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(183, 139, 50, 0.16), rgba(47, 111, 91, 0.1)),
    var(--paper-texture);
}

.home-final-cta .about-action-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.home-final-cta .about-action-image.is-empty span {
  color: var(--green-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
}

@media (max-width: 1120px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 0.62fr);
  }

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

  .home-step-card:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 860px) {
  .home-hero,
  .home-featured-grid,
  .home-author,
  .home-final-cta {
    grid-template-columns: 1fr;
  }

  .home-hero {
    min-height: 0;
  }

  .home-hero-visual {
    min-height: 220px;
  }

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

  .home-stat-item:nth-child(2) {
    border-right: 0;
  }

  .home-stat-item:nth-child(n + 3) {
    border-top: 1px solid rgba(130, 96, 43, 0.18);
  }

  .home-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-author,
  .home-final-cta {
    justify-items: start;
  }
}

@media (max-width: 560px) {
  .home-landing {
    gap: 14px;
  }

  .home-hero,
  .home-featured,
  .home-steps,
  .home-author,
  .home-final-cta {
    padding: 18px;
  }

  .home-stats-band {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .home-stat-item {
    justify-content: start;
    border-right: 0;
    border-top: 1px solid rgba(130, 96, 43, 0.18);
  }

  .home-stat-item:first-child {
    border-top: 0;
  }

  .home-feature-card {
    grid-template-rows: minmax(170px, 210px) minmax(0, 1fr);
  }

  .home-step-card {
    grid-template-columns: 1fr;
  }

  .home-step-number {
    top: 136px;
    left: 18px;
  }

  .home-step-card h3,
  .home-step-card .rich-content {
    padding-left: 34px;
  }
}

.home-title-accent {
  color: var(--home-title-accent-color, #a65a46);
}

.home-hero {
  position: relative;
  grid-template-columns: minmax(0, 0.58fr) minmax(0, 0.42fr);
  isolation: isolate;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(255, 253, 247, var(--home-hero-fade-alpha, 0.82)) 0%,
      rgba(255, 253, 247, calc(var(--home-hero-fade-alpha, 0.82) * 0.92)) 32%,
      rgba(255, 253, 247, calc(var(--home-hero-fade-alpha, 0.82) * 0.54)) 56%,
      rgba(255, 253, 247, 0.08) 82%,
      rgba(255, 253, 247, 0) 100%
    );
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  grid-column: 1;
}

.home-hero-visual {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 0;
  width: min(58%, 760px);
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 0 14px 14px 0;
  background: transparent;
  pointer-events: none;
}

.home-hero-visual img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: var(--home-hero-image-position, center);
  filter: saturate(0.98) contrast(1.02);
}

.home-hero-visual.is-empty {
  opacity: 0.45;
}

.home-feature-cover-button {
  width: 100%;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  transition: opacity 180ms ease, filter 180ms ease;
}

.home-feature-cover-button:disabled {
  cursor: default;
  opacity: 1;
}

.home-feature-cover-button.is-clickable:hover,
.home-feature-cover-button.is-clickable:focus-visible {
  filter: brightness(1.03) saturate(1.04);
}

.home-feature-cover.is-dynamic-item {
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 253, 247, 0.68), rgba(237, 222, 190, 0.45)),
    var(--paper-texture);
}

.home-feature-cover.is-dynamic-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.home-feature-cover.is-changing img {
  opacity: 0.18;
}

.admin-home-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(130, 96, 43, 0.16);
}

.admin-home-settings-grid label {
  min-width: 0;
}

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
  }

  .home-hero::after {
    background:
      linear-gradient(
        180deg,
        rgba(255, 253, 247, 0.94) 0%,
        rgba(255, 253, 247, 0.86) 64%,
        rgba(255, 253, 247, 0.58) 100%
      );
  }

  .home-hero-visual {
    width: 100%;
    border-radius: 14px;
    opacity: 0.42;
  }

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

@media (max-width: 620px) {
  .admin-home-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Home framing, dynamic collections and public profile summary */
.home-hero {
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-height: clamp(420px, 48vw, 620px);
}

.home-hero::after {
  background:
    linear-gradient(
      90deg,
      rgba(255, 253, 247, var(--home-hero-fade-alpha, 0.82)) 0%,
      rgba(255, 253, 247, calc(var(--home-hero-fade-alpha, 0.82) * 0.88)) 38%,
      rgba(255, 253, 247, calc(var(--home-hero-fade-alpha, 0.82) * 0.48)) 68%,
      rgba(255, 253, 247, 0.18) 100%
    ),
    radial-gradient(circle at 18% 22%, rgba(255, 253, 247, 0.34), transparent 34%);
}

.home-hero-copy {
  max-width: min(720px, 72%);
}

.home-hero-visual {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  opacity: 1;
}

.home-hero-visual img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: var(--home-image-position-x, 50%) var(--home-image-position-y, 50%);
  transform: scale(var(--home-image-zoom, 1));
  transform-origin: var(--home-image-position-x, 50%) var(--home-image-position-y, 50%);
}

.home-feature-cover,
.home-step-image,
.home-author .about-portrait,
.home-final-cta .about-action-image {
  overflow: hidden;
}

.home-feature-cover img,
.home-step-image img,
.home-author .about-portrait img,
.home-final-cta .about-action-image img {
  object-position: var(--home-image-position-x, 50%) var(--home-image-position-y, 50%);
  transform: scale(var(--home-image-zoom, 1));
  transform-origin: var(--home-image-position-x, 50%) var(--home-image-position-y, 50%);
}

.home-feature-cover.is-dynamic-item img {
  transform: none;
  transform-origin: center;
}

.home-feature-cover.is-dynamic-collection img {
  transition: opacity 160ms ease, transform 200ms ease;
}

.home-feature-card {
  min-height: 100%;
}

.home-feature-body .rich-content {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.admin-home-crop-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(130, 96, 43, 0.16);
}

.admin-settings-card-head.compact {
  margin-bottom: 0;
}

.admin-home-crop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.admin-home-crop-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 12px;
  background: rgba(255, 253, 247, 0.72);
  border: 1px solid rgba(130, 96, 43, 0.16);
  border-radius: 10px;
}

.admin-home-crop-card strong {
  color: var(--ink);
}

.admin-home-crop-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 820;
}

.admin-home-crop-card select {
  width: 100%;
  min-height: 38px;
}

.admin-home-crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: var(--admin-home-crop-ratio, 1 / 1);
  min-height: 148px;
  max-height: 260px;
  overflow: hidden;
  border: 1px solid rgba(130, 96, 43, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(47, 111, 91, 0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(47, 111, 91, 0.08) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(47, 111, 91, 0.08) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(47, 111, 91, 0.08) 75%),
    rgba(255, 253, 247, 0.78);
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  background-repeat: repeat;
  background-size: 18px 18px;
  cursor: grab;
  isolation: isolate;
  touch-action: none;
}

.admin-home-crop-stage.is-dragging {
  cursor: grabbing;
}

.admin-home-crop-stage img {
  width: 100%;
  height: 100%;
  object-fit: var(--home-image-object-fit, cover);
  object-position: var(--home-image-position-x, 50%) var(--home-image-position-y, 50%);
  transform: scale(var(--home-image-zoom, 1));
  transform-origin: var(--home-image-position-x, 50%) var(--home-image-position-y, 50%);
  pointer-events: none;
  user-select: none;
}

.admin-home-crop-stage.home-image-as-background,
.home-image-as-background {
  background-image: var(--home-image-background-image);
  background-position: var(--home-image-background-position, center);
  background-repeat: var(--home-image-background-repeat, no-repeat);
  background-size: var(--home-image-background-size, cover);
}

.admin-home-crop-stage.home-image-as-background img,
.home-image-as-background > img {
  opacity: 0;
}

.admin-home-crop-frame {
  position: absolute;
  inset: 10px;
  z-index: 2;
  border: 2px solid rgba(255, 253, 247, 0.96);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px rgba(47, 111, 91, 0.46),
    0 0 0 999px rgba(26, 39, 46, 0.16);
  pointer-events: none;
}

.admin-home-crop-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 14px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.home-hero-visual,
.home-feature-cover,
.home-step-image,
.home-author .about-portrait,
.home-final-cta .about-action-image {
  background-position: var(--home-image-background-position, center);
  background-repeat: var(--home-image-background-repeat, no-repeat);
  background-size: var(--home-image-background-size, cover);
}

.home-hero-visual img,
.home-feature-cover img,
.home-step-image img,
.home-author .about-portrait img,
.home-final-cta .about-action-image img {
  object-fit: var(--home-image-object-fit, cover);
}

.presentation-mode-trial.compact {
  flex: 0 1 auto;
  min-width: 0;
  width: auto;
  justify-content: flex-start;
  padding: 6px 8px;
  border-radius: 999px;
}

.presentation-mode-trial.compact > strong {
  font-size: 0.78rem;
  white-space: nowrap;
}

.presentation-mode-trial.compact label {
  gap: 6px;
  font-size: 0.78rem;
}

.presentation-mode-trial.compact select {
  min-width: 128px;
  min-height: 34px;
  padding-block: 4px;
}

.book-controls .presentation-mode-trial.compact {
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: var(--radius);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
}

.book-controls .presentation-mode-trial.compact > strong {
  display: none;
}

.book-controls .presentation-mode-trial.compact label {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  margin: 0;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}

.book-controls .presentation-mode-trial.compact select {
  min-width: 86px;
  min-height: 28px;
  height: 28px;
  padding: 0 26px 0 8px;
  border: 1px solid rgba(130, 96, 43, 0.22);
  border-radius: calc(var(--radius) - 2px);
  background-color: rgba(255, 253, 247, 0.72);
  color: inherit;
  font: inherit;
}

.book-controls .presentation-mode-trial.compact:hover,
.book-controls .presentation-mode-trial.compact:focus-within {
  background: #e9eee8;
}

.profile-public-summary-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-public-summary-card {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 253, 247, 0.74);
  border: 1px solid rgba(130, 96, 43, 0.18);
  border-radius: var(--radius);
}

.profile-public-collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-public-collection-card {
  width: 100%;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--collection-accent, #2f6f5b) 30%, transparent);
  border-left: 4px solid var(--collection-accent, #2f6f5b);
  border-radius: 10px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--collection-accent, #2f6f5b) 18%, transparent), transparent 46%),
    rgba(255, 255, 255, 0.76);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.profile-public-collection-card:hover,
.profile-public-collection-card:focus-visible {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 111, 91, 0.12);
}

.profile-public-collection-cover {
  width: 74px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--collection-accent, #2f6f5b) 20%, transparent), rgba(183, 139, 50, 0.13)),
    #f7faf6;
  color: var(--collection-accent, var(--green-dark));
  font-weight: 950;
}

.profile-public-collection-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-public-collection-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.profile-public-collection-copy strong,
.profile-public-collection-copy em,
.profile-public-collection-copy small {
  min-width: 0;
  overflow: hidden;
}

.profile-public-collection-copy strong {
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-public-collection-copy em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 820;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-public-collection-copy small {
  display: -webkit-box;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.profile-public-summary-activity .owner-summary-activity {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
}

.profile-public-summary-activity .owner-summary-activity-list {
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}

/* Shared home image framing: admin preview and public render use the same transform model. */
.admin-home-crop-stage img,
.home-hero-visual img,
.home-feature-cover img,
.home-step-image img,
.home-author .about-portrait img,
.home-final-cta .about-action-image img {
  object-position: center;
  transform: translate(var(--home-image-offset-x, 0%), var(--home-image-offset-y, 0%)) scale(var(--home-image-zoom, 1));
  transform-origin: center;
}

.home-feature-cover.is-dynamic-item img {
  transform: none;
}

@media (max-width: 900px) {
  .home-hero {
    min-height: 0;
  }

  .home-hero-copy {
    max-width: 100%;
  }

  .home-hero::after {
    background:
      linear-gradient(
        180deg,
        rgba(255, 253, 247, 0.9) 0%,
        rgba(255, 253, 247, 0.82) 70%,
        rgba(255, 253, 247, 0.56) 100%
      );
  }

  .profile-public-summary-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .presentation-mode-trial.compact {
    align-items: stretch;
    flex-direction: column;
    border-radius: 10px;
  }

  .book-controls .presentation-mode-trial.compact {
    align-items: center;
    flex-direction: row;
    width: auto;
    border-radius: var(--radius);
  }

  .book-controls .presentation-mode-trial.compact label {
    flex-direction: row;
  }

  .presentation-mode-trial.compact > strong {
    white-space: normal;
  }

  .profile-public-collection-grid {
    grid-template-columns: 1fr;
  }
}
