@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=Gowun+Dodum&display=swap');

:root {
  --ref-mint: #55cfc4;
  --ref-mint-strong: #25a99c;
  --ref-mint-2: #dcfbf5;
  --ref-violet: #e7e1ff;
  --ref-violet-2: #f3f0ff;
  --ref-bg: #f2fffb;
  --ref-card: rgba(255, 255, 255, .92);
  --ref-line: rgba(37, 151, 139, .18);
  --ref-ink: #102925;
  --ref-muted: #607a74;
  --ref-shadow: 0 20px 60px rgba(21, 83, 76, .12);
  --ref-hand: 'Gaegu', 'Gowun Dodum', system-ui, sans-serif;
  --ref-body: 'Gowun Dodum', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.ref-generate-page,
.ref-gallery,
body:has(.result-page) {
  color: var(--ref-ink);
  font-family: var(--ref-body);
  background:
    radial-gradient(circle at 10% 4%, rgba(220, 251, 245, .88), transparent 340px),
    radial-gradient(circle at 92% 7%, rgba(231, 225, 255, .68), transparent 360px),
    linear-gradient(180deg, #fbfffe 0%, #effdf9 100%) !important;
}

.ref-floating-sidebar {
  position: fixed;
  z-index: 80;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 86px;
  padding: 18px 10px;
  border: 1px solid var(--ref-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 18px 42px rgba(21, 83, 76, .1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.ref-floating-sidebar__brand {
  color: var(--ref-mint-strong);
  font-family: var(--ref-hand);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.ref-floating-sidebar__nav {
  width: 100%;
  display: grid;
  gap: 8px;
}

.ref-floating-sidebar__nav a {
  min-height: 48px;
  display: grid;
  place-items: center;
  gap: 2px;
  border-radius: 14px;
  color: var(--ref-muted);
  font-size: 10px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.ref-floating-sidebar__nav a[aria-current="page"],
.ref-floating-sidebar__nav a:hover {
  color: var(--ref-mint-strong);
  background: rgba(220, 251, 245, .82);
}

.ref-floating-sidebar__icon {
  font-size: 17px;
  line-height: 1;
}

@media (min-width: 1060px) {
  .ref-generate-page .topbar,
  .ref-generate-page .generate-shell,
  .ref-gallery .app-bar,
  .ref-gallery .main,
  body:has(.result-page) .app-bar,
  body:has(.result-page) .result-page,
  body:has(.ref-floating-sidebar) > .nav,
  body:has(.ref-floating-sidebar) > .char-content,
  body:has(.ref-floating-sidebar) > #char-hero-section {
    margin-left: 108px !important;
    width: calc(100% - 126px) !important;
  }
}

@media (max-width: 1059px) {
  .ref-floating-sidebar {
    display: none;
  }
}

.ref-generate-page .story-panel,
.ref-generate-page .form-panel,
.ref-gallery .ref-discover-hero,
.ref-gallery .ref-gallery-moments,
.ref-gallery .archive-hero,
.ref-gallery .world-coverage,
body:has(.result-page) .wait-panel,
body:has(.result-page) .char-hero,
body:has(.result-page) .section {
  border: 1px solid var(--ref-line) !important;
  background: rgba(255, 255, 255, .82) !important;
  box-shadow: 0 18px 54px rgba(21, 83, 76, .09) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ref-generate-page .hero-title,
.ref-gallery h1,
.ref-gallery h2,
body:has(.result-page) h1,
body:has(.result-page) .section-title {
  font-family: var(--ref-hand);
  letter-spacing: 0 !important;
}

.ref-generate-page .btn-primary,
.ref-generate-page .cta-generate,
.ref-gallery .archive-hero__cta,
.ref-gallery .fab,
body:has(.result-page) .result-cta__primary {
  background: linear-gradient(135deg, var(--ref-mint), var(--ref-mint-strong)) !important;
  box-shadow: 0 14px 30px rgba(37, 169, 156, .2) !important;
}

body.ref-screen {
  margin: 0;
  min-height: 100vh;
  color: var(--ref-ink);
  font-family: var(--ref-body);
  background:
    radial-gradient(circle at 12% 6%, rgba(217, 248, 241, .84), transparent 360px),
    radial-gradient(circle at 88% 8%, rgba(221, 217, 251, .58), transparent 340px),
    linear-gradient(180deg, #f8fffd 0%, #eefbf8 100%);
}

.ref-screen-shell {
  width: min(100% - 32px, 1240px);
  margin: 26px auto 40px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 760px;
  border: 1px solid var(--ref-line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--ref-shadow);
}

.ref-screen-main {
  min-width: 0;
  padding: 26px;
}

.ref-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.ref-page-head h1 {
  margin: 0;
  color: var(--ref-ink);
  font-size: 30px;
  line-height: 1.08;
}

.ref-page-head p {
  margin: 8px 0 0;
  color: var(--ref-muted);
  font-size: 14px;
}

.ref-pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ref-pill {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--ref-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: var(--ref-muted);
  font-size: 12px;
  font-weight: 900;
}

.ref-pill.is-active,
.ref-add-btn {
  color: #fff;
  background: var(--ref-mint);
  border-color: transparent;
}

.ref-add-btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.ref-mobile-head {
  display: none;
}

.ref-bottom-tabs {
  display: none;
}

.ref-gallery-masonry {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  grid-template-rows: 260px 170px;
  gap: 12px;
}

.ref-photo-tile {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ref-line);
  border-radius: 14px;
  background: #d8eee8;
}

.ref-photo-tile:first-child {
  grid-row: span 2;
}

.ref-photo-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ref-photo-tile span {
  position: absolute;
  left: 14px;
  bottom: 12px;
  z-index: 1;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .32);
}

.ref-memory-layout {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  margin-top: 16px;
}

.ref-year-rail {
  color: var(--ref-muted);
  font-size: 12px;
  font-weight: 900;
}

.ref-year-rail b {
  display: block;
  margin-bottom: 18px;
  color: var(--ref-ink);
}

.ref-memory-list {
  display: grid;
  gap: 10px;
}

.ref-memory-item {
  display: grid;
  grid-template-columns: 74px 58px minmax(0, 1fr) 88px 26px;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 10px 12px;
  border: 1px solid var(--ref-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .86);
}

.ref-memory-date {
  color: var(--ref-mint);
  font-size: 12px;
  font-weight: 900;
}

.ref-memory-thumb,
.ref-room-item,
.ref-timeline-avatar {
  overflow: hidden;
  border-radius: 10px;
  background: var(--ref-mint-2);
}

.ref-memory-thumb {
  width: 58px;
  height: 42px;
}

.ref-memory-thumb img,
.ref-room-item img,
.ref-timeline-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ref-memory-copy b {
  display: block;
  margin-bottom: 3px;
  color: var(--ref-ink);
  font-size: 13px;
}

.ref-memory-copy span,
.ref-room-meta,
.ref-timeline-meta {
  color: var(--ref-muted);
  font-size: 11px;
}

.ref-memory-tag {
  justify-self: end;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff1d9;
  color: #c2862f;
  font-size: 11px;
  font-weight: 900;
}

.ref-room-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, .8fr);
  gap: 18px;
}

.ref-room-hero {
  position: relative;
  min-height: 458px;
  overflow: hidden;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  background: var(--ref-mint-2);
}

.ref-room-hero img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  display: block;
  object-fit: cover;
}

.ref-room-scene {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(120, 98, 72, .20) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #f7ead4 0%, #f2dfc7 58%, #d3b996 58%, #caa982 100%);
  background-size: 42px 100%, 100% 100%;
}

.ref-room-scene::before {
  content: "";
  position: absolute;
  right: 34px;
  top: 42px;
  width: 220px;
  height: 210px;
  border-radius: 120px 120px 16px 16px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255,255,255,.75) 48% 52%, transparent 53%),
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(151, 214, 208, .40)),
    #b8dfdc;
  border: 10px solid rgba(255, 255, 255, .82);
  box-shadow: 0 24px 60px rgba(85, 117, 104, .20);
}

.ref-room-scene::after {
  content: "";
  position: absolute;
  left: 42px;
  bottom: 48px;
  width: 280px;
  height: 138px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 22% 38%, #fff 0 18px, transparent 19px),
    linear-gradient(180deg, #fffaf0 0 48%, #e8d4b8 49% 100%);
  box-shadow: 0 18px 40px rgba(81, 62, 42, .18);
}

.ref-room-shelf {
  position: absolute;
  left: 42px;
  top: 54px;
  width: 210px;
  height: 108px;
  border-radius: 14px;
  background:
    linear-gradient(90deg, #b88d62 0 12px, transparent 12px calc(100% - 12px), #b88d62 calc(100% - 12px)),
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(94, 62, 36, .35) 35px 38px),
    rgba(244, 232, 210, .62);
  border: 1px solid rgba(146, 102, 62, .18);
}

.ref-room-actions {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.ref-room-actions span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .88);
  color: var(--ref-mint);
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(21, 83, 76, .12);
}

.ref-info-card {
  padding: 20px;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .86);
}

.ref-info-card h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.ref-info-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(37, 151, 139, .10);
  color: var(--ref-muted);
  font-size: 12px;
}

.ref-room-items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}

.ref-room-item {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--ref-line);
}

.ref-timeline-track {
  position: relative;
  margin: 56px 28px 34px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.ref-timeline-track::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 34px;
  height: 2px;
  border-top: 2px dotted rgba(37, 151, 139, .28);
}

.ref-era {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--ref-muted);
  text-align: center;
  font-size: 12px;
}

.ref-era-icon {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ref-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .86);
  color: #9caeaa;
  font-size: 28px;
}

.ref-era.is-active .ref-era-icon {
  background: var(--ref-mint-2);
  color: var(--ref-mint);
  border-color: rgba(49, 183, 168, .52);
  box-shadow: 0 0 0 8px rgba(49, 183, 168, .08);
}

.ref-era b {
  display: block;
  color: var(--ref-ink);
}

.ref-timeline-people {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 34px;
}

.ref-timeline-person {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.ref-timeline-avatar {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 3px solid transparent;
}

.ref-timeline-person.is-active .ref-timeline-avatar {
  border-color: var(--ref-mint);
  box-shadow: 0 0 0 8px rgba(49, 183, 168, .08);
}

.ref-timeline-person b {
  color: var(--ref-ink);
  font-size: 13px;
}

@media (max-width: 760px) {
  body.ref-screen {
    background:
      radial-gradient(circle at 18% 8%, rgba(217, 248, 241, .88), transparent 240px),
      radial-gradient(circle at 92% 8%, rgba(221, 217, 251, .54), transparent 220px),
      linear-gradient(180deg, #fbfffd 0%, #effbf8 100%);
  }

  .ref-screen-shell {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    display: block;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .ref-screen-shell .ref-sidebar {
    display: none;
  }

  .ref-screen-main {
    padding: 18px 14px 84px;
  }

  .ref-mobile-head {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--ref-ink);
  }

  .ref-mobile-head b {
    font-size: 20px;
  }

  .ref-page-head {
    display: block;
    padding: 18px 16px 8px;
    border: 1px solid var(--ref-line);
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    background: rgba(255, 255, 255, .86);
    margin: 0;
  }

  .ref-page-head h1 {
    font-size: 24px;
  }

  .ref-pill-row {
    gap: 8px;
    margin-top: 14px;
    flex-wrap: nowrap;
    overflow: auto;
  }

  .ref-pill {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 12px;
    font-size: 11px;
  }

  .ref-gallery-masonry,
  .ref-room-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 16px 16px;
    border: 1px solid var(--ref-line);
    border-top: 0;
    border-radius: 0 0 20px 20px;
    background: rgba(255, 255, 255, .86);
  }

  .ref-gallery-masonry {
    grid-template-rows: 170px 108px 108px;
  }

  .ref-photo-tile:first-child {
    grid-column: span 2;
    grid-row: auto;
  }

  .ref-memory-layout {
    display: block;
    padding: 0 16px 16px;
    border: 1px solid var(--ref-line);
    border-top: 0;
    border-radius: 0 0 20px 20px;
    background: rgba(255, 255, 255, .86);
  }

  .ref-year-rail {
    margin-bottom: 12px;
  }

  .ref-memory-item {
    grid-template-columns: 48px minmax(0, 1fr) 22px;
    min-height: 64px;
  }

  .ref-memory-date,
  .ref-memory-tag {
    display: none;
  }

  .ref-memory-thumb {
    width: 48px;
    height: 40px;
  }

  .ref-room-grid {
    display: block;
  }

  .ref-room-hero {
    min-height: 330px;
  }

  .ref-info-card {
    margin-top: 12px;
  }

  .ref-timeline-track {
    grid-template-columns: repeat(5, minmax(82px, 1fr));
    overflow: auto;
    margin: 26px 0;
    padding: 22px 16px;
    border: 1px solid var(--ref-line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .86);
  }

  .ref-timeline-track::before {
    left: 48px;
    right: 48px;
    top: 56px;
  }

  .ref-era-icon {
    width: 54px;
    height: 54px;
    font-size: 22px;
  }

  .ref-timeline-people {
    grid-template-columns: repeat(5, minmax(78px, 1fr));
    overflow: auto;
    gap: 14px;
  }

  .ref-timeline-avatar {
    width: 66px;
    height: 66px;
  }

  .ref-bottom-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    height: 58px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: 1px solid var(--ref-line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(16px);
  }

  .ref-bottom-tabs a {
    display: grid;
    place-items: center;
    color: #8aa29c;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
  }

  .ref-bottom-tabs a.is-active {
    color: var(--ref-mint);
  }
}

body.ref-home {
  margin: 0;
  min-height: 100vh;
  color: var(--ref-ink);
  font-family: var(--ref-body);
  background:
    radial-gradient(circle at 12% 6%, rgba(217, 248, 241, .9), transparent 360px),
    radial-gradient(circle at 84% 8%, rgba(221, 217, 251, .66), transparent 340px),
    linear-gradient(180deg, #f8fffd 0%, #eefbf8 100%);
}

body.ref-home > .shell,
body.ref-home > footer,
body.ref-home > .haru-bottom-nav {
  display: none !important;
}

.ref-app {
  width: min(100% - 32px, 1240px);
  margin: 26px auto 40px;
}

.ref-desktop {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  min-height: 760px;
  border: 1px solid var(--ref-line);
  border-radius: 20px;
  overflow: hidden;
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--ref-shadow);
}

.ref-sidebar {
  padding: 22px 14px;
  background: rgba(255, 255, 255, .82);
  border-right: 1px solid var(--ref-line);
}

.ref-logo {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-bottom: 28px;
  color: var(--ref-mint);
  text-decoration: none;
  font-size: 18px;
  font-weight: 800;
}

.ref-logo__mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 30%, #fff 0 16%, transparent 17%),
    radial-gradient(circle at 70% 74%, var(--ref-violet), transparent 34%),
    var(--ref-mint-2);
  border: 1px solid var(--ref-line);
}

.ref-side-nav {
  display: grid;
  gap: 6px;
}

.ref-side-nav a {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 10px;
  color: var(--ref-muted);
  font-size: 11px;
  text-decoration: none;
}

.ref-side-nav a.is-active {
  color: var(--ref-mint);
  background: var(--ref-mint-2);
  font-weight: 800;
}

.ref-credit {
  margin-top: 34px;
  padding: 12px 8px;
  border: 1px solid var(--ref-line);
  border-radius: 12px;
  color: var(--ref-muted);
  background: rgba(255, 255, 255, .78);
  font-size: 10px;
}

.ref-credit b {
  display: block;
  margin: 4px 0;
  color: var(--ref-ink);
  font-size: 16px;
}

.ref-main {
  min-width: 0;
  padding: 22px;
}

.ref-topnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 34px;
  height: 38px;
  margin-bottom: 18px;
  font-size: 12px;
}

.ref-topnav a {
  color: var(--ref-ink);
  text-decoration: none;
  font-weight: 800;
}

.ref-topnav a.is-active {
  color: var(--ref-mint);
  border-bottom: 2px solid var(--ref-mint);
}

.ref-hero {
  position: relative;
  min-height: 312px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .20)),
    radial-gradient(circle at 86% 20%, var(--ref-violet), transparent 180px),
    radial-gradient(circle at 78% 34%, var(--ref-mint-2), transparent 230px),
    #b9cbc4;
}

.ref-hero__copy {
  position: relative;
  z-index: 2;
  max-width: 430px;
  padding: 54px 42px;
}

.ref-kicker {
  color: var(--ref-mint);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
}

.ref-hero h1 {
  margin: 10px 0 8px;
  font-family: var(--ref-hand);
  font-size: 72px;
  line-height: .9;
  letter-spacing: 0;
}

.ref-hero p {
  margin: 0;
  color: var(--ref-ink);
  font-size: 15px;
  line-height: 1.62;
}

.ref-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 24px;
  padding: 0 28px;
  border-radius: 16px;
  color: #fff;
  background: var(--ref-mint);
  box-shadow: 0 14px 36px rgba(49, 183, 168, .24);
  text-decoration: none;
  font-weight: 900;
}

.ref-portrait {
  position: absolute;
  right: 118px;
  bottom: 0;
  width: 250px;
  height: 286px;
  border-radius: 120px 120px 0 0;
  background:
    radial-gradient(circle at 68% 18%, var(--ref-violet), transparent 76px),
    var(--ref-mint-2);
}

.ref-portrait img,
.ref-mobile__portrait img,
.ref-mini-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 45%;
}

.ref-portrait.has-image::before,
.ref-portrait.has-image::after,
.ref-mobile__portrait.has-image::before,
.ref-mobile__portrait.has-image::after {
  display: none;
}

.ref-portrait::before {
  content: "";
  position: absolute;
  left: 58px;
  top: 52px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: #dcb79f;
  box-shadow: -22px 38px 0 -18px #dcb79f, 22px 38px 0 -18px #dcb79f;
}

.ref-portrait::after {
  content: "";
  position: absolute;
  left: 42px;
  top: 44px;
  width: 164px;
  height: 52px;
  border-radius: 28px;
  background: #1d1b19;
}

.ref-time-card {
  position: absolute;
  right: 36px;
  bottom: 56px;
  width: 158px;
  padding: 16px;
  border: 1px solid var(--ref-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(14px);
}

.ref-time-card small {
  color: var(--ref-muted);
}

.ref-time-card b {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.ref-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr .8fr;
  gap: 18px;
  margin-top: 18px;
}

.ref-admin-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 18px;
  border: 1px solid rgba(49, 183, 168, .22);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, .92), rgba(239, 250, 247, .88));
}

.ref-admin-card b {
  display: block;
  margin-bottom: 5px;
  color: var(--ref-ink);
  font-size: 16px;
}

.ref-admin-card span {
  color: var(--ref-muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.ref-admin-actions a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--ref-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  color: var(--ref-ink);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.ref-admin-actions a:first-child {
  border-color: transparent;
  background: var(--ref-mint);
  color: #fff;
}

.ref-panel {
  min-height: 184px;
  padding: 18px;
  border: 1px solid var(--ref-line);
  border-radius: 18px;
  background: var(--ref-card);
  box-shadow: 0 12px 34px rgba(21, 83, 76, .08);
}

.ref-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.ref-day-card {
  display: grid;
  grid-template-columns: 1fr 108px;
  gap: 14px;
}

.ref-mini-img,
.ref-map,
.ref-circle {
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 80% 20%, var(--ref-violet), transparent 64px),
    radial-gradient(circle at 65% 45%, var(--ref-mint-2), transparent 74px),
    #b9cbc4;
}

.ref-mini-img {
  min-height: 132px;
}

.ref-map {
  min-height: 116px;
}

.ref-circle {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  margin: 18px auto 0;
  border-radius: 50%;
  color: var(--ref-mint);
  font-size: 22px;
  font-weight: 900;
}

.ref-mobile {
  display: none;
}

.ref-bottom-nav {
  display: none;
}

body.ref-gallery {
  font-family: var(--ref-body);
  background:
    radial-gradient(circle at 12% 6%, rgba(217, 248, 241, .82), transparent 360px),
    radial-gradient(circle at 88% 8%, rgba(221, 217, 251, .58), transparent 340px),
    linear-gradient(180deg, #f8fffd 0%, #eefbf8 100%) !important;
}

.ref-gallery .app-bar {
  background: rgba(255, 255, 255, .86) !important;
  border-bottom: 1px solid var(--ref-line) !important;
  backdrop-filter: blur(18px);
}

.ref-gallery .archive-hero,
.ref-gallery .world-coverage {
  display: none !important;
}

.ref-discover-hero {
  margin: 22px auto 16px;
  padding: 22px;
  border: 1px solid var(--ref-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--ref-shadow);
}

.ref-discover-hero__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ref-discover-hero h2 {
  margin: 0;
  color: var(--ref-ink);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.05;
}

.ref-discover-hero p {
  margin: 8px 0 0;
  color: var(--ref-muted);
  line-height: 1.5;
}

.ref-discover-hero__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 14px;
  color: #fff;
  background: var(--ref-mint);
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
}

.ref-discover-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.ref-discover-filters span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid var(--ref-line);
  border-radius: 999px;
  color: var(--ref-mint);
  background: rgba(255, 255, 255, .78);
  font-size: 13px;
  font-weight: 900;
}

.ref-discover-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.ref-discover-strip article {
  position: relative;
  min-height: 194px;
  overflow: hidden;
  border-radius: 16px;
  background: #b9cbc4;
  box-shadow: 0 14px 34px rgba(21, 83, 76, .10);
}

.ref-discover-img {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #b9cbc4;
}

.ref-discover-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 46%;
  filter: saturate(.98) contrast(.98);
}

.ref-discover-strip article b,
.ref-discover-strip article span {
  position: relative;
  z-index: 1;
  display: block;
  margin-left: 14px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .28);
  max-width: calc(100% - 28px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-discover-strip article b {
  margin-top: 126px;
  font-size: 18px;
}

.ref-discover-strip article span {
  margin-top: 4px;
  font-size: 11px;
}

.ref-gallery .filter-bar {
  border: 1px solid var(--ref-line) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, .86) !important;
  box-shadow: 0 12px 34px rgba(21, 83, 76, .08) !important;
}

.ref-gallery .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important;
}

.ref-gallery .char-card {
  border-radius: 18px !important;
  border: 1px solid var(--ref-line) !important;
  box-shadow: 0 14px 34px rgba(21, 83, 76, .10) !important;
  background: rgba(255, 255, 255, .94) !important;
}

.ref-gallery .char-card__thumb {
  background:
    radial-gradient(circle at 84% 16%, var(--ref-violet), transparent 74px),
    radial-gradient(circle at 72% 34%, var(--ref-mint-2), transparent 100px),
    #b9cbc4 !important;
}

.ref-gallery-moments {
  margin: 18px auto 16px;
  padding: 22px;
  border: 1px solid var(--ref-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--ref-shadow);
}

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

.ref-gallery-moments h2 {
  margin: 0;
  color: var(--ref-ink);
  font-size: 30px;
}

.ref-gallery-moments p {
  margin: 6px 0 0;
  color: var(--ref-muted);
  font-size: 13px;
}

.ref-gallery-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ref-gallery-tabs span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--ref-muted);
  background: #eef4f2;
  font-size: 12px;
  font-weight: 900;
}

.ref-gallery-tabs span.is-active {
  color: var(--ref-mint);
  background: var(--ref-mint-2);
}

.ref-gallery-board {
  display: grid;
  grid-template-columns: 1.08fr .7fr .78fr;
  grid-auto-rows: 122px;
  gap: 10px;
}

.ref-gallery-board figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--ref-line);
  border-radius: 12px;
  background: #d8eee8;
}

.ref-gallery-board figure:nth-child(3) {
  grid-row: span 2;
}

.ref-gallery-large {
  grid-row: span 3;
}

.ref-gallery-board img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 46%;
}

.ref-gallery-large img {
  object-position: 50% 40%;
}

.ref-gallery-board figcaption {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 12px rgba(0,0,0,.38);
}

.ref-paper-tile {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(255,255,255,.86), rgba(246,235,212,.82)),
    #f4ead7 !important;
  color: #8b7a60;
  text-align: center;
  font-size: 13px;
  font-weight: 900;
}

body.ref-gallery {
  background:
    radial-gradient(circle at 12% 6%, rgba(217, 248, 241, .84), transparent 360px),
    radial-gradient(circle at 88% 8%, rgba(221, 217, 251, .56), transparent 340px),
    linear-gradient(180deg, #f8fffd 0%, #eefbf8 100%);
}

body.ref-gallery .app-bar {
  width: min(100% - 32px, 1180px);
  height: 62px;
  margin: 18px auto 0;
  border: 1px solid var(--ref-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, .84);
  box-shadow: 0 14px 42px rgba(21, 83, 76, .1);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.ref-gallery .main {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
}

body.ref-gallery .filter-bar,
body.ref-gallery .grid-section,
body.ref-gallery .admin-usage,
body.ref-gallery .world-coverage,
body.ref-gallery .archive-hero {
  border-radius: 18px;
  border-color: var(--ref-line);
  box-shadow: 0 18px 54px rgba(21, 83, 76, .09);
}

body.ref-gallery .card-grid {
  gap: 16px;
}

body.ref-gallery .char-card,
body.ref-gallery .character-card,
body.ref-gallery [role="listitem"] {
  border-radius: 18px;
}

@media (max-width: 760px) {
  body.ref-home {
    background:
      radial-gradient(circle at 18% 8%, rgba(217, 248, 241, .88), transparent 240px),
      radial-gradient(circle at 86% 14%, rgba(221, 217, 251, .58), transparent 220px),
      #f8fffd;
  }

  .ref-app {
    width: 100%;
    margin: 0;
    padding-bottom: 76px;
  }

  .ref-desktop {
    display: none;
  }

  .ref-mobile {
    display: block;
    min-height: 100vh;
    padding: 22px 14px 88px;
  }

  .ref-mobile__status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 22px;
    color: var(--ref-ink);
    font-size: 12px;
    font-weight: 900;
  }

  .ref-mobile__brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--ref-mint);
    font-size: 20px;
    font-weight: 900;
  }

  .ref-mobile__hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 168px;
    align-items: end;
    gap: 8px;
    margin-top: 26px;
  }

  .ref-mobile__hero h1 {
    margin: 6px 0 10px;
    font-family: var(--ref-hand);
    font-size: 42px;
    line-height: .92;
  }

  .ref-mobile__hero p {
    margin: 0;
    color: var(--ref-ink);
    font-size: 13px;
    line-height: 1.54;
    word-break: keep-all;
  }

  .ref-mobile__portrait {
    position: relative;
    height: 214px;
    overflow: hidden;
    border-radius: 18px;
    background:
      radial-gradient(circle at 92% 24%, var(--ref-violet), transparent 70px),
      radial-gradient(circle at 76% 34%, var(--ref-mint-2), transparent 96px),
      #b9cbc4;
  }

  .ref-mobile__portrait::before {
    content: "";
    position: absolute;
    left: 45px;
    top: 38px;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: #dcb79f;
  }

  .ref-mobile__portrait::after {
    content: "";
    position: absolute;
    left: 31px;
    top: 32px;
    width: 116px;
    height: 38px;
    border-radius: 20px;
    background: #1d1b19;
  }

  .ref-mobile .ref-button {
    width: 186px;
    min-height: 44px;
    margin-top: 14px;
    padding: 0 14px;
    border-radius: 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .ref-mobile-card {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid var(--ref-line);
    border-radius: 18px;
    background: var(--ref-card);
    box-shadow: 0 12px 34px rgba(21, 83, 76, .08);
  }

  .ref-mobile-card h2 {
    margin: 0 0 12px;
    font-size: 17px;
  }

  .ref-mobile-card p {
    margin: 0;
    color: var(--ref-muted);
    line-height: 1.5;
  }

  .ref-mobile-card__split {
    display: grid;
    grid-template-columns: 1fr 108px;
    gap: 12px;
    align-items: center;
  }

  .ref-admin-card {
    display: block;
    margin-top: 14px;
  }

  .ref-admin-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .ref-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--ref-line);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(18px);
  }

  .ref-bottom-nav a {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    color: var(--ref-muted);
    font-size: 10px;
    text-decoration: none;
  }

  .ref-bottom-nav a.is-active {
    color: var(--ref-mint);
    font-weight: 900;
  }

  .ref-discover-hero {
    margin: 14px 14px 14px;
    padding: 16px;
    border-radius: 20px;
  }

  .ref-discover-hero__head {
    display: block;
  }

  .ref-discover-hero__action {
    display: none;
  }

  .ref-discover-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .ref-discover-filters span {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 14px;
    font-size: 11px;
  }

  .ref-discover-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .ref-discover-strip article {
    min-height: 128px;
  }

  .ref-discover-strip article:nth-child(4) {
    display: none;
  }

  .ref-discover-strip article b {
    margin-top: 76px;
    margin-left: 10px;
    font-size: 14px;
  }

  .ref-discover-strip article span {
    margin-left: 10px;
    font-size: 8px;
  }

  body.ref-gallery .app-bar,
  body.ref-gallery .main {
    width: 100%;
    margin-top: 0;
    border-radius: 0;
  }

  body.ref-gallery .app-bar {
    border-left: 0;
    border-right: 0;
    border-top: 0;
    box-shadow: none;
  }

  .ref-gallery .filter-bar {
    margin-inline: 14px !important;
    overflow-x: auto;
  }

  .ref-gallery .grid-section {
    margin-inline: 14px !important;
  }

  .ref-gallery .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .ref-gallery-moments {
    margin: 14px;
    padding: 16px;
    border-radius: 20px;
  }

  .ref-gallery-moments__head {
    display: block;
  }

  .ref-gallery-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    margin-top: 12px;
  }

  .ref-gallery-tabs span {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 12px;
    font-size: 11px;
  }

  .ref-gallery-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 104px;
  }

  .ref-gallery-large {
    grid-column: span 2;
    grid-row: span 2;
  }

  .ref-gallery-board figure:nth-child(3) {
    grid-row: auto;
  }
}
