:root {
  --brown: #8a5a00;
  --brown-deep: #6f4a00;
  --gold: #eecf59;
  --gold-soft: #f0d566;
  --grey: #e7e7e7;
  --grey-panel: #f5f5f5;
  --text: #101010;
  --orange: #ef6c14;
  --line: #2a2a2a;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: #dcdcdc;
}
a { color: inherit; }
.shell { width: min(1280px, calc(100vw - 24px)); margin: 10px auto; }
.content { display: grid; gap: 12px; }
.content--legacy { min-height: 0; }
.flash { padding: 0.65rem 0.9rem; border: 2px solid var(--line); background: #fff7d7; font-weight: 700; }
.flash-success { background: #f6f3a1; }
.flash-error { background: #ffd7d7; }

.utility-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 14px;
  border: 2px solid var(--line);
  background: #fff;
  font-size: 0.95rem;
}
.utility-bar__brand, .utility-bar__links { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.utility-bar__links a { text-decoration: none; font-weight: 700; }
.utility-bar__links a:hover { color: var(--orange); }

.legacy-stage {
  display: grid;
  grid-template-columns: 332px minmax(0, 1fr);
  border: 3px solid var(--line);
  min-height: 760px;
  background: var(--grey);
}
.legacy-rail {
  background: var(--brown);
  padding: 22px 12px 18px;
  display: grid;
  gap: 6px;
}
.legacy-rail__item {
  display: grid;
  grid-template-columns: 134px 1fr;
  gap: 14px;
  padding: 4px 8px 10px 8px;
  text-decoration: none;
  align-items: start;
}
.legacy-rail__item:hover .legacy-rail__label,
.legacy-rail__item.is-active .legacy-rail__label { color: var(--orange); }
.legacy-rail__thumb {
  display: block;
  width: 134px;
  height: 134px;
  overflow: hidden;
}
.legacy-rail__thumb img {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.legacy-rail__label {
  align-self: center;
  min-height: 134px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  background: #f2f2f2;
  color: #111;
  font-size: clamp(1.08rem, 1.65vw, 1.85rem);
  line-height: 1.06;
  font-weight: 700;
}
.legacy-main-wrap {
  background: var(--grey);
  min-width: 0;
}
.legacy-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 757px;
  background: var(--grey);
}
.legacy-panel__scroll {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #7f7f7f #efefef;
}
.legacy-content {
  min-height: 100%;
  padding: 24px 32px 20px;
}
.legacy-content--gold {
  background: var(--gold);
}
.legacy-content h2 {
  margin: 0 0 22px;
  text-align: center;
  font-size: clamp(2.2rem, 4vw, 4rem);
  line-height: 1;
}
.legacy-content h3 {
  margin: 24px 0 12px;
  font-size: clamp(1.4rem, 2vw, 2.1rem);
}
.legacy-content p,
.legacy-content li,
.legacy-content label,
.legacy-content td,
.legacy-content th,
.legacy-panel__footer,
.legacy-list li {
  font-size: clamp(1rem, 1.4vw, 1.45rem);
  line-height: 1.28;
  font-weight: 700;
}
.legacy-content p { margin: 0 0 1rem; }
.lede { font-size: clamp(1.15rem, 1.7vw, 1.8rem); }
.legacy-content--table { padding-bottom: 10px; }
.legacy-panel__footer {
  background: var(--grey);
  border-top: 1px solid #d3d3d3;
  min-height: 142px;
  padding: 14px 18px;
}
.legacy-panel__footer--centered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 90px;
}
.legacy-panel__footer--legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 26px;
}
.legacy-panel__footer--tiles,
.legacy-panel__footer--gallery-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}
.legacy-panel__footer--tiles img { height: 92px; width: auto; image-rendering: pixelated; }
.legacy-panel__footer--gallery-links img { height: 84px; width: auto; image-rendering: pixelated; }
.legacy-panel__footer--months {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 18px 28px;
  justify-items: center;
  align-items: center;
  padding-inline: 34px;
}
.legacy-panel__footer--note { display: block; }
.legacy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 216px;
  padding: 10px 24px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #efefef;
  text-decoration: none;
  font-size: clamp(1rem, 1.35vw, 1.4rem);
  line-height: 1;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #fff;
}
.legacy-button:hover { background: #fff9d2; }
.legacy-button--danger { background: #ffd7d7; }
.status-pill {
  display: inline-block;
  min-width: 56px;
  text-align: center;
  padding: 2px 8px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(0,0,0,0.35);
}
.legacy-table { width: 100%; border-collapse: collapse; }
.legacy-table th, .legacy-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.18);
  vertical-align: top;
  text-align: left;
}
.legacy-table thead th { position: sticky; top: 0; background: rgba(255,239,179,0.94); }
.legacy-list { margin: 0; padding-left: 1.25rem; }
.legacy-form { display: grid; gap: 14px; max-width: 820px; }
.legacy-form label { display: grid; gap: 6px; font-weight: 700; }
.legacy-form input[type="text"],
.legacy-form input[type="password"],
.legacy-form input[type="file"],
.legacy-form select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font: inherit;
}
.legacy-form--inline { grid-template-columns: 1fr auto; align-items: end; }
.radio-row { display: flex !important; align-items: center; gap: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(240px,1fr)); gap: 30px; }
.external-links__button-wrap { text-align: center; margin: 28px 0 32px; }

.splash-stage {
  min-height: calc(100vh - 40px);
  display: grid;
  place-items: center;
  padding: 30px;
  background: linear-gradient(180deg, #d9d9d9 0%, #bfbfbf 100%);
}
.splash-stage__art {
  position: fixed;
  inset: 0;
  background: center/cover no-repeat url('/assets/img/legacy_ui/kids_transition_hd.png');
  opacity: 0.14;
  transform: scale(1.02);
  pointer-events: none;
}
.splash-stage__panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  padding: 28px 30px;
  border: 3px solid var(--line);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 18px 45px rgba(0,0,0,0.18);
}
.splash-stage__panel h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}
.splash-stage__panel p {
  margin: 0 0 1rem;
  font-size: clamp(1rem, 1.45vw, 1.35rem);
  line-height: 1.4;
  font-weight: 700;
}
.splash-stage__panel--login { max-width: 540px; }

.transition-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #dcdcdc;
  z-index: 9999;
}
.transition-overlay__image {
  position: absolute;
  inset: 0;
  background: center/cover no-repeat url('/assets/img/legacy_ui/kids_transition_hd.png');
  transform: scale(1.12);
  opacity: 0;
}
body.page-ready .transition-overlay {
  animation: overlayIntro 700ms ease-out forwards;
}
body.page-ready .transition-overlay__image {
  animation: overlayIntroImage 700ms ease-out forwards;
}
body.is-leaving .transition-overlay {
  opacity: 1;
  transition: opacity 220ms ease-in;
}
body.is-leaving .transition-overlay__image {
  opacity: 0.95;
  transform: scale(1.02);
  transition: transform 340ms ease-in, opacity 220ms ease-in;
}
.page-enter { animation: pageEnter 420ms ease-out both; }

@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes overlayIntro {
  0% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes overlayIntroImage {
  0% { opacity: 0.95; transform: scale(1.14); }
  100% { opacity: 0; transform: scale(0.78); }
}

@media (max-width: 1080px) {
  .shell { width: min(100vw - 12px, 1280px); }
  .legacy-stage { grid-template-columns: 250px minmax(0, 1fr); }
  .legacy-rail__item { grid-template-columns: 1fr; gap: 8px; }
  .legacy-rail__thumb { width: 100%; height: auto; aspect-ratio: 1/1; }
  .legacy-rail__label { min-height: auto; font-size: 1.15rem; }
}
@media (max-width: 860px) {
  .utility-bar { flex-direction: column; align-items: flex-start; }
  .legacy-stage { grid-template-columns: 1fr; }
  .legacy-rail { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .legacy-panel { min-height: auto; }
  .legacy-panel__footer--centered { gap: 18px; flex-wrap: wrap; }
  .legacy-panel__footer--months { grid-template-columns: repeat(2, minmax(120px,1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
  .legacy-form--inline { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shell { width: calc(100vw - 8px); margin: 4px auto; }
  .legacy-rail { grid-template-columns: 1fr; }
  .legacy-content { padding: 18px 16px 14px; }
  .legacy-panel__footer { min-height: 0; }
  .legacy-button { min-width: 0; width: 100%; }
}
