:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #6c6f76;
  --paper: #fff9f8;
  --line: #e5d2d4;
  --accent: #c94f72;
  --teal: #29686a;
  --gold: #d49335;
  --card: #ffffff;
  --site-bg-image: url("/static/images/aya-header.webp");
  --detail-default-image: url("/posters/24-2025-04-05.jpg");
  --page-bg-image: var(--site-bg-image);
  --head-bg-image: var(--site-bg-image);
  --head-bg-position: center 28%;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background-image:
    linear-gradient(180deg, rgba(255,249,248,.92), rgba(255,249,248,.98)),
    var(--page-bg-image),
    linear-gradient(90deg, rgba(201,79,114,.055) 1px, transparent 1px),
    linear-gradient(180deg, #fff4f6 0%, var(--paper) 45%, #f5fbf8 100%);
  background-position: center, center 18%, 0 0, center;
  background-size: auto, min(100vw, 1440px) auto, 42px 42px, auto;
  background-repeat: no-repeat, no-repeat, repeat, no-repeat;
  background-attachment: scroll, scroll, scroll, scroll;
  color: var(--ink);
}

a { color: inherit; }

.nav {
  position: absolute;
  top: 22px;
  right: max(22px, 8vw);
  display: flex;
  gap: 10px;
}

.nav a {
  color: #fff9fb;
  text-decoration: none;
  font-weight: 700;
  padding: 7px 10px;
  background: rgba(255,239,246,.1);
  border: 1px solid rgba(255,225,238,.34);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.topbar, .detail-head, .admin-head {
  position: relative;
  color: #fff9fb;
  background-color: #24171f;
  background-image:
    linear-gradient(105deg, rgba(30,19,27,.94) 0%, rgba(96,38,61,.74) 46%, rgba(223,101,146,.35) 100%),
    var(--head-bg-image);
  background-position: center, var(--head-bg-position);
  background-size: cover, cover;
  background-repeat: no-repeat;
  background-blend-mode: multiply, normal;
  box-shadow: inset 0 -80px 120px rgba(46,19,27,.28);
}

.detail-page {
  --page-bg-image: var(--detail-default-image);
  --head-bg-image: var(--detail-default-image);
  --head-bg-position: center center;
}

.topbar {
  min-height: 240px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 58px max(28px, 8vw) 32px;
}

.detail-head, .admin-head {
  padding: 72px max(24px, 8vw) 34px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  color: #ffd0df;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.06;
}

.topbar h1,
.detail-head h1,
.admin-head h1 {
  text-shadow: 0 3px 20px rgba(36,14,22,.58);
}

h2 {
  margin: 28px 0 14px;
  font-size: 24px;
}

.stats {
  display: grid;
  gap: 10px;
  min-width: 170px;
}

.stats span {
  border-left: 3px solid #ffadc9;
  padding: 6px 0 6px 12px;
  font-size: 15px;
}

.stats strong {
  display: inline-block;
  min-width: 32px;
  font-size: 24px;
  color: #fff;
}

main {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.storyline {
  margin: 0 0 28px;
  padding: 18px 20px 22px;
  border: 1px solid #111;
  border-radius: 0;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 50px rgba(55, 42, 28, .1);
  overflow: visible;
}

.storyline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  color: var(--teal);
  margin-bottom: 18px;
}

.storyline-head span {
  font-weight: 900;
  font-size: 22px;
}

.storyline-head strong {
  color: var(--gold);
}

.text-preview {
  position: relative;
  min-height: 292px;
  overflow: visible;
  isolation: isolate;
}

.rail-year-stack {
  display: grid;
  gap: 28px;
  padding: 46px 40px 22px 78px;
}

.rail-year-row {
  position: relative;
  height: 122px;
  overflow: visible;
}

.rail-row-year {
  position: absolute;
  left: -74px;
  top: 76px;
  z-index: 5;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--teal);
  background: linear-gradient(180deg, #fff 0%, #edf6f2 100%);
  border: 2px solid rgba(35,100,106,.82);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  letter-spacing: .02em;
  transform: translateY(-50%);
  box-shadow: 0 9px 18px rgba(21,89,98,.16), inset 0 -2px 0 rgba(35,100,106,.08);
}

.rail-row-year::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 50%;
  width: 17px;
  height: 5px;
  background: #858585;
  transform: translateY(-50%);
}

.rail-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 72px;
  height: 9px;
  border-radius: 0;
  background: #d3312c;
  box-shadow: -20px 0 0 #858585, 0 10px 18px rgba(55,42,28,.12);
}

.rail-line::after {
  content: "";
  position: absolute;
  right: -17px;
  top: 0;
  width: 0;
  height: 0;
  border-top: 9px solid #d3312c;
  border-right: 17px solid transparent;
}

.rail-direction {
  position: absolute;
  top: 24px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: #111;
  font-size: 13px;
  font-weight: 800;
}

.rail-direction i {
  position: relative;
  display: block;
  width: 28px;
  height: 3px;
  background: #d3312c;
}

.rail-direction i::after {
  content: "";
  position: absolute;
  right: -1px;
  top: -5px;
  width: 11px;
  height: 11px;
  border-top: 3px solid #d3312c;
  border-right: 3px solid #d3312c;
  transform: rotate(45deg);
}

.rail-node {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: 76.5px;
  z-index: calc(4 + var(--i));
  width: 130px;
  height: 122px;
  color: inherit;
  text-decoration: none;
  outline: none;
  transform: translate(-104px, -88px);
  pointer-events: none;
}

.rail-dot {
  position: absolute;
  left: 104px;
  top: 88px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fffaf1;
  border: 4px solid #d3312c;
  box-shadow: 0 0 0 2px rgba(255,255,255,.9), 0 8px 18px rgba(55,42,28,.16);
  transform: translate(-50%, -50%);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  pointer-events: auto;
}

.rail-label {
  position: absolute;
  right: 26px;
  top: 71px;
  width: 88px;
  color: #111;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 1.1;
  text-align: left;
  padding: 0 0 3px;
  border-radius: 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #bebebe;
  box-shadow: none;
  transform: rotate(50deg);
  transform-origin: 100% 100%;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  cursor: pointer;
}

.rail-stem {
  display: none;
}

.rail-date {
  position: absolute;
  left: 104px;
  top: 104px;
  width: 44px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  transform: translateX(-50%);
}

.rail-card {
  position: absolute;
  left: 104px;
  top: 8px;
  width: min(280px, 32vw);
  padding: 14px;
  border-radius: 8px;
  background: rgba(255,255,255,.98);
  border: 1px solid rgba(183,64,52,.28);
  box-shadow: 0 24px 70px rgba(55,42,28,.22);
  transform: translate(-50%, 12px) scale(.96);
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  transition: transform .18s ease, opacity .18s ease;
}

.rail-card strong,
.rail-card em,
.rail-card small {
  display: block;
}

.rail-card strong {
  color: var(--ink);
  line-height: 1.35;
  font-size: 16px;
}

.rail-card em {
  margin-top: 7px;
  color: var(--teal);
  font-style: normal;
  font-weight: 800;
}

.rail-card small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.rail-node:hover,
.rail-node:focus-visible,
.rail-node.is-hovered {
  z-index: 100;
}

.rail-node:hover .rail-dot,
.rail-node:focus-visible .rail-dot,
.rail-node.is-hovered .rail-dot,
.rail-label:hover ~ .rail-dot,
.rail-dot:hover {
  background: #fff;
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(193,138,45,.22), 0 12px 24px rgba(55,42,28,.24);
  transform: translate(-50%, -50%) scale(1.32);
}

.rail-node:hover .rail-label,
.rail-node:focus-visible .rail-label,
.rail-node.is-hovered .rail-label,
.rail-label:hover {
  color: var(--accent);
  border-bottom-color: rgba(183,64,52,.72);
}

.rail-node:hover .rail-stem,
.rail-node:focus-visible .rail-stem,
.rail-node.is-hovered .rail-stem {
  background: rgba(183,64,52,.72);
}

.rail-node:hover .rail-card,
.rail-node:focus-visible .rail-card,
.rail-node.is-hovered .rail-card,
.rail-label:hover ~ .rail-card,
.rail-dot:hover ~ .rail-card {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.rail-node.is-first .rail-card {
  transform: translate(-22%, 12px) scale(.96);
}

.rail-node.is-first:hover .rail-card,
.rail-node.is-first:focus-visible .rail-card,
.rail-node.is-first.is-hovered .rail-card {
  transform: translate(-22%, 0) scale(1);
}

.rail-node.is-last .rail-card {
  transform: translate(-78%, 12px) scale(.96);
}

.rail-node.is-last:hover .rail-card,
.rail-node.is-last:focus-visible .rail-card,
.rail-node.is-last.is-hovered .rail-card {
  transform: translate(-78%, 0) scale(1);
}

.controls, .actions, .asset-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.controls {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

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

input, select, textarea {
  width: 100%;
  border: 1px solid #cfc6ba;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

select { min-width: 190px; }
textarea { resize: vertical; }

.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(55,42,28,.12);
}

.primary { background: var(--teal); color: #fff; }
.danger { background: #8d332c; color: #fff; }
.soft {
  background: #e7f0ed;
  color: var(--teal);
  border: 1px solid rgba(35,100,106,.2);
  font-weight: 800;
}

.timeline {
  position: relative;
  display: grid;
  gap: 22px;
  padding-left: 34px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(var(--teal), var(--accent), var(--gold));
  border-radius: 999px;
}

.year {
  margin: 8px 0 -4px;
  color: var(--teal);
  font-size: 24px;
  font-weight: 800;
}

.event {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) minmax(280px, 34%);
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(94, 76, 59, .18);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(55, 42, 28, .08);
}

.event::before {
  content: "";
  position: absolute;
  left: -29px;
  top: 24px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px rgba(183,64,52,.25);
}

.date {
  display: grid;
  align-content: start;
  gap: 8px;
  color: var(--teal);
  font-weight: 800;
}

.date .day { font-size: 28px; line-height: 1; }
.date .month { color: var(--muted); font-size: 14px; }

.content h2 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.content h2 a { text-decoration: none; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.pill {
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--teal);
  font-size: 13px;
}

.place, .summary {
  margin: 0;
  color: #374348;
  line-height: 1.65;
}

.summary {
  margin-top: 8px;
  color: var(--muted);
}

.poster, .asset {
  margin: 0;
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(238,228,216,.9));
  overflow: hidden;
}

.poster {
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 9;
  align-self: center;
}

.poster img, .asset img, .asset-tile img {
  width: 100%;
  object-fit: contain;
  display: block;
}

.poster img {
  height: 100%;
}

.asset img, .asset-tile img {
  height: auto;
}

.poster.empty {
  display: grid;
  place-items: center;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: start;
}

.detail-series {
  margin: 12px 0 0;
  color: #f4d08a;
}

.facts {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
}

.facts div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-size: 13px;
}

.facts dd {
  margin: 5px 0 0;
}

.description, .notes {
  line-height: 1.8;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(94, 76, 59, .16);
  border-radius: 8px;
  padding: 18px;
}

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

.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  margin: 20px 0 10px;
  color: var(--teal);
  line-height: 1.35;
}

.markdown-body h1 { font-size: 24px; }
.markdown-body h2 { font-size: 21px; }
.markdown-body h3 { font-size: 18px; }

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 14px;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4em;
}

.markdown-body li + li {
  margin-top: 4px;
}

.markdown-body a {
  color: var(--accent);
  font-weight: 800;
  text-underline-offset: 3px;
}

.markdown-body blockquote {
  padding: 10px 14px;
  border-left: 4px solid rgba(201,79,114,.42);
  background: rgba(255,244,246,.72);
  color: #4f3d45;
}

.markdown-body code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(35,100,106,.1);
  color: var(--teal);
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: .92em;
}

.markdown-body pre {
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #172126;
  color: #f8f3ec;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

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

.asset {
  margin: 0;
}

.asset img {
  aspect-ratio: 16 / 9;
}

.asset figcaption {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(193,138,45,.32);
  box-shadow: 0 28px 80px rgba(55,42,28,.18);
}

.auth-card h1 {
  color: var(--ink);
  font-size: clamp(30px, 8vw, 46px);
}

.auth-form {
  display: grid;
  gap: 14px;
  margin: 24px 0 12px;
}

.auth-message {
  min-height: 24px;
  margin: 0 0 12px;
  color: #8d332c;
  font-weight: 800;
}

.auth-message[data-kind="ok"] {
  color: var(--teal);
}

.auth-link {
  display: block;
  margin-top: 8px;
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.event-list {
  position: sticky;
  top: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
  max-height: calc(100vh - 32px);
}

#eventList {
  display: grid;
  gap: 8px;
  max-height: 72vh;
  overflow: auto;
}

#eventList button {
  display: grid;
  gap: 4px;
  text-align: left;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(94, 76, 59, .16);
  padding: 12px;
}

#eventList button.selected {
  outline: 2px solid var(--teal);
  background: #f0f7f4;
}

#eventList span {
  color: var(--muted);
  font-size: 13px;
}

#eventList em {
  color: #8a7770;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor {
  display: grid;
  gap: 24px;
}

.current-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(94, 76, 59, .16);
  border-radius: 8px;
}

.current-bar span {
  color: var(--muted);
}

.current-bar strong {
  color: var(--teal);
}

.user-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(94, 76, 59, .14);
  border-radius: 8px;
}

.user-tools strong {
  color: var(--teal);
}

.user-tools button {
  background: #efe4dc;
  color: #793a2d;
}

.status {
  min-height: 22px;
  margin-left: auto;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.status[data-kind="error"] {
  color: #8d332c;
}

#eventForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(94, 76, 59, .16);
  border-radius: 8px;
}

#eventForm label.wide,
#eventForm .school-picker,
#eventForm .actions {
  grid-column: 1 / -1;
}

.school-picker {
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(35,100,106,.18);
  border-radius: 8px;
  background: rgba(255,255,255,.66);
}

.school-picker legend {
  padding: 0 6px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.school-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}

.school-choice-grid label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(94,76,59,.14);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.school-choice-grid input {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
}

.school-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  min-height: 28px;
  color: var(--muted);
  font-size: 13px;
}

.selected-tags button {
  width: auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--teal);
}

.asset-panel {
  padding: 18px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(94, 76, 59, .16);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(55,42,28,.06);
}

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

.panel-title h2 {
  margin: 0;
}

.panel-title p {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.panel-title p strong {
  color: var(--teal);
}

.asset-sections {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.asset-sections h3 {
  margin: 0;
  color: var(--teal);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title .soft {
  flex: 0 0 auto;
  padding: 8px 11px;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.asset-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.asset-tile {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.asset-tile img {
  aspect-ratio: 16 / 9;
  background: #f4eee6;
}

.asset-tile figcaption {
  display: grid;
  gap: 4px;
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.asset-tile figcaption strong {
  color: var(--ink);
}

.asset-tile figcaption small {
  color: var(--teal);
}

.asset-tile button {
  width: calc(100% - 16px);
  margin: 0 8px 8px;
  background: #efe4dc;
  color: #793a2d;
}

.asset-tile button:disabled {
  cursor: default;
  opacity: .72;
}

.picker-tile {
  cursor: pointer;
}

.picker-tile:hover,
.picker-tile:focus-visible,
.picker-tile.selected {
  border-color: rgba(35,100,106,.62);
  box-shadow: 0 16px 42px rgba(55,42,28,.16);
  transform: translateY(-2px);
  outline: none;
}

.tile-actions {
  display: grid;
  gap: 6px;
  padding-bottom: 8px;
}

.tile-actions button:first-child {
  background: #e7f0ed;
  color: var(--teal);
}

.tile-actions button.is-active {
  background: var(--teal);
  color: #fff;
}

.tile-actions button.is-working {
  background: #f4d08a;
  color: #5f3c10;
}

.media-tools {
  margin: 14px 0 0;
}

.media-grid {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.media-tile figcaption strong {
  word-break: break-all;
}

.invite-code {
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #f0f7f4;
  border: 1px solid rgba(35,100,106,.22);
  color: var(--teal);
  font-weight: 900;
  word-break: break-all;
}

.invite-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.invite-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.invite-row strong {
  display: block;
  color: var(--ink);
}

.invite-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.invite-row button {
  background: #efe4dc;
  color: #793a2d;
}

.empty-line {
  padding: 16px;
  color: var(--muted);
  background: #f6f0e8;
  border-radius: 6px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23,33,38,.52);
  backdrop-filter: blur(8px);
}

.modal.hidden {
  display: none;
}

.modal-panel {
  width: min(1080px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(250,246,238,.96));
  border: 1px solid rgba(193,138,45,.34);
  box-shadow: 0 28px 90px rgba(0,0,0,.25);
}

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

.modal-head h2 {
  margin: 0;
  color: var(--teal);
}

.modal-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.modal-head button {
  background: #efe4dc;
  color: #793a2d;
}

.upload-progress {
  width: 100%;
  height: 8px;
  border: none;
  border-radius: 4px;
  margin-top: 8px;
  appearance: none;
  background: rgba(94, 76, 59, .12);
}

.upload-progress::-webkit-progress-bar {
  background: rgba(94, 76, 59, .12);
  border-radius: 4px;
}

.upload-progress::-webkit-progress-value {
  background: var(--teal);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.upload-progress::-moz-progress-bar {
  background: var(--teal);
  border-radius: 4px;
}

.upload-progress.hidden {
  display: none;
}

@media (max-width: 860px) {
  .topbar { display: grid; min-height: 320px; padding: 70px 22px 28px; }
  .event, .detail-grid, .admin-shell, #eventForm { grid-template-columns: 1fr; }
  .event-list { position: static; max-height: none; }
  .poster { min-height: 0; }
  .date { display: flex; align-items: baseline; gap: 10px; }
  .nav { left: 22px; right: auto; }
  .text-preview {
    min-height: 300px;
  }
  .rail-year-stack {
    gap: 24px;
    padding: 44px 20px 18px 56px;
  }
  .rail-row-year {
    left: -56px;
    min-width: 42px;
    padding: 5px 7px;
    font-size: 10px;
  }
  .rail-label {
    width: 68px;
    font-size: 9px;
  }
  .rail-card {
    width: min(240px, 72vw);
  }
  .section-title {
    align-items: stretch;
    flex-direction: column;
  }
}
