:root {
  --bg: #F6B01C;
  --grid: #F9C860;
  --surface: #D5933D;
  --depth: #BB6323;
  --header: #FCDA79;
  --headerBorder: #E5C25E;
  --paper: #FEF8E0;
  --paperStroke: #CEBC96;
  --white: #FFFFFF;
  --accent: #814009;
  --outerStroke: #8A1E06;
  --innerStroke: #EFB36B;

  --baseW: 1353px;
  --baseH: 831px;

  --tabW: 100px;
  --tabOverlap: 5px;

  --playerH: 40px;
  --playerLift: 10px;

  --depthExtend: 20px;

  --safeX: 160px;
  --safeY: 30px;

  --contentW: calc(var(--baseW) + (var(--tabW) - var(--tabOverlap)));
  --contentH: calc(var(--baseH) + var(--playerH) + var(--playerLift) + var(--depthExtend));

  --viewportW: calc(var(--contentW) + (var(--safeX) * 2));
  --viewportH: calc(var(--contentH) + (var(--safeY) * 2));

  --scale: min(calc(100vw / var(--viewportW)), calc(100vh / var(--viewportH)), 1);

  --tabOuter: #8B2A00;

  --tabOnBg: #E5B865;
  --tabOnInner: #FFC585;
  --tabOnText: #8B2A00;

  --tabOffBg: #912300;
  --tabOffInner: #B25428;
  --tabOffText: #E5B865;

  --fs-menu: 14px;
  --fs-notice: 14px;
  --fs-mini: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-color: var(--bg);
  font-family: "Noto Sans KR", system-ui;
  overflow: hidden;
  cursor: url("material/cursors/Cute Bread.cur") 0 0, auto !important;
}

body.is-holding {
  cursor: url("material/cursors/Cute Bread Link (Con mermelada).cur") 0 0, auto !important;
}

img {
  max-width: 100%;
  height: auto;
}

button,
.nav-tab,
.mini-btn,
.gallery-thumb,
.gallery-filter,
.xfeed-btn,
a {
  cursor: url("material/cursors/Cute Bread button.cur") 0 0, auto !important;
}

button:disabled,
.is-disabled,
[aria-disabled="true"] {
  cursor: url("material/cursors/Cute Bread Unvailable.cur") 0 0, auto !important;
}

.scroll-x {
  cursor: url("material/cursors/Cute Bread Horizontal.cur") 0 0, auto !important;
}

.scroll-y {
  cursor: url("material/cursors/Cute Bread Vertical.cur") 0 0, auto !important;
}

.app {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewport {
  position: relative;
  width: var(--viewportW);
  height: var(--viewportH);
  transform: scale(var(--scale));
  transform-origin: center;
}

.layout {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--contentW);
  height: var(--contentH);
  transform: translate(-50%, -50%);
}

.home-frame {
  position: absolute;
  left: 0;
  top: calc(var(--playerH) + var(--playerLift));
  width: var(--baseW);
  height: var(--baseH);
}

.player-bar {
  position: absolute;
  left: 10px;
  top: calc(-1 * (var(--playerH) + var(--playerLift)));
  height: var(--playerH);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  border-radius: 10px;
  color: #fff;
  z-index: 5;
}

.player-icon-img {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
}

.player-text {
  font-size: var(--fs-notice);
  font-weight: 700;
  white-space: nowrap;
}

.nav-tabs {
  position: absolute;
  left: 100%;
  margin-left: calc(-1 * var(--tabOverlap));
  top: 50px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.nav-tab {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--tabOuter);
  border-radius: 10px;
  width: var(--tabW);
  height: 46px;
  padding-left: 10px;
  padding-right: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--tabOffBg);
  box-shadow: inset 0 0 0 2px var(--tabOffInner);
  font: inherit;
}

.nav-tab+.nav-tab {
  margin-top: 5px;
}

.nav-tab:nth-child(2) {
  margin-top: 20px;
}

.nav-tab p {
  order: 1;
  margin: 0;
  font-size: var(--fs-menu);
  font-weight: 800;
  color: var(--tabOffText);
  white-space: nowrap;
}

.nav-tab.is-active {
  background: var(--tabOnBg);
  box-shadow: inset 0 0 0 2px var(--tabOnInner);
}

.nav-tab.is-active p {
  color: var(--tabOnText);
}

.nav-icon-img {
  order: 2;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: block;
}

.frame-depth {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: calc(-1 * var(--depthExtend));
  background: var(--depth);
  border-radius: 16px;
  box-shadow: 0 0 0 2px var(--outerStroke);
  z-index: 1;
}

.frame-surface {
  position: absolute;
  inset: 0;
  background: var(--surface);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: inset 0 0 0 2px var(--innerStroke);
  z-index: 2;
  min-height: 0;
}

.header-panel {
  height: 150px;
  border-radius: 13px;
  border: 2px solid var(--innerStroke);
  background:
    url("material/img/header.webp") center / cover no-repeat,
    var(--header);
}

.body-panel {
  flex: 1;
  min-height: 0;
  background: var(--accent);
  border-radius: 13px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: inset 0 0 0 2px var(--innerStroke);
}

.notice-ticker {
  height: 34px;
  min-height: 34px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 12px;
}

.notice-track {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 0;
  will-change: transform;
  animation: notice-marquee 18s linear infinite;
}

.notice-run {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  padding-right: 10px;
}

.notice-item {
  font-size: var(--fs-notice);
  font-weight: 800;
  color: #FEF8E0;
}

.notice-sep {
  color: rgba(254, 248, 224, 0.7);
  font-weight: 900;
}

@keyframes notice-marquee {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .notice-track {
    animation: none;
  }
}

.content-surface {
  flex: 1;
  min-height: 0;
  background: var(--paper);
  border-radius: 12px;
  padding: 12px;
  box-shadow: inset 0 0 0 2px var(--paperStroke);
}

.view-root {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.body-grid {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 10px;
}

.primary-wrap,
.sidebar-wrap {
  height: 100%;
  min-height: 0;
  background: #E5B865;
  border-radius: 14px;
  padding: 10px;
  box-shadow: inset 0 0 0 2px #814009;
}


.primary-panel .work {
  display: block;
  max-width: min(520px, 80%);
  max-height: 55%;
  height: auto;
  width: auto;
  object-fit: contain;
}

.primary-panel .home-construction {
  color: #814009;
  font-size: 14px;
}

.sidebar {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.side-card {
  border-radius: 9px;
  overflow: hidden;
  border: 2px solid var(--paperStroke);
  background: var(--paper);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.side-card-head {
  height: 34px;
  min-height: 34px;
  background: var(--paper);
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.side-card-title {
  font-size: var(--fs-notice);
  font-weight: 900;
  color: #814009;
  letter-spacing: -0.2px;
}

.side-card-line {
  height: 2px;
  min-height: 2px;
  background: var(--paperStroke);
}

.side-card-body {
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.side-card--mine .side-card-body {
  align-items: center;
}

.banner-img {
  width: 90%;
  height: auto;
  display: block;
  object-fit: contain;
}

.side-actions {
  display: flex;
  gap: 10px;
}

.mini-btn {
  appearance: none;
  -webkit-appearance: none;
  height: 25px;
  padding: 0 3px;
  border-radius: 5px;
  border: 2px solid #DBDBDB;
  outline: none;
  background: #EDEDED;
  font-size: var(--fs-mini);
  color: #3a3a3a;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mini-btn:focus,
.mini-btn:focus-visible {
  outline: none;
}

.btn-ic-img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: block;
}

.btn-label {
  line-height: 1;
  white-space: nowrap;
}

.side-card--others {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.side-card--others .side-card-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.other-list {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow: auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.other-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.other-label {
  font-size: 10px;
  font-weight: 900;
  color: #5E1F00;
  padding: 0px 10px;
  background: #FFFFFF;
  border: 1px solid #5E1F00;
  border-radius: 99px;
  text-align: center;
  width: fit-content;
  margin: 6px auto 4px;
}

.other-label-banner {
  margin-top: 20px;
}

.other-grid {
  display: grid;
  grid-template-columns: repeat(3, 50px);
  gap: 0px;
  width: fit-content;
  margin: 0 auto;
}

.other-btn {
  width: 50px;
  height: 30px;
  border: none;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.other-btn img {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.other-banner-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.other-banner {
  width: 200px;
  height: 40px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  overflow: hidden;
}

.other-banner img {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: block;
}

.view-gallery {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gallery-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gallery-filter {
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 2px solid #814009;
  outline: none;
  background: #EFD917;
  font-size: var(--fs-mini);
  font-weight: 800;
  color: #814009;
}

.gallery-filter:focus,
.gallery-filter:focus-visible {
  outline: none;
}

.gallery-filter.is-active {
  background: #F87B01;
  border: 2px solid #814009;
  color: #814009;
}

.gallery-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
  box-sizing: content-box;
  scrollbar-width: thin;
  scrollbar-color: #912300 transparent;
}

.gallery-scroll::-webkit-scrollbar {
  width: 6px;
}

.gallery-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-scroll::-webkit-scrollbar-thumb {
  background: #912300;
}

.gallery-scroll::-webkit-scrollbar-thumb:hover {
  background: #912300;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-content: start;
}

.gallery-thumb {
  appearance: none;
  -webkit-appearance: none;
  border: 2px solid var(--paperStroke);
  background: #fff;
  padding: 0;
  margin: 0;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  outline: none;
}

.gallery-thumb:focus,
.gallery-thumb:focus-visible {
  outline: none;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.view-root.view-gallery {
  height: 100%;
}

.gallery-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 10px;
  background: #E5B865;
  border-radius: 14px;
  padding: 10px;
  box-shadow: inset 0 0 0 2px #814009;
}

.gallery-feed,
.gallery-right {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--paper);
  border-radius: 12px;
  border: 2px solid var(--paperStroke);
  padding: 10px;
}

.gallery-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gallery-feed-title {
  font-size: var(--fs-notice);
  font-weight: 900;
  color: #814009;
}

.gallery-feed-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-right: 10px;
  box-sizing: content-box;
  scrollbar-width: thin;
  scrollbar-color: #912300 transparent;
}

.gallery-feed-scroll::-webkit-scrollbar {
  width: 6px;
}

.gallery-feed-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.gallery-feed-scroll::-webkit-scrollbar-thumb {
  background: #912300;
}

.gallery-feed-scroll::-webkit-scrollbar-thumb:hover {
  background: #912300;
}

.xfeed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.xfeed-card {
  background: #fff;
  border: 2px solid var(--paperStroke);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xfeed-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.xfeed-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #d9d9d9;
  flex: 0 0 auto;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.xfeed-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.xfeed-author {
  font-size: 14px;
  font-weight: 900;
  color: #111;
  line-height: 1.2;
  word-break: break-word;
}

.xfeed-text {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

.xfeed-media {
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  background: #f2f2f2;
}

.xfeed-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.xfeed-action {
  display: flex;
  justify-content: center;
  align-items: center;
}

.xfeed-btn {
  appearance: none;
  border: none;
  background: #FEC403;
  box-shadow: inset 0 0 0 2px #7C592F;
  color: #7C592F;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 4px;
}

.xfeed-btn:hover {
  filter: brightness(0.95);
}

.xfeed-missing {
  font-size: 12px;
  font-weight: 900;
  color: #9a9a9a;
}

.bgm-sink {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.guestbook-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.guestbook-overlay:not([hidden]) {
  pointer-events: auto;
}

#guestbook-overlay[hidden] {
  display: none !important;
}

.guestbook-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(336px, calc(100vw - 24px));
  height: min(536px, calc(100vh - 24px));
  background: #D5933D;
  border-radius: 30px;
  box-shadow: inset 0 0 0 2px #EFB36B, 0 0 0 2px #8A1E06;
  padding: 15px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.guestbook-phone {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guestbook-speaker {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 18px;
  border-radius: 50px;
  background: #814009;
  box-shadow: inset 0 0 0 2px #EFB36B;
}

.guestbook-screen {
  width: 285px;
  height: 420px;
  margin-top: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guestbook-bezel {
  width: 100%;
  height: 100%;
  background: #814009;
  border-radius: 10px;
  border: 2px solid #EFB36B;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guestbook-display {
  width: 100%;
  height: 100%;
  background: #5E1F00;
  border-radius: 10px;
  border: 2px solid #5E1F00;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.gb-view {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gb-view[hidden] {
  display: none !important;
}

#gb-login {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gb-title-photo {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 10px;
}

.gb-login-fields {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

#gb-login .gb-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gb-label {
  font-size: 12px;
  font-weight: 900;
  color: #FFF9E3;
  text-align: left;
}

.gb-input {
  width: 100%;
  height: 32px;
  border-radius: 9px;
  border: 2px solid #FFF9E3;
  background: #FFF9E3;
  padding: 0 10px;
  box-sizing: border-box;
  min-width: 0;
}

.gb-input::placeholder,
.gb-textarea::placeholder {
  color: rgba(94, 31, 0, 0.45);
  font-weight: 700;
}

.gb-login-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#gb-login-status {
  font-size: 12px;
  font-weight: 800;
  color: #912300;
  white-space: nowrap;
}

#gb-login-status:empty {
  display: none;
}

.gb-btn-login {
  height: 30px;
  padding: 0 14px;
  border-radius: 12px;
  border: 2px solid #814009;
  background: #FEC403;
  font-weight: 900;
  color: #814009;
  margin-left: auto;
  flex: 0 0 auto;
}

.gb-status {
  font-size: 12px;
  font-weight: 800;
  color: #912300;
  text-align: center;
}

.gb-chat {
  flex: 1;
  min-height: 0;
}

.gb-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px;
  box-sizing: border-box;
}

.gb-msg {
  background: #FFF9E3;
  border-radius: 9px;
  padding: 8px;
  box-sizing: border-box;
}

.gb-msg-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.gb-msg-name {
  font-size: 13px;
  font-weight: 900;
  color: #814009;
}

.gb-msg-date {
  margin-left: auto;
  font-size: 10px;
  color: #5E1F00;
  white-space: nowrap;
}

.gb-msg-text {
  margin-top: 5px;
  font-size: 12px;
  color: #5E1F00;
  white-space: pre-wrap;
}

.gb-input-bar {
  border-top: 2px solid #CEBC96;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gb-textarea {
  resize: none;
  height: 56px;
  border-radius: 9px;
  border: 2px solid #FFF9E3;
  background: #FFF9E3;
  padding: 8px;
  box-sizing: border-box;
}

.gb-textarea {
  font: inherit;
  font-size: 12px;
}

.gb-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.gb-check {
  font-size: 12px;
  font-weight: 900;
  color: #FFF9E3;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.gb-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #FEC403;
}

.gb-msg.is-secret {
  box-shadow: inset 0 0 0 2px rgba(94, 31, 0, 0.12);
}

.gb-secret-mask {
  font-weight: 900;
  color: rgba(94, 31, 0, 0.65);
}

.gb-reply {
  background: #FFFFFF;
  border-radius: 9px;
  padding: 4px 6px;
  margin-top: 6px;
  font-size: 10px;
  color: #5E1F00;
  display: flex;
  gap: 4px;
  align-items: baseline;
  overflow-wrap: anywhere;
}

.gb-reply-name {
  font-weight: 900;
  flex: 0 0 auto;
}

.gb-reply-text {
  font-weight: 500;
}

#gb-send {
  padding: 0 14px;
  height: 30px;
  border-radius: 12px;
  border: 2px solid #814009;
  background: #FEC403;
  font-weight: 900;
  color: #814009;
  flex: 0 0 auto;
}

.guestbook-home {
  width: 50px;
  aspect-ratio: 1/1;
  margin-top: 20px;
  border-radius: 999px;
  background: #E5B865;
  border: 2px solid #912300;
  padding: 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  flex: 0 0 auto;
  overflow: visible;
}

.guestbook-home::before {
  content: "";
  width: 40px;
  aspect-ratio: 1/1;
  border-radius: 999px;
  background: #D5933D;
  border: 2px solid #912300;
  box-sizing: border-box;
  display: block;
}

.primary-panel {
  height: 100%;
  min-height: 0;
  border-radius: 12px;
  border: 2px solid #D68843;
  background: repeating-linear-gradient(90deg, #EEC775 0 60px, #FFE8B4 60px 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.book {
  position: relative;
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: center;
}

.book-page {
  width: 450px;
  height: 440px;
  background: #A56B38;
  border-radius: 9px;
  box-shadow: 0 0 0 2px #5C2300;
  position: relative;
  overflow: visible;
}

.book-page .page-sheet {
  position: absolute;
  left: 20px;
  top: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 60px);
  border-radius: 9px;
  overflow: visible;
  isolation: isolate;
  display: flex;
  align-items: stretch;
  min-height: 0;
}

.book-page .page-sheet::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: #FEFBF4;
  box-shadow: inset 0 0 0 2px #BB9A7B;
  pointer-events: none;
  z-index: 1;
}

.book-page .page-sheet::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: -20px;
  background: #F4E2BE;
  border-radius: 9px;
  z-index: 0;
}

.book-page .page-frame {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: -20px;
  border-radius: 9px;
  box-shadow: 0 0 0 2px #783802;
  pointer-events: none;
  z-index: 3;
}

.book-page.is-left .sheet-inner {
  width: 100%;
  height: 100%;
  padding: 25px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.book-page.is-left .sheet-box {
  flex: 1;
  min-height: 0;
  background: #FFFFFF;
  border: 2px solid #FAECD3;
  border-radius: 9px;
  box-sizing: border-box;
  overflow: hidden;
}

.sheet-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.book-page.is-left .sheet-dots {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.book-page.is-left .dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #E6D0A2;
  display: block;
}

.book-page.is-left .dot.is-active {
  background: #A76D2A;
}

.book-page.is-right .right-inner {
  width: 100%;
  height: 100%;
  padding: 25px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 30px;
  min-height: 0;
  position: relative;
  z-index: 2;
}

.book-page.is-right .right-banner {
  width: 230px;
  height: 55px;
  margin-top: 10px;
  border-radius: 9px;
  background: #FFE8B4;
  border: 2px solid #814009;
  box-shadow: inset 0 0 0 2px #D5933D;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  flex: 0 0 auto;
}

.book-page.is-right .right-banner-text {
  font-size: 16px;
  font-weight: 800;
  color: #A56B38;
  line-height: 1.1;
  white-space: nowrap;
}

.book-page.is-right .post-list {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #912300 transparent;
  position: relative;
  z-index: 2;
}

.book-page.is-right .post-list::-webkit-scrollbar {
  width: 6px;
}

.book-page.is-right .post-list::-webkit-scrollbar-track {
  background: transparent;
}

.book-page.is-right .post-list::-webkit-scrollbar-thumb {
  background: #912300;
}

.post-item {
  transition: background-color .12s ease, box-shadow .12s ease;
  border-radius: 4px;
}

.post-item:hover {
  background: #FFE8B4;
  box-shadow: inset 0 0 0 1px rgba(129, 64, 9, 0.35);
}

.post-item:hover .post-title {
  color: #5E1F00;
}

.post-item:hover .post-tag.notice {
  background: #8FD600;
}

.post-item:hover .post-tag.free {
  background: #E0208A;
}


.post-item+.post-item {
  border-top: 0.5px solid rgba(129, 64, 9, 0.5);
}

.post-tag {
  min-width: 40px;
  height: 15px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.post-tag.notice {
  background: #A3E20F;
}

.post-tag.free {
  background: #F638A6;
}

.post-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: #814009;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-set {
  position: absolute;
  top: 10px;
  left: 70px;
  display: flex;
  z-index: 5;
  transform: scale(0.4);
  transform-origin: top left;
  pointer-events: auto;
}

.sticker {
  display: block;
  height: auto;
}

.floating-wrap {
  position: absolute;
  width: 350px;
  height: auto;
  right: -130px;
  bottom: -60px;
  z-index: 9999;
  pointer-events: auto;
}

.floating-sticker {
  display: block;
  transform-origin: bottom right;
}

.sticker-tip {
  position: fixed;
  left: 0;
  top: 0;
  transform: translate(-9999px, -9999px);
  padding: 6px 10px;
  border-radius: 5px;
  background: #814009;
  color: #D5933D;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  z-index: 99999;
  white-space: nowrap;
  pointer-events: none;
}

.sticker-x-link {
  position: absolute;
  top: 25px;
  right: 70px;
  z-index: 50;
  display: block;
}

.sticker-x {
  width: 40px;
  height: auto;
  image-rendering: pixelated;
  user-select: none;
  cursor: pointer;
}

.book-hinge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  gap: 90px;
  z-index: 3;
  pointer-events: none;
}

.hinge-pair {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.hinge-piece {
  width: 33px;
  height: 13px;
  background: #D99355;
  border: 2px solid #A56B38;
  border-radius: 9px;
}

@font-face {
  font-family: "Jalnan";
  src: url("https://cdn.jsdelivr.net/gh/wizfile/font/Jalnan.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

.book-page.is-right .right-banner-text {
  font-family: "Jalnan", system-ui;
  font-size: 14px;
  letter-spacing: 0.5px;
  line-height: 1.05;

  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  transform: scaleX(0.96);
}

.post-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 2px;
}

.post-title {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: #814009;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-date {
  font-size: 11px;
  font-weight: 800;
  color: rgba(129, 64, 9, 0.7);
  white-space: nowrap;
  flex: 0 0 auto;
  margin-left: 6px;
}

@keyframes guestbook-in {
  from {
    transform: translate(-50%, calc(-50% + 80px)) scale(0.8);
    opacity: 0;
  }

  to {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }
}

@keyframes guestbook-out {
  from {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 1;
  }

  to {
    transform: translate(-50%, calc(-50% + 80px)) scale(0.8);
    opacity: 0;
  }
}

.guestbook-sheet {
  animation: guestbook-in 0.35s cubic-bezier(.22, .61, .36, 1);
}

.guestbook-sheet.is-closing {
  animation: guestbook-out 0.25s ease-in forwards;
}

.view-root.view-archive {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.view-root.view-archive {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.archive-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: calc(100% - 350px) 330px;
  gap: 10px;
  background: transparent;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
}

.archive-main {
  background: #814009;
  border-radius: 9px;
  min-height: 0;
  padding: 15px 55px 15px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  box-sizing: border-box;
}

.archive-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-tab {
  appearance: none;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 0;
  background: rgba(254, 248, 224, 0.2);
  color: #FEF8E0;
  font-size: 12px;
  font-weight: 900;
}

.archive-tab.is-active {
  background: #FEF8E0;
  color: #814009;
}

.archive-scroll {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.archive-scroll-inner {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  margin-right: 0;
  padding-right: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #814009 transparent;
}

.archive-scroll-inner::-webkit-scrollbar {
  width: 5px;
}

.archive-scroll-inner::-webkit-scrollbar-thumb {
  background: #814009;
  border-radius: 3px;
}

.archive-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 170px));
  justify-content: space-between;
  align-content: start;
  row-gap: 50px;
  column-gap: 10px;
  padding-top: 30px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.archive-card {
  width: 170px;
  height: 182px;
  position: relative;
  border-radius: 9px;
  isolation: isolate;
}

.archive-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #FEF8E0;
  border-radius: 9px;
  z-index: 1;
}

.archive-thumb {
  position: absolute;
  left: 10px;
  top: -10px;
  height: 155px;
  z-index: 20;
}

.archive-thumb img {
  height: 155px;
  border-radius: 5px;
  pointer-events: none;
  user-select: none;
}

.archive-meta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  height: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 30;
}

.archive-cat {
  width: 35px;
  height: 20px;
  border-radius: 5px;
  background: #954913;
  color: #FEF8E0;
  font-size: 12px;
  font-weight: 900;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.archive-title {
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.archive-date {
  margin-left: auto;
  font-size: 10px;
  font-weight: 900;
  color: #954913;
  flex: 0 0 auto;
}

.archive-stars {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 25;
}

.archive-star {
  width: 14px;
  opacity: 0.2;
}

.archive-star.is-on {
  opacity: 1;
}

.archive-done {
  position: absolute;
  left: 32px;
  bottom: 75px;
  transform: translate(100%, 100%);
  width: 70px;
  z-index: 25;
}

.archive-side {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.paper-stack {
  position: relative;
  width: 305px;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.paper-back {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 274.5px;
  height: 500px;
  background: #E5B865;
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px #93571A;
  transform: translate(-50%, -50%) rotate(5deg);
  transform-origin: center;
  z-index: 1;
}

.paper-front {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 274.5px;
  height: 500px;
  background: #FEF8E0;
  border-radius: 9px;
  box-shadow: inset 0 0 0 2px #D4C19D;
  transform: translate(-50%, -50%);
  z-index: 2;
  overflow: hidden;
}

.profile-inner {
  height: 100%;
  min-height: 0;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-top {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.profile-photo {
  position: relative;
  width: 180px;
  height: 220px;
  border-radius: 5px;
  box-shadow: 0 0 0 2px #814009;
  overflow: hidden;
}

.profile-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  box-shadow: inset 0 0 0 2px #FFFFFF;
  z-index: 2;
  pointer-events: none;
}

.profile-photo img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(-50%, -50%) scale(1.15);
  transform-origin: center;
  z-index: 1;
  display: block;
}

.profile-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.profile-tag-block {
  margin-top: -5px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
}

.tag-row {
  width: 100%;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.tag {
  height: 20px;
  padding: 0 8px;
  border-radius: 2px;
  background: #814009;
  color: #FEF8E0;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.divider {
  width: 100%;
  border-top: 2px solid #814009;
}

.divider-img {
  display: block;
  max-width: 100%;
  height: auto;
  line-height: 0;
}

.divider-text {
  font-size: 12px;
  font-weight: 900;
  color: #814009;
  text-align: center;
  line-height: 1.4;
}

.divider-block {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  margin-top: 0;
  padding: 10px 0;
}

.divider-block>* {
  margin: 0;
}

.divider-block .divider-img {
  display: block;
}

.divider-block .divider {
  margin: 0;
}

.profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.profile-title {
  min-width: 0;
  font-size: 12px;
  font-weight: 900;
  color: #814009;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wifi {
  width: 20px;
  height: 12px;
  background: url("material/img/wifi.svg") center / contain no-repeat;
  flex: 0 0 auto;
}

.content-surface {
  position: relative;
  overflow: hidden;
}

.archive-stage {
  position: absolute;
  inset: 12px;
  width: auto;
  height: auto;
  min-height: 0;
  background: #FEF8E0;
  border-radius: 12px;
  box-sizing: border-box;
  overflow: hidden;
}

.content-surface.is-archive #view-root,
body.is-archive #view-root,
#view-root.is-force-hidden {
  display: none !important;
}

body.is-archive #view-root::before,
body.is-archive #view-root::after {
  content: none !important;
}

.archive-shell {
  position: relative;
}

.archive-sticker {
  position: absolute;
  z-index: 50;
  height: auto;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.archive-sticker-clip {
  top: 0px;
  right: 225px;
  width: 70px;
}

.archive-sticker-flower {
  top: 0px;
  width: 100px;
  right: 20px;
}

.post-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
}

.post-modal {
  width: min(760px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  overflow: hidden;
  border-radius: 14px;
  background: #FEF8E0;
  box-shadow: 0 0 0 2px #8A1E06;
  color: #5E1F00;
}

.post-modal-top {
  position: relative;
  padding: 12px 44px 10px 12px;
  background: linear-gradient(#FFF2C9, #FEE5A5);
  border-bottom: 2px solid rgba(138, 30, 6, .25);
}

.post-modal-head {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.post-modal-title {
  font-size: 15px;
  font-weight: 900;
  color: #8A1E06;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-modal-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.post-modal-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  border: 2px solid rgba(138, 30, 6, .35);
  background: #fff;
  color: #5E1F00;
  font-weight: 900;
  font-size: 11px;
}

.post-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 2px solid rgba(138, 30, 6, .35);
  background: #fff;
  color: #8A1E06;
  font-weight: 900;
  font-size: 18px;
  line-height: 26px;
  cursor: pointer;
}

.post-modal-close:hover {
  background: #FFE8B4;
}

.post-modal-body {
  padding: 12px;
}

.post-modal-paper {
  background: #fff;
  border: 2px solid rgba(206, 188, 150, .95);
  border-radius: 12px;
  padding: 12px 12px 14px;
  box-shadow: inset 0 0 0 2px rgba(239, 179, 107, .35);
}

.post-modal-text {
  font-weight: 700;
  color: #5E1F00;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-modal{
  transform: translateY(6px);
  opacity: 0;
  animation: postPop .12s ease-out forwards;
}

@keyframes postPop{
  to{ transform: translateY(0); opacity: 1; }
}

.post-modal-body{
  max-height: calc(min(720px, (100vh - 24px)) - 72px);
  overflow: auto;
}

.post-modal-close{
  width:34px;
  height:34px;
  line-height:30px;
}
