/* ==========================================================================
   山海小集 — public exhibition + content console
   A mobile-first visual system built without a framework or webfont request.
   ========================================================================== */

:root {
  --ink: #202b25;
  --ink-deep: #16211b;
  --ink-soft: #47544b;
  --muted: #727a71;
  --paper: #f4f0e6;
  --paper-deep: #e9e1d1;
  --paper-light: #fbf8f1;
  --cream: #fffaf0;
  --accent: #b05230;
  --accent-deep: #8d3e22;
  --jade: #526b5a;
  --jade-light: #9cae9d;
  --gold: #b88a4a;
  --line: rgba(32, 43, 37, 0.14);
  --line-strong: rgba(32, 43, 37, 0.24);
  --line-light: rgba(255, 250, 240, 0.22);
  --danger: #9e3f2d;
  --success: #4f6d55;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --shadow-soft: 0 18px 60px rgba(36, 39, 29, 0.12);
  --shadow-deep: 0 24px 80px rgba(13, 20, 16, 0.28);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --content: 1160px;
  --admin-content: 1320px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body.is-locked {
  overflow: hidden;
}

body.has-adminbar {
  padding-top: 44px;
}

body.has-adminbar .floating-nav {
  top: 44px;
}

body.has-adminbar .home-hero {
  min-height: calc(94svh - 44px);
}

::selection {
  background: var(--accent);
  color: var(--cream);
}

h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
}

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

button {
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

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

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

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

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

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

.app {
  min-height: 100svh;
}

.public-view {
  overflow: clip;
}

.view-enter {
  animation: view-fade 0.65s var(--ease) both;
}

@keyframes view-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --------------------------------------------------------------------------
   Boot screen, toasts, basic utilities
   -------------------------------------------------------------------------- */

.boot-screen {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background:
    radial-gradient(circle at 50% 35%, rgba(175, 137, 85, 0.13), transparent 30%),
    var(--ink-deep);
  color: rgba(255, 250, 240, 0.72);
  font-size: 13px;
  letter-spacing: 0.16em;
}

.boot-seal {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 250, 240, 0.48);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 29px;
  display: grid;
  place-items: center;
  border-radius: 2px;
  animation: seal-breathe 2.2s ease-in-out infinite;
}

.boot-line {
  width: 44px;
  height: 1px;
  background: currentColor;
  opacity: 0.4;
  overflow: hidden;
  position: relative;
}

.boot-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateX(-100%);
  animation: boot-line 1.6s ease-in-out infinite;
}

@keyframes seal-breathe {
  0%, 100% { opacity: 0.55; transform: scale(0.97); }
  50% { opacity: 1; transform: scale(1); }
}

@keyframes boot-line {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

.noscript {
  padding: 32px;
  font-family: var(--sans);
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(90vw, 440px);
  pointer-events: none;
}

.toast {
  background: rgba(22, 33, 27, 0.95);
  color: var(--cream);
  border: 1px solid rgba(255, 250, 240, 0.15);
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-deep);
  animation: toast-in 0.28s var(--ease) both;
  max-width: 100%;
  text-align: center;
}

.toast.is-error {
  background: rgba(117, 47, 31, 0.97);
}

.toast.is-leaving {
  animation: toast-out 0.24s ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

.container {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding-inline: clamp(20px, 5vw, 54px);
}

.kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.6;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  flex: none;
}

.kicker--plain::before {
  display: none;
}

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

.muted {
  color: var(--muted);
}

.seal {
  display: inline-grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: none;
  border-radius: 2px;
  background: var(--accent);
  color: var(--cream);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.18);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-lockup__text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.brand-lockup__text strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-lockup__text small {
  font-size: 8px;
  letter-spacing: 0.22em;
  line-height: 1.5;
  opacity: 0.6;
  text-transform: uppercase;
  white-space: nowrap;
}

.dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
}

.btn:hover {
  background: var(--accent);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.btn--accent {
  background: var(--accent);
}

.btn--accent:hover {
  background: var(--accent-deep);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn--ghost:hover {
  background: rgba(32, 43, 37, 0.06);
  border-color: var(--ink);
  color: var(--ink);
}

.btn--light {
  background: var(--cream);
  color: var(--ink);
}

.btn--light:hover {
  background: #fff;
}

.btn--danger {
  background: transparent;
  border-color: rgba(158, 63, 45, 0.35);
  color: var(--danger);
}

.btn--danger:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--small {
  min-height: 36px;
  padding: 0 13px;
  font-size: 12px;
}

.btn--wide {
  width: 100%;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke-width: 1.7;
}

.icon--small {
  width: 15px;
  height: 15px;
}

.icon--large {
  width: 22px;
  height: 22px;
}

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--large {
  width: 28px;
  height: 28px;
  border-width: 2px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Public top navigation
   -------------------------------------------------------------------------- */

.site-head {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: calc(22px + var(--safe-top)) clamp(20px, 5vw, 54px) 0;
  color: var(--cream);
}

.home-hero .site-head .brand-lockup__text strong {
  color: var(--cream);
}

.site-edition {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 250, 240, 0.68);
  white-space: nowrap;
}

.site-edition::after {
  content: "";
  width: 30px;
  height: 1px;
  background: rgba(255, 250, 240, 0.35);
}

.floating-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: calc(68px + var(--safe-top));
  padding: var(--safe-top) clamp(16px, 5vw, 46px) 0;
  color: var(--cream);
  background: linear-gradient(180deg, rgba(17, 26, 21, 0.58), rgba(17, 26, 21, 0));
  transition: background 0.35s ease, height 0.35s ease, backdrop-filter 0.35s ease;
}

.floating-nav.is-scrolled {
  height: calc(58px + var(--safe-top));
  background: rgba(22, 33, 27, 0.93);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.floating-nav__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 11px;
  border: 1px solid rgba(255, 250, 240, 0.26);
  border-radius: 999px;
  color: var(--cream);
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(22, 33, 27, 0.1);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.floating-nav__back:hover {
  border-color: rgba(255, 250, 240, 0.6);
  background: rgba(22, 33, 27, 0.5);
}

.floating-nav .brand-lockup {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.floating-nav .brand-lockup__text small {
  opacity: 0.5;
}

.floating-nav__spacer {
  width: 78px;
}

@media (max-width: 560px) {
  .floating-nav .brand-lockup__text small {
    display: none;
  }
  .floating-nav .brand-lockup__text strong {
    font-size: 14px;
  }
  .floating-nav__back span {
    display: none;
  }
  .floating-nav__back {
    width: 38px;
    padding: 0;
    justify-content: center;
  }
  .floating-nav__spacer {
    width: 38px;
  }
}

/* --------------------------------------------------------------------------
   Home — hero
   -------------------------------------------------------------------------- */

.home-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 94svh;
  overflow: hidden;
  color: var(--cream);
  background: var(--ink-deep);
}

.home-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--jade);
  background-size: cover;
  background-position: center 42%;
  transform: scale(1.025);
  animation: hero-breathe 26s ease-in-out infinite alternate;
}

.home-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 22, 17, 0.4) 0%, rgba(13, 22, 17, 0.04) 34%, rgba(13, 22, 17, 0.18) 58%, rgba(13, 22, 17, 0.8) 100%),
    linear-gradient(90deg, rgba(13, 22, 17, 0.3), transparent 60%);
}

.home-hero__media--empty {
  background:
    radial-gradient(circle at 72% 26%, rgba(205, 165, 100, 0.48), transparent 24%),
    linear-gradient(150deg, #6f8373 0%, #354b3d 45%, #17231d 100%);
}

@keyframes hero-breathe {
  from { transform: scale(1.025); }
  to { transform: scale(1.065); }
}

.hero-stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(42px, 9vh, 104px) clamp(20px, 5vw, 54px) clamp(30px, 6vh, 70px);
}

.hero-copy {
  margin-top: auto;
  max-width: 780px;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.24em;
  color: rgba(255, 250, 240, 0.8);
}

.hero-kicker::before {
  content: "";
  width: 42px;
  height: 1px;
  background: rgba(255, 250, 240, 0.5);
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(62px, 12vw, 142px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0.055em;
  color: var(--cream);
  text-wrap: balance;
  text-shadow: 0 2px 40px rgba(10, 20, 14, 0.25);
}

.hero-title--long {
  font-size: clamp(46px, 8.5vw, 96px);
  line-height: 1.12;
}

.hero-subtitle {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 22px;
  font-family: var(--serif);
  font-size: clamp(18px, 2.4vw, 25px);
  letter-spacing: 0.08em;
  color: rgba(255, 250, 240, 0.9);
}

.hero-subtitle::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--gold);
}

.hero-intro {
  max-width: 35em;
  margin-top: 20px;
  font-size: clamp(13px, 1.4vw, 15px);
  line-height: 2;
  color: rgba(255, 250, 240, 0.7);
  letter-spacing: 0.03em;
}

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-top: clamp(34px, 6vh, 64px);
  padding-top: 22px;
  border-top: 1px solid rgba(255, 250, 240, 0.18);
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: rgba(255, 250, 240, 0.7);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scroll-cue__line {
  position: relative;
  width: 1px;
  height: 38px;
  background: rgba(255, 250, 240, 0.22);
  overflow: hidden;
}

.scroll-cue__line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--cream);
  transform: translateY(-100%);
  animation: scroll-line 2.4s ease-in-out infinite;
}

@keyframes scroll-line {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

.hero-index {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(255, 250, 240, 0.55);
}

.hero-index strong {
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  color: var(--cream);
}

.hero-side-note {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  bottom: clamp(96px, 16vh, 160px);
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: rgba(255, 250, 240, 0.38);
  display: none;
}

@media (min-width: 900px) {
  .hero-side-note {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   Home — table of contents
   -------------------------------------------------------------------------- */

.home-chapters {
  position: relative;
  padding: clamp(56px, 9vw, 110px) 0 clamp(54px, 8vw, 110px);
  background:
    radial-gradient(circle at 90% 6%, rgba(176, 82, 48, 0.06), transparent 23%),
    var(--paper);
}

.section-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-intro__copy {
  max-width: 650px;
}

.section-intro h2 {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: clamp(36px, 5.2vw, 64px);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.22;
  color: var(--ink);
}

.section-intro p {
  max-width: 35em;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.section-aside {
  flex: none;
  padding-bottom: 8px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-align: right;
}

.section-aside strong {
  display: block;
  margin-bottom: 4px;
  font-size: 34px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: var(--ink);
}

.chapter-list {
  display: grid;
  gap: clamp(20px, 3.3vw, 38px);
  margin-top: clamp(34px, 5vw, 58px);
}

.chapter-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  min-height: 390px;
  overflow: hidden;
  background: var(--paper-deep);
  border: 1px solid rgba(32, 43, 37, 0.1);
  color: var(--ink);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.chapter-card--reverse {
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.chapter-card--reverse .chapter-card__media {
  order: 2;
}

.chapter-card__media {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  background: var(--jade);
}

.chapter-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter 0.6s ease;
}

.chapter-card:hover .chapter-card__media img {
  transform: scale(1.04);
}

.chapter-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14, 23, 18, 0.12), transparent 36%, rgba(14, 23, 18, 0.28));
  pointer-events: none;
}

.chapter-number {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 250, 240, 0.28);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(20, 31, 25, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.chapter-card__body {
  display: flex;
  flex-direction: column;
  padding: clamp(27px, 4vw, 52px);
}

.chapter-card__body .kicker {
  margin-bottom: 17px;
}

.chapter-card h3 {
  font-family: var(--serif);
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.05em;
  color: var(--ink);
}

.chapter-subtitle {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: clamp(16px, 1.8vw, 21px);
  color: var(--accent);
  letter-spacing: 0.04em;
}

.chapter-intro {
  max-width: 30em;
  margin-top: 20px;
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.95;
}

.chapter-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.chapter-count {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.chapter-arrow {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.chapter-card:hover .chapter-arrow {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

@media (max-width: 860px) {
  .chapter-card,
  .chapter-card--reverse {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .chapter-card--reverse .chapter-card__media {
    order: 0;
  }
  .chapter-card__media {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
  .chapter-card__body {
    padding: 26px 24px 24px;
  }
  .chapter-intro {
    margin-top: 15px;
  }
  .chapter-foot {
    padding-top: 22px;
    margin-top: 22px;
  }
}

@media (max-width: 560px) {
  .section-intro {
    align-items: flex-start;
  }
  .section-aside {
    display: none;
  }
  .chapter-card h3 {
    font-size: 34px;
  }
  .chapter-card__media {
    aspect-ratio: 1.28 / 1;
  }
  .hero-bottom {
    align-items: flex-start;
  }
  .hero-index {
    display: none;
  }
}

.chapter-empty {
  display: grid;
  gap: 8px;
  padding: 50px 26px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.media-empty {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 100%;
  color: rgba(255, 250, 240, 0.52);
  background:
    radial-gradient(circle at 68% 25%, rgba(208, 172, 112, 0.32), transparent 26%),
    linear-gradient(145deg, #829688, #526b5a 48%, #2a4034);
  font-family: var(--serif);
  font-size: clamp(44px, 9vw, 96px);
  line-height: 1;
}

.chapter-card__media > .media-empty,
.entry-card__media > .media-empty {
  position: absolute;
  inset: 0;
}

.entry-card__media {
  position: relative;
}

.media-empty span {
  opacity: 0.65;
  border: 1px solid currentColor;
  padding: 0.08em 0.18em;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--cream);
}

.site-footer__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 96px) clamp(20px, 5vw, 54px) calc(120px + var(--safe-bottom));
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: clamp(34px, 7vw, 100px);
  align-items: end;
}

.footer-title {
  margin-top: 20px;
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 76px);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.footer-copy {
  max-width: 28em;
  margin-top: 18px;
  font-size: 13px;
  line-height: 1.9;
  color: rgba(255, 250, 240, 0.55);
}

.footer-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.footer-note {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.16em;
  line-height: 1.8;
  color: rgba(255, 250, 240, 0.46);
}

.admin-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 43px;
  padding: 0 16px;
  border: 1px solid rgba(255, 250, 240, 0.22);
  border-radius: 2px;
  color: rgba(255, 250, 240, 0.82);
  font-size: 12px;
  letter-spacing: 0.06em;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.admin-login-link:hover {
  border-color: var(--gold);
  color: var(--cream);
  background: rgba(255, 250, 240, 0.04);
}

.footer-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(46px, 7vw, 80px);
  padding-top: 20px;
  border-top: 1px solid rgba(255, 250, 240, 0.12);
  color: rgba(255, 250, 240, 0.34);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.footer-watermark {
  position: absolute;
  z-index: 1;
  right: -2vw;
  bottom: -7vw;
  color: rgba(255, 250, 240, 0.035);
  font-family: var(--serif);
  font-size: clamp(160px, 30vw, 410px);
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.dock-spacer {
  height: calc(92px + var(--safe-bottom));
  background: var(--paper);
}

@media (max-width: 760px) {
  .footer-top {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .footer-base {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* --------------------------------------------------------------------------
   Contact dock + contact sheet
   -------------------------------------------------------------------------- */

.contact-dock {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: calc(13px + var(--safe-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 30px), 520px);
  pointer-events: none;
}

.contact-dock__button {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 10px 0 20px;
  border: 1px solid rgba(255, 250, 240, 0.12);
  border-radius: 999px;
  background: rgba(22, 33, 27, 0.96);
  color: var(--cream);
  box-shadow: 0 14px 38px rgba(15, 23, 18, 0.27);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  text-align: left;
  transition: transform 0.25s var(--ease), background 0.25s ease;
}

.contact-dock__button:hover {
  background: var(--ink-deep);
  transform: translateY(-2px);
}

.contact-dock__button:active {
  transform: scale(0.99);
}

.contact-dock__icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  color: var(--gold);
}

.contact-dock__label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.contact-dock__label strong {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.contact-dock__label small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(255, 250, 240, 0.48);
}

.contact-dock__arrow {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.25s ease;
}

.contact-dock__button:hover .contact-dock__arrow {
  transform: rotate(-35deg);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(12, 20, 15, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.overlay.is-visible {
  opacity: 1;
}

.overlay--center {
  align-items: center;
}

.contact-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 560px);
  max-height: 92dvh;
  overflow: hidden;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-deep);
  transform: translateY(26px);
  transition: transform 0.42s var(--ease);
}

.overlay.is-visible .contact-sheet {
  transform: translateY(0);
}

.contact-sheet__hero {
  position: relative;
  flex: none;
  min-height: 218px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 25px 25px;
  color: var(--cream);
  background-color: var(--jade);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.contact-sheet__hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 24, 18, 0.12) 0%, rgba(15, 24, 18, 0.22) 42%, rgba(15, 24, 18, 0.85) 100%);
}

.contact-sheet__hero > * {
  position: relative;
  z-index: 1;
}

.contact-sheet__close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.25);
  border-radius: 50%;
  color: var(--cream);
  background: rgba(15, 24, 18, 0.2);
}

.contact-sheet__close:hover {
  background: rgba(15, 24, 18, 0.55);
}

.contact-sheet__close:focus-visible {
  outline: 1px solid rgba(255, 250, 240, 0.8);
  outline-offset: 3px;
}

.contact-sheet__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: rgba(255, 250, 240, 0.64);
}

.contact-sheet__eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.contact-sheet__title {
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 35px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.contact-sheet__intro {
  margin-top: 8px;
  max-width: 36em;
  color: rgba(255, 250, 240, 0.72);
  font-size: 12px;
  line-height: 1.85;
}

.contact-sheet__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 25px calc(24px + var(--safe-bottom));
  background:
    radial-gradient(circle at 100% 0, rgba(176, 82, 48, 0.065), transparent 30%),
    var(--paper);
}

.contact-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contact-method {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.54);
}

.contact-method__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--accent);
}

.contact-method__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.contact-method__copy small {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.contact-method__copy strong,
.contact-method__copy a {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-method__copy a {
  display: block;
  min-width: 0;
}

.contact-method__copy a:hover {
  color: var(--accent);
}

.contact-copy {
  margin-left: auto;
  flex: none;
  padding: 4px;
  color: var(--muted);
}

.contact-copy:hover {
  color: var(--accent);
}

.contact-facts {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.contact-fact {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 13px;
  align-items: start;
  font-size: 12px;
  line-height: 1.8;
}

.contact-fact dt {
  color: var(--muted);
  letter-spacing: 0.06em;
}

.contact-fact dd {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.contact-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

.contact-gallery button {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--paper-deep);
}

.contact-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.contact-gallery button:hover img {
  transform: scale(1.04);
}

.contact-sheet__footer {
  display: flex;
  gap: 9px;
  margin-top: 18px;
}

.contact-sheet__footer .btn {
  flex: 1;
}

@media (min-width: 700px) {
  .overlay {
    padding: 28px;
  }
  .contact-sheet {
    border-radius: 3px;
    max-height: min(86dvh, 850px);
  }
  .contact-sheet__hero {
    min-height: 250px;
    padding: 30px 32px;
  }
  .contact-sheet__body {
    padding: 24px 32px 30px;
  }
}

@media (max-width: 420px) {
  .contact-methods {
    grid-template-columns: 1fr;
  }
  .contact-dock__button {
    min-height: 53px;
    padding-left: 17px;
  }
  .contact-dock__label small {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Detail pages — shared
   -------------------------------------------------------------------------- */

.detail-page {
  background: var(--paper);
}

.detail-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: clamp(430px, 68svh, 760px);
  overflow: hidden;
  color: var(--cream);
  background: var(--jade);
}

.detail-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--jade);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  animation: hero-breathe 24s ease-in-out infinite alternate;
}

.detail-hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(13, 22, 17, 0.35) 0%, rgba(13, 22, 17, 0.08) 30%, rgba(13, 22, 17, 0.36) 65%, rgba(13, 22, 17, 0.86) 100%),
    linear-gradient(90deg, rgba(13, 22, 17, 0.24), transparent 65%);
}

.detail-hero__media--empty {
  background:
    radial-gradient(circle at 72% 25%, rgba(205, 165, 100, 0.4), transparent 24%),
    linear-gradient(150deg, #728778, #32473a 50%, #17231d);
}

.detail-hero__inner {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 120px clamp(20px, 5vw, 54px) clamp(38px, 5vw, 58px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255, 250, 240, 0.55);
}

.breadcrumb a {
  color: rgba(255, 250, 240, 0.72);
  border-bottom: 1px solid transparent;
}

.breadcrumb a:hover {
  border-bottom-color: rgba(255, 250, 240, 0.5);
}

.breadcrumb span {
  opacity: 0.55;
}

.detail-hero h1 {
  max-width: 900px;
  font-family: var(--serif);
  font-size: clamp(42px, 8vw, 96px);
  font-weight: 500;
  line-height: 1.16;
  letter-spacing: 0.04em;
  text-wrap: balance;
}

.detail-hero h1.detail-hero__title--long {
  font-size: clamp(35px, 6vw, 70px);
}

.detail-hero__subtitle {
  max-width: 40em;
  margin-top: 16px;
  font-family: var(--serif);
  font-size: clamp(17px, 2.2vw, 23px);
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: rgba(255, 250, 240, 0.88);
}

.detail-hero__intro {
  max-width: 36em;
  margin-top: 16px;
  font-size: 13px;
  line-height: 1.95;
  color: rgba(255, 250, 240, 0.62);
}

.detail-hero__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 250, 240, 0.18);
  color: rgba(255, 250, 240, 0.5);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.detail-hero__meta .dot {
  background: var(--gold);
}

.detail-content {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: clamp(42px, 7vw, 90px) clamp(20px, 5vw, 54px) 0;
}

.editorial-row {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  gap: clamp(22px, 5vw, 74px);
  padding-bottom: clamp(34px, 5vw, 58px);
  border-bottom: 1px solid var(--line);
}

.editorial-row__label {
  padding-top: 7px;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.editorial-row__label::before {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-bottom: 12px;
  background: var(--accent);
}

.editorial-copy {
  max-width: 760px;
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 33px);
  font-weight: 400;
  line-height: 1.8;
  color: var(--ink);
}

.editorial-copy p + p {
  margin-top: 12px;
}

.entry-section {
  padding-top: clamp(36px, 5vw, 58px);
}

.entry-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.entry-section__head h2 {
  margin-top: 10px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.4vw, 40px);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.entry-section__count {
  padding-bottom: 5px;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--muted);
}

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

.entry-card {
  position: relative;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 72px;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-light);
  color: var(--ink);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.3s ease;
}

.entry-card:hover {
  transform: translateY(-3px);
  border-color: rgba(32, 43, 37, 0.24);
  box-shadow: 0 14px 44px rgba(35, 39, 28, 0.09);
}

.entry-card__media {
  min-height: 210px;
  overflow: hidden;
  background: var(--paper-deep);
}

.entry-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.9s var(--ease);
}

.entry-card:hover .entry-card__media img {
  transform: scale(1.04);
}

.entry-card__body {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 15px;
  padding: 25px 22px;
}

.entry-card__index {
  padding-top: 4px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
}

.entry-card .kicker {
  margin-bottom: 10px;
  font-size: 9px;
}

.entry-card h3 {
  font-family: var(--serif);
  font-size: clamp(23px, 2.6vw, 31px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.entry-subtitle {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--accent);
}

.entry-desc {
  max-width: 36em;
  margin-top: 11px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.entry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--jade);
  font-size: 10px;
  letter-spacing: 0.05em;
}

.entry-card__arrow {
  display: grid;
  place-items: center;
  align-self: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background 0.25s ease, color 0.25s ease;
}

.entry-card:hover .entry-card__arrow {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.page-endnote {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: clamp(42px, 6vw, 62px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.page-endnote a {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.page-endnote a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.page-endnote__mark {
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 190px;
  padding: 34px 20px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.empty-state strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  color: var(--ink);
}

@media (max-width: 800px) {
  .editorial-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .editorial-row__label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
  }
  .editorial-row__label::before {
    margin: 0;
  }
  .entry-card {
    grid-template-columns: 1fr;
  }
  .entry-card__media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }
  .entry-card__body {
    grid-template-columns: 26px minmax(0, 1fr);
    padding: 22px 20px 25px;
  }
  .entry-card__arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    width: 32px;
    height: 32px;
  }
  .entry-card__body {
    padding-right: 58px;
  }
}

@media (max-width: 540px) {
  .detail-hero {
    min-height: 60svh;
  }
  .detail-hero__inner {
    padding-bottom: 34px;
  }
  .detail-hero__intro {
    font-size: 12px;
  }
  .entry-section__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .page-endnote {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
}

/* --------------------------------------------------------------------------
   Item / article
   -------------------------------------------------------------------------- */

.item-page .detail-hero {
  min-height: clamp(470px, 78svh, 850px);
}

.item-hero__coverline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 250, 240, 0.58);
  font-size: 10px;
  letter-spacing: 0.15em;
}

.item-article {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 76px) clamp(22px, 5vw, 54px) 0;
}

.article-lead {
  position: relative;
  margin-bottom: clamp(38px, 6vw, 60px);
  padding-bottom: clamp(30px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}

.article-lead::before {
  content: "“";
  position: absolute;
  top: -28px;
  left: -6px;
  font-family: var(--serif);
  font-size: 100px;
  line-height: 1;
  color: rgba(176, 82, 48, 0.15);
  pointer-events: none;
}

.article-lead p {
  position: relative;
  font-family: var(--serif);
  font-size: clamp(21px, 3vw, 29px);
  line-height: 1.9;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.article-lead__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.article-body {
  font-size: 14px;
  line-height: 2.05;
  color: var(--ink-soft);
}

.article-body h2 {
  margin: 44px 0 15px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: clamp(25px, 3.4vw, 35px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.article-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.article-body h3 {
  margin: 34px 0 10px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.5vw, 25px);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}

.article-body h4 {
  margin: 26px 0 8px;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
}

.article-body p {
  margin: 0 0 17px;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.article-body strong {
  color: var(--ink);
  font-weight: 600;
}

.article-body ul,
.article-body ol {
  margin: 4px 0 22px;
  padding-left: 1.35em;
}

.article-body li {
  margin: 7px 0;
  padding-left: 0.3em;
}

.article-body li::marker {
  color: var(--accent);
  font-family: var(--serif);
}

.article-body blockquote {
  position: relative;
  margin: 24px 0;
  padding: 18px 20px 18px 23px;
  border-left: 2px solid var(--accent);
  background: rgba(233, 225, 209, 0.5);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
}

.article-body blockquote p {
  margin: 0;
}

.article-body hr {
  width: 54px;
  height: 1px;
  margin: 38px auto;
  border: 0;
  background: var(--line-strong);
}

.article-body .md-h2 + p,
.article-body .md-h3 + p {
  margin-top: 0;
}

.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.documents {
  margin-top: clamp(54px, 8vw, 86px);
  padding-top: clamp(30px, 4vw, 42px);
  border-top: 1px solid var(--line);
}

.documents__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.documents__head h2 {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 39px);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.documents__head p {
  max-width: 21em;
  padding-bottom: 4px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--muted);
  text-align: right;
}

.doc-list {
  display: grid;
  gap: 11px;
}

.doc-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 15px 18px 15px 15px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.7);
  text-align: left;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.doc-card:hover {
  border-color: var(--line-strong);
  background: var(--paper-light);
  transform: translateY(-2px);
}

.doc-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 46px;
  height: 57px;
  border: 1px solid rgba(176, 82, 48, 0.35);
  border-radius: 2px;
  background: rgba(176, 82, 48, 0.045);
  color: var(--accent);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.doc-type .icon {
  width: 17px;
  height: 17px;
}

.doc-card__copy {
  min-width: 0;
}

.doc-card__copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.doc-card__copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.doc-card__open {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.item-return {
  display: flex;
  justify-content: center;
  padding: clamp(38px, 6vw, 58px) 0 54px;
}

.item-return a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.item-return a:hover {
  border-color: var(--ink);
  color: var(--ink);
}

@media (max-width: 600px) {
  .documents__head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .documents__head p {
    text-align: left;
  }
  .doc-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }
  .doc-type {
    width: 42px;
    height: 53px;
  }
  .doc-card__open {
    grid-column: 2;
    margin-top: -4px;
  }
}

/* --------------------------------------------------------------------------
   Document reader
   -------------------------------------------------------------------------- */

.reader {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: flex;
  flex-direction: column;
  background: #eae4d8;
  animation: reader-in 0.35s var(--ease) both;
}

@keyframes reader-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.reader__bar {
  position: relative;
  z-index: 4;
  flex: none;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 10px;
  height: calc(62px + var(--safe-top));
  padding: var(--safe-top) 12px 0;
  background: rgba(247, 243, 234, 0.94);
  border-bottom: 1px solid rgba(32, 43, 37, 0.12);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.reader__close,
.reader__download {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.55);
}

.reader__close:hover,
.reader__download:hover {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}

.reader__close:focus-visible,
.reader__download:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.reader__bar-title {
  min-width: 0;
  text-align: center;
}

.reader__bar-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.reader__bar-title small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.reader__scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(42px + var(--safe-bottom));
}

.reader-heading {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 58px) clamp(22px, 5vw, 46px) 23px;
}

.reader-heading__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.reader-heading h1 {
  max-width: 18em;
  font-family: var(--serif);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.03em;
  color: var(--ink);
}

.reader-heading p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.reader__body {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 36px);
}

.pdf-pages {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.pdf-page {
  position: relative;
  overflow: hidden;
  background: #fffdf8;
  box-shadow: 0 10px 34px rgba(44, 42, 31, 0.17);
  border-radius: 1px;
}

.pdf-page img {
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.pdf-page__no {
  position: absolute;
  right: 10px;
  bottom: 9px;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(22, 33, 27, 0.62);
  color: rgba(255, 250, 240, 0.8);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.docx-paper {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(26px, 6vw, 64px) clamp(22px, 7vw, 72px) clamp(36px, 7vw, 78px);
  background: #fdfaf3;
  border: 1px solid rgba(32, 43, 37, 0.08);
  box-shadow: 0 12px 44px rgba(44, 42, 31, 0.12);
}

.docx-paper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold), transparent);
  opacity: 0.65;
}

.docx-content {
  color: #313b34;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2;
  overflow-wrap: anywhere;
}

.docx-content h2,
.docx-content h3,
.docx-content h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink);
}

.docx-content h2 {
  margin: 34px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(32, 43, 37, 0.13);
  font-size: clamp(23px, 3.3vw, 30px);
}

.docx-content h3 {
  margin: 27px 0 10px;
  font-size: clamp(19px, 2.6vw, 23px);
}

.docx-content h4 {
  margin: 22px 0 8px;
  font-size: 17px;
}

.docx-content h2:first-child,
.docx-content h3:first-child {
  margin-top: 0;
}

.docx-content p {
  margin: 0 0 14px;
}

.docx-content p:empty {
  display: none;
}

.docx-content .docx-subtitle {
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 17px;
  letter-spacing: 0.03em;
}

.docx-content strong {
  font-weight: 700;
  color: var(--ink);
}

.docx-content ul,
.docx-content ol {
  margin: 4px 0 18px;
  padding-left: 1.5em;
}

.docx-content li {
  margin: 5px 0;
}

.docx-content li::marker {
  color: var(--accent);
}

.docx-content blockquote {
  margin: 20px 0;
  padding: 13px 17px;
  border-left: 2px solid var(--accent);
  background: rgba(233, 225, 209, 0.5);
  color: var(--muted);
  font-family: var(--serif);
}

.docx-content blockquote p {
  margin: 0;
}

.docx-content .docx-table-wrap {
  margin: 21px 0;
  overflow-x: auto;
  border: 1px solid rgba(32, 43, 37, 0.13);
}

.docx-content table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.7;
}

.docx-content th,
.docx-content td {
  padding: 10px 13px;
  border-right: 1px solid rgba(32, 43, 37, 0.1);
  border-bottom: 1px solid rgba(32, 43, 37, 0.1);
  text-align: left;
  vertical-align: top;
}

.docx-content th {
  background: var(--ink);
  color: var(--cream);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.docx-content tr:nth-child(even) td {
  background: rgba(233, 225, 209, 0.28);
}

.docx-content th:last-child,
.docx-content td:last-child {
  border-right: 0;
}

.docx-content tr:last-child td {
  border-bottom: 0;
}

.docx-content .docx-figure {
  margin: 22px 0;
}

.docx-content .docx-figure img {
  width: 100%;
  height: auto;
  border: 1px solid rgba(32, 43, 37, 0.08);
}

.docx-content .docx-page-break {
  height: 1px;
  margin: 34px 0;
  border: 0;
  border-top: 1px dashed rgba(32, 43, 37, 0.2);
}

.docx-content .doc-align-center {
  text-align: center;
}

.docx-content .doc-align-right {
  text-align: right;
}

.docx-content .doc-align-justify {
  text-align: justify;
}

.docx-content .doc-tab {
  display: inline-block;
  width: 2em;
}

.docx-content .docx-empty {
  color: var(--muted);
  text-align: center;
}

.reader-download-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 820px;
  margin: 25px auto 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.55);
}

.reader-download-card__copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
}

.reader-download-card__copy small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 560px) {
  .docx-content {
    font-size: 14px;
    line-height: 1.95;
  }
  .docx-paper {
    padding: 26px 20px 34px;
  }
  .reader-download-card {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */

.login-page {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 82px 20px 42px;
  overflow: hidden;
  background: var(--ink-deep);
  color: var(--cream);
}

.login-page__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-color: var(--ink-deep);
  background-size: cover;
  background-position: center;
  filter: saturate(0.75);
}

.login-page__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 20%, rgba(181, 139, 76, 0.17), transparent 30%),
    linear-gradient(180deg, rgba(13, 21, 16, 0.55), rgba(13, 21, 16, 0.86));
}

.login-back {
  position: fixed;
  z-index: 4;
  top: calc(20px + var(--safe-top));
  left: clamp(16px, 4vw, 32px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 250, 240, 0.68);
  font-size: 11px;
  letter-spacing: 0.05em;
  padding: 7px 0;
}

.login-back:hover {
  color: var(--cream);
}

.login-vertical {
  position: absolute;
  z-index: 1;
  right: clamp(20px, 6vw, 90px);
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: rgba(255, 250, 240, 0.18);
  display: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: min(100%, 430px);
  padding: clamp(28px, 5vw, 44px);
  background: rgba(248, 244, 234, 0.98);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(176, 82, 48, 0.16);
  pointer-events: none;
}

.login-card__top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.login-card__top .seal {
  width: 43px;
  height: 43px;
  font-size: 23px;
}

.login-eyebrow {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.login-card h1 {
  position: relative;
  z-index: 1;
  font-family: var(--serif);
  font-size: clamp(29px, 5vw, 38px);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.login-card__sub {
  position: relative;
  z-index: 1;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.login-form {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 15px;
  margin-top: 28px;
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field span {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.login-field__input {
  position: relative;
}

.login-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  outline: 0;
  background: rgba(255, 252, 245, 0.72);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-field input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(32, 43, 37, 0.07);
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  transform: translateY(-50%);
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
}

.login-form .form-error {
  margin: 0;
}

.login-submit {
  margin-top: 4px;
  min-height: 49px;
}

.login-hint {
  position: relative;
  z-index: 1;
  margin-top: 19px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.login-security {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  color: rgba(32, 43, 37, 0.45);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.form-error {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid rgba(158, 63, 45, 0.25);
  background: rgba(158, 63, 45, 0.06);
  color: var(--danger);
  font-size: 11px;
  line-height: 1.7;
}

.form-success {
  padding: 9px 11px;
  border: 1px solid rgba(79, 109, 85, 0.25);
  background: rgba(79, 109, 85, 0.06);
  color: var(--success);
  font-size: 11px;
}

@media (min-width: 1000px) {
  .login-vertical {
    display: block;
  }
  .login-page {
    justify-content: flex-start;
    padding-left: clamp(70px, 12vw, 190px);
  }
}

/* --------------------------------------------------------------------------
   Admin — shell
   -------------------------------------------------------------------------- */

.admin-body {
  background: #ede8de;
}

.admin-app {
  min-height: 100svh;
  background:
    radial-gradient(circle at 100% 0, rgba(176, 82, 48, 0.04), transparent 24%),
    #ede8de;
  overflow-x: clip;
}

.admin-header {
  position: sticky;
  z-index: 70;
  top: 0;
  background: var(--ink-deep);
  color: var(--cream);
  box-shadow: 0 1px 0 rgba(255, 250, 240, 0.08);
}

.admin-header__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  max-width: var(--admin-content);
  margin: 0 auto;
  padding: 14px clamp(16px, 3vw, 30px) 13px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.admin-brand .seal {
  width: 31px;
  height: 31px;
  font-size: 16px;
  background: var(--accent);
}

.admin-brand__text {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.admin-brand__text strong {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.admin-brand__text span {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(255, 250, 240, 0.4);
  white-space: nowrap;
}

.admin-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.admin-user {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 8px;
  color: rgba(255, 250, 240, 0.5);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.admin-header__link,
.admin-header__logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 250, 240, 0.14);
  border-radius: 2px;
  color: rgba(255, 250, 240, 0.72);
  font-size: 10px;
  letter-spacing: 0.03em;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.admin-header__link:hover,
.admin-header__logout:hover {
  border-color: rgba(255, 250, 240, 0.42);
  color: var(--cream);
}

.admin-nav {
  display: flex;
  gap: 2px;
  width: 100%;
  max-width: var(--admin-content);
  margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 30px);
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-nav::-webkit-scrollbar {
  display: none;
}

.admin-nav__tab {
  position: relative;
  flex: none;
  padding: 12px 15px 13px;
  color: rgba(255, 250, 240, 0.48);
  font-size: 12px;
  letter-spacing: 0.06em;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.admin-nav__tab:hover {
  color: rgba(255, 250, 240, 0.85);
}

.admin-nav__tab.is-active {
  color: var(--cream);
  border-bottom-color: var(--accent);
}

.admin-main {
  width: 100%;
  max-width: var(--admin-content);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 38px) clamp(16px, 3vw, 30px) 80px;
}

.admin-tab-enter {
  animation: admin-view 0.35s var(--ease) both;
}

@keyframes admin-view {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.admin-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-bottom: 20px;
  padding: 12px 16px;
  border: 1px solid rgba(176, 82, 48, 0.25);
  background: rgba(255, 249, 237, 0.7);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.admin-alert strong {
  color: var(--accent);
  font-weight: 600;
}

.admin-alert button {
  color: var(--accent);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.admin-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 25px;
}

.admin-page-head h1 {
  margin-top: 7px;
  font-family: var(--serif);
  font-size: clamp(27px, 3.6vw, 37px);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.03em;
}

.admin-page-head p {
  max-width: 36em;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.admin-page-head__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.admin-eyebrow {
  color: var(--accent);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.admin-card {
  background: rgba(250, 247, 239, 0.82);
  border: 1px solid rgba(32, 43, 37, 0.11);
}

.admin-panel {
  padding: clamp(18px, 3vw, 28px);
}

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

.admin-panel__head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.admin-panel__head small {
  color: var(--muted);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Admin — overview
   -------------------------------------------------------------------------- */

.admin-welcome {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  min-height: 208px;
  padding: clamp(25px, 4vw, 38px);
  background:
    radial-gradient(circle at 78% 22%, rgba(192, 153, 94, 0.27), transparent 27%),
    linear-gradient(115deg, #263a2e, #17251d 68%);
  color: var(--cream);
}

.admin-welcome::after {
  content: "山";
  position: absolute;
  z-index: -1;
  right: 27px;
  bottom: -45px;
  color: rgba(255, 250, 240, 0.055);
  font-family: var(--serif);
  font-size: 230px;
  line-height: 1;
}

.admin-welcome__copy .admin-eyebrow {
  color: rgba(221, 193, 144, 0.8);
}

.admin-welcome h1 {
  max-width: 17em;
  margin-top: 11px;
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.04em;
}

.admin-welcome p {
  margin-top: 9px;
  max-width: 35em;
  color: rgba(255, 250, 240, 0.53);
  font-size: 11px;
  line-height: 1.9;
}

.admin-welcome__actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.admin-welcome__actions .btn {
  min-height: 38px;
  padding: 0 13px;
  font-size: 11px;
}

.admin-welcome__actions .btn--ghost {
  color: rgba(255, 250, 240, 0.75);
  border-color: rgba(255, 250, 240, 0.22);
}

.admin-welcome__actions .btn--ghost:hover {
  background: rgba(255, 250, 240, 0.08);
  color: var(--cream);
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 13px;
}

.admin-stat {
  position: relative;
  min-height: 130px;
  padding: 18px 18px 15px;
  overflow: hidden;
  background: rgba(250, 247, 239, 0.88);
  border: 1px solid rgba(32, 43, 37, 0.11);
}

.admin-stat::after {
  content: "";
  position: absolute;
  width: 48px;
  height: 48px;
  right: -18px;
  bottom: -16px;
  border: 1px solid rgba(176, 82, 48, 0.12);
  border-radius: 50%;
}

.admin-stat__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.admin-stat__label .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.admin-stat__value {
  margin-top: 13px;
  font-family: var(--serif);
  font-size: clamp(28px, 3.6vw, 37px);
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
}

.admin-stat__sub {
  margin-top: 9px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.6;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.8fr);
  gap: 13px;
  margin-top: 13px;
}

.chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: clamp(6px, 1.6vw, 16px);
  min-height: 174px;
  padding-top: 20px;
}

.chart--dense {
  min-width: 760px;
  gap: 6px;
}

.chart__col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
}

.chart__track {
  position: relative;
  width: 100%;
  max-width: 46px;
  height: 136px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.chart__value {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

.chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  width: 100%;
  height: 100%;
}

.chart__bar {
  width: 38%;
  max-width: 13px;
  min-height: 3px;
  background: linear-gradient(180deg, var(--jade), #869b8a);
  transition: height 0.8s var(--ease);
}

.chart__bar--accent {
  width: 18%;
  max-width: 6px;
  background: var(--accent);
}

.chart__col:hover .chart__bar {
  filter: brightness(0.9);
}

.chart__label {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chart__value {
  position: absolute;
  top: -16px;
  font-family: var(--serif);
  font-size: 9px;
  color: var(--ink-soft);
}

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 11px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--jade);
}

.legend-dot--accent {
  background: var(--accent);
}

.quick-list {
  display: grid;
}

.quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.quick-row:hover .quick-row__copy strong {
  color: var(--accent);
}

.quick-row:first-child {
  padding-top: 0;
}

.quick-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.quick-row__copy {
  min-width: 0;
}

.quick-row__copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
}

.quick-row__copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.quick-row__value {
  flex: none;
  font-family: var(--serif);
  font-size: 17px;
}

.admin-section-gap {
  margin-top: 13px;
}

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

.admin-shortcuts .btn {
  min-height: 36px;
  font-size: 11px;
}

@media (max-width: 900px) {
  .admin-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-overview-grid {
    grid-template-columns: 1fr;
  }
  .admin-welcome {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .admin-welcome__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 540px) {
  .admin-header__main {
    padding-block: 12px;
  }
  .admin-user {
    display: none;
  }
  .admin-header__link span,
  .admin-header__logout span {
    display: none;
  }
  .admin-header__link,
  .admin-header__logout {
    width: 32px;
    padding: 0;
    justify-content: center;
  }
  .admin-welcome {
    min-height: 0;
    padding: 22px 18px;
  }
  .admin-welcome h1 {
    font-size: 25px;
  }
  .admin-stat {
    min-height: 117px;
    padding: 14px;
  }
  .admin-stat__value {
    font-size: 30px;
  }
  .admin-page-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .admin-page-head__actions {
    width: 100%;
  }
  .admin-page-head__actions .btn {
    flex: 1;
  }
}

/* --------------------------------------------------------------------------
   Admin — traffic
   -------------------------------------------------------------------------- */

.range-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: rgba(32, 43, 37, 0.055);
  border: 1px solid var(--line);
}

.range-tab {
  min-height: 31px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.range-tab:hover {
  color: var(--ink);
}

.range-tab.is-active {
  background: var(--paper-light);
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(32, 43, 37, 0.08);
}

.traffic-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 13px;
}

.traffic-card {
  padding: 16px 18px;
  background: rgba(250, 247, 239, 0.86);
  border: 1px solid rgba(32, 43, 37, 0.11);
}

.traffic-card__label {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.traffic-card__value {
  margin-top: 9px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1;
}

.traffic-card__meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
}

.data-table-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid rgba(32, 43, 37, 0.1);
}

.admin-card,
.admin-panel,
.traffic-lower > *,
.admin-overview-grid > * {
  min-width: 0;
}

.data-table {
  width: 100%;
  min-width: 590px;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.6;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(32, 43, 37, 0.08);
  text-align: left;
  vertical-align: middle;
}

.data-table th {
  background: rgba(32, 43, 37, 0.035);
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.data-table td.num,
.data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: rgba(255, 250, 240, 0.55);
}

.table-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 150px;
}

.table-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.level-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 28px;
  height: 19px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.02em;
}

.level-tag--1 {
  color: var(--jade);
  border-color: rgba(82, 107, 90, 0.3);
}

.level-tag--2 {
  color: var(--accent);
  border-color: rgba(176, 82, 48, 0.3);
}

.data-table .muted-cell {
  color: var(--muted);
}

.traffic-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  gap: 13px;
  margin-top: 13px;
}

@media (max-width: 900px) {
  .traffic-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .traffic-lower {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .admin-page-head__actions {
    flex-wrap: wrap;
  }
  .admin-page-head__actions .range-tabs {
    flex: 1 0 100%;
    justify-content: space-between;
  }
  .range-tab {
    flex: 1;
    text-align: center;
    padding: 0 7px;
    white-space: nowrap;
  }
  .admin-page-head__actions .btn {
    flex: 1;
  }
  .admin-page-head__actions .icon-button {
    flex: none;
  }
}

/* --------------------------------------------------------------------------
   Admin — content tree + editor
   -------------------------------------------------------------------------- */

.content-layout {
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  gap: 15px;
  align-items: start;
}

.tree-panel {
  position: sticky;
  top: 113px;
  max-height: calc(100svh - 133px);
  display: flex;
  flex-direction: column;
  background: rgba(250, 247, 239, 0.84);
  border: 1px solid rgba(32, 43, 37, 0.11);
}

.tree-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.tree-panel__head strong {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.tree-panel__head span {
  font-size: 9px;
  color: var(--muted);
}

.tree-scroll {
  overflow-y: auto;
  padding: 7px;
  overscroll-behavior: contain;
}

.tree-create {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
  margin-bottom: 7px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.tree-create:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tree-group {
  margin-bottom: 2px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 2px;
}

.tree-row:hover {
  background: rgba(32, 43, 37, 0.04);
}

.tree-row.is-active {
  background: var(--ink);
  color: var(--cream);
}

.tree-select {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  min-height: 39px;
  padding: 6px 8px 6px calc(8px + var(--depth, 0) * 13px);
  text-align: left;
  font-size: 11px;
}

.tree-select__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.tree-select__meta {
  flex: none;
  color: var(--muted);
  font-size: 8px;
}

.tree-row.is-active .tree-select__meta {
  color: rgba(255, 250, 240, 0.5);
}

.tree-type {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: var(--line-strong);
}

.tree-type--1 {
  background: var(--jade);
}

.tree-type--2 {
  background: var(--accent);
}

.tree-add {
  flex: none;
  width: 27px;
  height: 27px;
  margin-right: 4px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border-radius: 50%;
}

.tree-add:hover {
  background: rgba(32, 43, 37, 0.08);
  color: var(--accent);
}

.tree-row.is-active .tree-add {
  color: rgba(255, 250, 240, 0.55);
}

.tree-row.is-active .tree-add:hover {
  background: rgba(255, 250, 240, 0.1);
  color: var(--cream);
}

.tree-root {
  margin-bottom: 5px;
}

.tree-children {
  position: relative;
  margin-left: 12px;
  padding-left: 4px;
}

.tree-children::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 4px;
  bottom: 6px;
  width: 1px;
  background: rgba(32, 43, 37, 0.09);
}

.editor-panel {
  min-width: 0;
  background: rgba(250, 247, 239, 0.9);
  border: 1px solid rgba(32, 43, 37, 0.11);
}

.editor-empty {
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.editor-empty .seal {
  width: 50px;
  height: 50px;
  font-size: 24px;
  opacity: 0.8;
  margin-bottom: 16px;
}

.editor-empty h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  color: var(--ink);
}

.editor-empty p {
  max-width: 26em;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.9;
}

.editor-empty__shortcuts {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.editor-head {
  padding: 17px 19px 15px;
  border-bottom: 1px solid var(--line);
}

.editor-head__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.editor-head__title {
  min-width: 0;
}

.editor-head__badge {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.editor-head h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: clamp(19px, 2.3vw, 25px);
  font-weight: 500;
  line-height: 1.4;
}

.editor-head__path {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.editor-head__actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  background: transparent;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: rgba(32, 43, 37, 0.04);
}

.icon-button--danger:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(158, 63, 45, 0.05);
}

.editor-tabs {
  display: flex;
  gap: 5px;
  padding: 9px 19px 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.editor-tabs::-webkit-scrollbar {
  display: none;
}

.editor-tab {
  flex: none;
  padding: 9px 10px 10px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.editor-tab:hover {
  color: var(--ink);
}

.editor-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.editor-tab__count {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 999px;
  background: rgba(32, 43, 37, 0.07);
  color: var(--muted);
  font-size: 8px;
}

.editor-form {
  padding: 20px 19px 0;
}

.editor-pane {
  animation: pane-in 0.25s ease both;
}

@keyframes pane-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.form-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.form-section-title h3 {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.form-section-title small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

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

.field {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.field--full {
  grid-column: 1 / -1;
}

.field > span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.field > span em {
  color: var(--accent);
  font-style: normal;
  font-size: 9px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid rgba(32, 43, 37, 0.2);
  border-radius: 0;
  background: rgba(255, 252, 246, 0.75);
  outline: 0;
  font-size: 13px;
  line-height: 1.75;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input {
  height: 39px;
  padding: 0 11px;
}

.field textarea {
  min-height: 82px;
  padding: 9px 11px;
  resize: vertical;
}

.field textarea.field-body {
  min-height: 270px;
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.95;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(32, 43, 37, 0.055);
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(32, 43, 37, 0.32);
}

.field small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.7;
}

.form-divider {
  margin: 22px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 15px;
}

.image-field {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.35);
}

.image-field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 10px;
}

.image-field__head small {
  color: var(--muted);
  font-size: 8px;
}

.image-preview {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(45deg, rgba(32, 43, 37, 0.035) 25%, transparent 25%, transparent 75%, rgba(32, 43, 37, 0.035) 75%),
    linear-gradient(45deg, rgba(32, 43, 37, 0.035) 25%, transparent 25%, transparent 75%, rgba(32, 43, 37, 0.035) 75%),
    #e8e1d3;
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-field__actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
}

.tiny-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.02em;
  background: rgba(255, 252, 246, 0.55);
}

.tiny-button:hover {
  border-color: var(--ink);
  background: var(--paper-light);
}

.tiny-button--danger {
  color: var(--danger);
  border-color: rgba(158, 63, 45, 0.18);
}

.tiny-button--danger:hover {
  border-color: var(--danger);
  background: rgba(158, 63, 45, 0.04);
}

.contact-image-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.contact-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--paper-deep);
}

.contact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.contact-image__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(22, 33, 27, 0.72);
  color: var(--cream);
}

.contact-image__remove:hover {
  background: var(--danger);
}

.contact-image-empty {
  grid-column: 1 / -1;
  padding: 15px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 9px;
  text-align: center;
}

.contact-image-add {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  aspect-ratio: 1;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 8px;
}

.contact-image-add:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.editor-savebar {
  position: sticky;
  z-index: 20;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px -19px 0;
  padding: 12px 19px calc(12px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(250, 247, 239, 0.93);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.editor-savebar__status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 9px;
}

.editor-savebar__status .dot {
  background: var(--jade);
}

.editor-savebar__status.is-dirty .dot {
  background: var(--accent);
}

.editor-savebar .btn {
  min-height: 39px;
  padding: 0 18px;
  font-size: 11px;
}

/* documents editor */
.documents-editor {
  display: grid;
  gap: 16px;
}

.attachment-list {
  display: grid;
  gap: 7px;
}

.attachment-row {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 246, 0.45);
}

.attachment-type {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 35px;
  height: 44px;
  border: 1px solid rgba(176, 82, 48, 0.25);
  color: var(--accent);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.attachment-type .icon {
  width: 14px;
  height: 14px;
}

.attachment-copy {
  min-width: 0;
}

.attachment-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.attachment-copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.attachment-actions {
  display: flex;
  gap: 2px;
}

.attachment-empty {
  padding: 22px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  text-align: center;
}

.upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  background: rgba(255, 252, 246, 0.35);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: rgba(255, 252, 246, 0.7);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone__icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 42px;
  flex: none;
  border: 1px solid var(--line);
  color: var(--accent);
}

.upload-zone__copy {
  min-width: 0;
}

.upload-zone__copy strong {
  display: block;
  font-family: var(--serif);
  font-size: 12px;
  font-weight: 500;
}

.upload-zone__copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.upload-zone__file {
  margin-left: auto;
  flex: none;
  color: var(--muted);
  font-size: 8px;
  max-width: 32%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone.has-file {
  border-style: solid;
  border-color: rgba(82, 107, 90, 0.42);
}

.attachment-upload-form {
  display: grid;
  gap: 9px;
}

.attachment-upload-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.attachment-upload-actions small {
  margin-right: auto;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.6;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  gap: 13px;
  align-items: start;
}

.settings-section {
  padding: clamp(18px, 3vw, 26px);
}

.settings-section h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.settings-section > p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}

.settings-form {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.settings-form .btn {
  justify-self: start;
}

.settings-note {
  padding: 12px 14px;
  border-left: 2px solid var(--gold);
  background: rgba(233, 225, 209, 0.38);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.9;
}

.settings-account {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.settings-account .seal {
  width: 35px;
  height: 35px;
  font-size: 17px;
}

.settings-account strong {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 500;
}

.settings-account small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

.settings-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.settings-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.settings-list div:last-child {
  border-bottom: 0;
}

.settings-list strong {
  color: var(--ink-soft);
  font-weight: 500;
}

@media (max-width: 1000px) {
  .content-layout {
    grid-template-columns: 255px minmax(0, 1fr);
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .content-layout {
    grid-template-columns: 1fr;
  }
  .tree-panel {
    position: static;
    max-height: none;
  }
  .tree-scroll {
    max-height: 240px;
  }
  .editor-panel {
    min-height: 320px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .field--full {
    grid-column: auto;
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
  .contact-image-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 540px) {
  .editor-head {
    padding: 14px;
  }
  .editor-head__actions {
    gap: 3px;
  }
  .icon-button {
    width: 29px;
    height: 29px;
  }
  .editor-tabs {
    padding-inline: 14px;
  }
  .editor-form {
    padding: 16px 14px 0;
  }
  .editor-savebar {
    margin-inline: -14px;
    padding-inline: 14px;
  }
  .form-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
  .form-section-title small {
    font-size: 8px;
  }
  .image-field__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
  .admin-page-head__actions {
    flex-wrap: wrap;
  }
}

@media (min-width: 1100px) {
  .tree-panel {
    top: 120px;
  }
}

/* --------------------------------------------------------------------------
   Admin public mode bar
   -------------------------------------------------------------------------- */

.admin-publicbar {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 44px;
  padding: 0 14px;
  background: rgba(16, 25, 19, 0.97);
  border-bottom: 1px solid rgba(255, 250, 240, 0.12);
  color: var(--cream);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.admin-publicbar__status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: rgba(255, 250, 240, 0.68);
}

.admin-publicbar__status .dot {
  background: #8bbd91;
  box-shadow: 0 0 0 3px rgba(139, 189, 145, 0.12);
}

.admin-publicbar__page {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--serif);
  color: var(--cream);
}

.admin-publicbar__actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.admin-publicbar__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(255, 250, 240, 0.17);
  border-radius: 2px;
  color: rgba(255, 250, 240, 0.75);
  font-size: 9px;
  letter-spacing: 0.03em;
}

.admin-publicbar__link:hover {
  border-color: rgba(255, 250, 240, 0.5);
  color: var(--cream);
}

.admin-publicbar__link--accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--cream);
}

.admin-publicbar__link--accent:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}

@media (max-width: 560px) {
  .admin-publicbar__status > span:last-child {
    display: none;
  }
  .admin-publicbar {
    justify-content: space-between;
  }
  .admin-publicbar__actions .label {
    display: none;
  }
  .admin-publicbar__link {
    width: 28px;
    padding: 0;
    justify-content: center;
  }
  .admin-publicbar__link--accent {
    width: auto;
    padding: 0 9px;
  }
  .admin-publicbar__link--accent .label {
    display: inline;
  }
}

/* --------------------------------------------------------------------------
   Dialogs & busy state
   -------------------------------------------------------------------------- */

.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 20, 15, 0.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.dialog-overlay.is-visible {
  opacity: 1;
}

.dialog {
  width: min(100%, 430px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 24px;
  background: var(--paper-light);
  border: 1px solid rgba(32, 43, 37, 0.12);
  box-shadow: var(--shadow-deep);
  transform: translateY(10px);
  transition: transform 0.25s var(--ease);
}

.dialog-overlay.is-visible .dialog {
  transform: translateY(0);
}

.dialog h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 500;
  line-height: 1.4;
}

.dialog p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.dialog__field {
  margin-top: 17px;
}

.dialog__field input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  background: #fffdf8;
  outline: 0;
  font-size: 13px;
}

.dialog__field input:focus {
  border-color: var(--ink);
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

.dialog__actions .btn {
  min-height: 38px;
  font-size: 11px;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: 24px;
  background: rgba(16, 25, 19, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--cream);
  text-align: center;
}

.busy-overlay .spinner {
  color: var(--gold);
}

.busy-overlay strong {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.busy-overlay p {
  max-width: 26em;
  color: rgba(255, 250, 240, 0.56);
  font-size: 10px;
  line-height: 1.8;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8, 14, 10, 0.92);
  cursor: zoom-out;
  animation: view-fade 0.2s ease both;
}

.image-viewer img {
  max-width: 100%;
  max-height: 90dvh;
  object-fit: contain;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   Error / 404
   -------------------------------------------------------------------------- */

.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 40px 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(176, 82, 48, 0.08), transparent 26%),
    var(--paper);
  text-align: center;
}

.error-page__seal {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 26px;
}

.error-page .kicker {
  margin-top: 24px;
}

.error-page h1 {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: clamp(29px, 5vw, 43px);
  font-weight: 500;
  line-height: 1.4;
}

.error-page p {
  max-width: 27em;
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
}

.error-page__actions {
  display: flex;
  gap: 8px;
  margin-top: 25px;
}

/* --------------------------------------------------------------------------
   Skeletons
   -------------------------------------------------------------------------- */

.skeleton-page {
  min-height: 100svh;
  background: var(--paper);
}

.skeleton-hero {
  position: relative;
  overflow: hidden;
  height: 72svh;
  min-height: 430px;
  background: #dcd6c8;
}

.skeleton-hero::after,
.skeleton-line::after,
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: translateX(-100%);
  animation: skeleton-shine 1.6s ease-in-out infinite;
}

@keyframes skeleton-shine {
  to { transform: translateX(100%); }
}

.skeleton-copy {
  width: min(calc(100% - 40px), var(--content));
  margin: 38px auto 0;
}

.skeleton-line {
  position: relative;
  overflow: hidden;
  height: 14px;
  margin-bottom: 13px;
  background: #e3ddcf;
}

.skeleton-line--short {
  width: 36%;
}

.skeleton-line--title {
  width: 58%;
  height: 34px;
  margin-bottom: 22px;
}

.skeleton-line--wide {
  width: 82%;
}

.skeleton-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 40px;
}

.skeleton-card {
  position: relative;
  overflow: hidden;
  min-height: 270px;
  background: #e4ded0;
}

@media (max-width: 700px) {
  .skeleton-cards {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Responsive public refinements
   -------------------------------------------------------------------------- */

@media (max-width: 420px) {
  .hero-title {
    font-size: clamp(55px, 16vw, 80px);
  }
  .hero-intro {
    line-height: 1.9;
  }
  .site-edition {
    font-size: 9px;
  }
  .site-edition::after {
    width: 16px;
  }
  .site-head {
    padding-top: calc(17px + var(--safe-top));
  }
  .brand-lockup__text small {
    display: none;
  }
}

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

.admin-body .toast-root {
  bottom: calc(24px + var(--safe-bottom));
}

/* Older WeChat webviews do not know svh/dvh. */
@supports not (min-height: 100svh) {
  .boot-screen,
  .login-page,
  .error-page {
    min-height: 100vh;
  }
  .admin-app {
    min-height: 100vh;
  }
  .home-hero {
    min-height: 94vh;
  }
  .detail-hero {
    min-height: clamp(430px, 68vh, 760px);
  }
  .item-page .detail-hero {
    min-height: clamp(470px, 78vh, 850px);
  }
  .contact-sheet {
    max-height: 92vh;
  }
}

/* WeChat / iOS small-viewport quirks */
@supports (-webkit-touch-callout: none) {
  body {
    -webkit-text-size-adjust: none;
  }
}
