:root {
  --bg: #dfeefe;
  --bg-dot: #eef7ff;
  --paper: #cfe6fb;
  --ink: #4d7396;
  --muted: #79a2c7;
  --line: #8fb7d8;
  --deep: #5b8fbc;
  --white: #ffffff;
}

@font-face {
  font-family: "OwnglyphMonggeul";
  src: url("/fonts/ownglyph-monggeul.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "OwnglyphMonggeul", sans-serif;
  color: var(--ink);
  min-height: 100vh;
}

.sky-theme {
  background:
    radial-gradient(circle at 12% 8%, rgba(167, 205, 236, 0.55) 0 8px, transparent 9px),
    radial-gradient(circle at 34% 22%, rgba(167, 205, 236, 0.45) 0 7px, transparent 8px),
    radial-gradient(circle at 71% 30%, rgba(167, 205, 236, 0.4) 0 8px, transparent 9px),
    radial-gradient(circle at 88% 14%, rgba(167, 205, 236, 0.45) 0 6px, transparent 7px),
    linear-gradient(180deg, var(--bg-dot), var(--bg));
  background-size: 220px 220px, 260px 260px, 280px 280px, 300px 300px, auto;
}

.cover-layout {
  position: relative;
  min-height: 100vh;
  width: min(1040px, 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 170px;
  align-items: center;
  gap: 22px;
}

.book-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 20px;
  border: 2px solid var(--line);
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.86) 0 1.4px, transparent 1.6px) 0 0 / 14px 14px,
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.25), transparent 38%),
    var(--paper);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.34),
    0 20px 40px rgba(92, 139, 177, 0.22);
  overflow: hidden;
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.78) 0 1.2px, transparent 1.4px) 7px 7px / 14px 14px;
  opacity: 0.28;
}

.book-spine {
  position: absolute;
  top: 0;
  right: 0;
  width: 11%;
  height: 100%;
  border-left: 2px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.25), rgba(145, 186, 220, 0.3));
}

.book-clasp {
  position: absolute;
  right: 12%;
  top: 50%;
  transform: translateY(-50%);
  width: 20%;
  height: 35%;
  border: 2px solid var(--line);
  border-right: 0;
  border-radius: 20px 0 0 20px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1.3px, transparent 1.5px) 0 0 / 12px 12px,
    #c4e1f8;
  display: grid;
  place-items: center;
  z-index: 3;
}

.book-clasp-btn {
  width: clamp(24px, 4vw, 38px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 2px solid #9bbfdd;
  background: radial-gradient(circle at 35% 35%, #fff, #f3efe3);
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.9);
}

.cover-decos {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.deco {
  position: absolute;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 2px rgba(108, 149, 181, 0.35));
}

.wing-top {
  width: 21%;
  left: 65%;
  top: 4%;
  z-index: 4;
}

.index-panel {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 10px;
}

.index-panel a {
  text-decoration: none;
  color: var(--deep);
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  text-align: center;
  font-size: 1.4rem;
  box-shadow: 0 6px 0 rgba(121, 162, 199, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.index-panel a:hover {
  transform: translateY(-2px);
}

.index-panel a:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(121, 162, 199, 0.35);
}

.floating-char {
  position: absolute;
  width: clamp(88px, 10vw, 132px);
  right: 14px;
  top: 26%;
  z-index: 5;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 2px rgba(90, 121, 145, 0.25));
  pointer-events: none;
}

.page-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: linear-gradient(180deg, #eff8ff, #dff0ff);
}

.page-card {
  width: min(720px, 100%);
  background: #f9fdff;
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 28px;
}

.page-card h1 {
  margin: 0 0 8px;
  color: var(--deep);
  font-size: 2rem;
}

.page-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.page-card a {
  color: var(--ink);
}

@media (max-width: 860px) {
  .cover-layout {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 24px 0;
  }

  .index-panel {
    grid-template-columns: repeat(3, 1fr);
  }

  .book-cover {
    aspect-ratio: 4 / 5;
  }

  .book-clasp {
    right: 11%;
    width: 24%;
  }

  .wing-top {
    width: 28%;
    left: 61%;
    top: 12%;
  }

  .floating-char {
    width: 92px;
    left: 35%;
    right: auto;
    top: 73%;
    bottom: auto;
    transform: translateY(-50%);
  }
}

/* Diary Page Styles */
.diary-shell {
  width: min(980px, 92%);
  margin: 0 auto;
  padding: 28px 0 44px;
}

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

.diary-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  color: var(--deep);
}

.diary-actions {
  display: flex;
  gap: 8px;
}

.diary-actions button,
.diary-actions a,
.diary-page-top button {
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fafdff;
  color: var(--deep);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

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

.diary-page {
  background: #f9fdff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 12px 26px rgba(106, 146, 176, 0.18);
}

.diary-page-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.diary-page-top strong {
  font-size: 1.15rem;
  color: var(--deep);
}

.diary-page-top button:disabled {
  opacity: 0.45;
  cursor: default;
}

.photo-box {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 2px dashed #9fc4e2;
  border-radius: 14px;
  background: #eaf5ff;
  overflow: hidden;
  margin-bottom: 10px;
  cursor: pointer;
  position: relative;
}

.photo-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

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

.photo-placeholder {
  color: #6e9fc5;
  font-size: 1.1rem;
}

.note-lines {
  width: 100%;
  min-height: 126px;
  border: 2px solid #b9d5ec;
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  font-family: inherit;
  font-size: 1rem;
  color: #4f7393;
  line-height: 1.72;
  background:
    repeating-linear-gradient(
      to bottom,
      #fbfdff 0,
      #fbfdff 28px,
      #dcecf9 29px,
      #fbfdff 30px
    );
}

.note-lines:focus {
  outline: 2px solid #8cbbe0;
  border-color: #8cbbe0;
}

@media (max-width: 860px) {
  .diary-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .diary-list {
    grid-template-columns: 1fr;
  }
}

/* Diary V2 */
.month-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 14px;
}

.month-tabs button {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #f8fcff;
  color: var(--deep);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.98rem;
  cursor: pointer;
}

.date-input {
  border: 2px solid #b6d4ea;
  border-radius: 10px;
  background: #fafdff;
  color: var(--deep);
  font-family: inherit;
  font-size: 0.98rem;
  padding: 6px 10px;
}

.to-top-btn {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 30;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #f8fcff;
  color: var(--deep);
  font-family: inherit;
  font-size: 1rem;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(90, 125, 154, 0.22);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.to-top-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 860px) {
  .diary-shell {
    padding: 20px 0 36px;
  }

  .diary-actions {
    width: 100%;
  }

  .diary-actions button,
  .diary-actions a,
  .diary-page-top button,
  .month-tabs button,
  .date-input {
    min-height: 44px;
    font-size: 1.03rem;
  }

  .diary-actions button,
  .diary-actions a {
    flex: 1;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .diary-page {
    padding: 12px;
  }

  .photo-box {
    aspect-ratio: 1 / 1;
  }

  .note-lines {
    min-height: 148px;
    font-size: 1.03rem;
  }

  .to-top-btn {
    right: 12px;
    bottom: 12px;
    padding: 11px 15px;
  }
}

.wing-emoji {
  font-size: 0.75em;
  vertical-align: middle;
  margin-left: 0;
}

/* Money Page Styles */
.money-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px 38px;
}

.money-card {
  width: min(960px, 100%);
  background: #f9fcff;
  border: 2px solid #d2e5f3;
  border-radius: 22px;
  box-shadow: 0 24px 44px rgba(88, 124, 154, 0.18);
  padding: 18px;
}

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

.money-head h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  color: #2f5f82;
}

.money-head p {
  margin: 2px 0 0;
  color: #7098b8;
  font-size: 0.95rem;
}

.money-head a {
  border: 2px solid #bfd8ec;
  border-radius: 12px;
  padding: 7px 12px;
  text-decoration: none;
  color: #2f5f82;
  background: #fff;
}

.money-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.money-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #4a7396;
}

.money-toolbar input {
  border: 2px solid #bfd8ec;
  border-radius: 10px;
  padding: 7px 8px;
  background: #fff;
  color: #2f5f82;
  font-family: inherit;
}

.money-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.money-summary article {
  background: #eef7ff;
  border: 2px solid #c9e0f0;
  border-radius: 14px;
  padding: 10px 12px;
}

.money-summary small {
  color: #6991b2;
}

.money-summary strong {
  display: block;
  margin-top: 4px;
  color: #2f5f82;
  font-size: 1.28rem;
}

.money-form {
  display: grid;
  grid-template-columns: 130px 100px 1fr 1fr 140px 90px;
  gap: 8px;
  margin-bottom: 12px;
}

.money-form input,
.money-form select,
.money-form button {
  border: 2px solid #bfd8ec;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.96rem;
  background: #fff;
  color: #2f5f82;
}

.money-form button {
  background: #dff0ff;
  cursor: pointer;
}

.money-table-wrap {
  border: 2px solid #c9e0f0;
  border-radius: 14px;
  overflow: auto;
  background: #fff;
}

.money-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.money-table th,
.money-table td {
  padding: 10px;
  border-bottom: 1px solid #e4f0f9;
  text-align: left;
  color: #3f6788;
}

.money-table th {
  background: #f3f9ff;
  color: #6087a8;
  font-weight: 700;
}

.money-income {
  color: #2f8f62;
}

.money-expense {
  color: #c86464;
}

.money-del {
  border: 1px solid #c9dceb;
  border-radius: 8px;
  background: #f8fbff;
  color: #55799a;
  padding: 6px 8px;
  font-family: inherit;
  cursor: pointer;
}

.money-empty {
  text-align: center;
  color: #7a9db8;
}

@media (max-width: 860px) {
  .money-card {
    padding: 14px;
  }

  .money-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .money-toolbar {
    justify-content: flex-start;
  }

  .money-summary {
    grid-template-columns: 1fr;
  }

  .money-form {
    grid-template-columns: 1fr;
  }

  .money-form input,
  .money-form select,
  .money-form button,
  .money-head a,
  .money-toolbar input {
    min-height: 44px;
    font-size: 1rem;
  }

  .money-table {
    min-width: 640px;
  }
}

.money-category-manage {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 8px;
  margin-bottom: 10px;
}

.money-category-manage input,
.money-category-manage button {
  border: 2px solid #bfd8ec;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.96rem;
  background: #fff;
  color: #2f5f82;
}

.money-category-manage button {
  background: #e7f4ff;
  cursor: pointer;
}

@media (max-width: 860px) {
  .money-category-manage {
    grid-template-columns: 1fr;
  }

  .money-category-manage input,
  .money-category-manage button {
    min-height: 44px;
    font-size: 1rem;
  }
}

.money-chart-section {
  border: 2px solid #c9e0f0;
  border-radius: 14px;
  background: #f7fbff;
  padding: 10px;
  margin-bottom: 10px;
}

.money-chart-head {
  color: #5e87a7;
  margin-bottom: 8px;
}

.money-chart-wrap {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 10px;
  align-items: center;
}

#moneyPie {
  width: 100%;
  height: auto;
  display: block;
}

.money-legend {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.money-legend li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 8px;
  color: #4a7292;
  font-size: 0.95rem;
}

.money-legend .dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.money-legend-empty {
  color: #7a9db8;
}

@media (max-width: 860px) {
  .money-chart-wrap {
    grid-template-columns: 1fr;
  }

  #moneyPie {
    max-width: 260px;
    margin: 0 auto;
  }

  .money-legend li {
    grid-template-columns: 14px 1fr;
  }

  .money-legend .value {
    grid-column: 2;
  }
}

.cover-photo-slot {
  position: absolute;
  left: 13%;
  top: 15%;
  width: 42%;
  aspect-ratio: 1 / 1;
  border: 2px dashed #95bddf;
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.78);
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 4;
  cursor: pointer;
}

.cover-photo-slot input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

#coverPhotoImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#coverPhotoPlaceholder {
  color: #6d95b7;
  font-size: 1rem;
}

@media (max-width: 860px) {
  .cover-photo-slot {
    left: 4%;
    top: 25%;
    width: 58%;
  }
}

/* Wish Page Styles */
.wish-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 14px 40px;
}

.wish-card {
  width: min(980px, 100%);
  background: #f9fcff;
  border: 2px solid #d2e5f3;
  border-radius: 22px;
  box-shadow: 0 24px 44px rgba(88, 124, 154, 0.16);
  padding: 16px;
}

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

.wish-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: #2f5f82;
}

.wish-head a {
  border: 2px solid #bfd8ec;
  border-radius: 12px;
  padding: 7px 12px;
  text-decoration: none;
  color: #2f5f82;
  background: #fff;
}

.wish-bgm {
  border: 2px solid #c9e0f0;
  border-radius: 14px;
  background: #f7fbff;
  padding: 10px;
  margin-bottom: 10px;
}

.wish-bgm-row {
  display: grid;
  grid-template-columns: 130px 1fr 80px;
  gap: 8px;
  align-items: center;
}

.wish-bgm-row input,
.wish-bgm-row button {
  border: 2px solid #bfd8ec;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: #2f5f82;
}

.wish-bgm-row button {
  background: #e8f4ff;
  cursor: pointer;
}

.wish-bgm-meta-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.wish-bgm-meta-row input {
  border: 2px solid #bfd8ec;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: #2f5f82;
}

.wish-bgm small {
  display: block;
  margin: 8px 0;
  color: #7a9db8;
}

.wish-bgm-card {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  align-items: center;
  border: 2px solid #c9e0f0;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
}

#bgmArt {
  width: 86px;
  height: 86px;
  border-radius: 10px;
  object-fit: cover;
  background: #edf6ff;
  border: 1px solid #d8e9f6;
}

.bgm-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.bgm-info strong,
.bgm-info span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bgm-info strong {
  color: #2f5f82;
  font-size: 1.04rem;
}

.bgm-info span {
  color: #6b92b2;
  font-size: 0.95rem;
}

.wish-bgm-frame-hidden {
  position: fixed;
  left: -9999px;
  top: -9999px;
  width: 280px;
  height: 158px;
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
}

.wish-bgm-frame-hidden iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.wish-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.wish-tabs button {
  border: 2px solid #bfd8ec;
  border-radius: 999px;
  background: #fff;
  color: #2f5f82;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.98rem;
  cursor: pointer;
}

.wish-tabs button.active {
  background: #dff0ff;
}

.wish-upload {
  margin-bottom: 10px;
}

.wish-upload-btn {
  display: inline-flex;
  align-items: center;
  border: 2px solid #bfd8ec;
  border-radius: 12px;
  background: #fff;
  color: #2f5f82;
  padding: 8px 12px;
  cursor: pointer;
  position: relative;
}

.wish-upload-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.wish-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.wish-item {
  margin: 0;
  border: 2px solid #c9e0f0;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.wish-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.wish-item button {
  width: 100%;
  border: 0;
  border-top: 1px solid #e4f0f9;
  background: #f7fbff;
  color: #55799a;
  padding: 7px;
  font-family: inherit;
  cursor: pointer;
}

.wish-empty {
  border: 2px dashed #c9e0f0;
  border-radius: 12px;
  padding: 18px;
  color: #7a9db8;
  text-align: center;
  grid-column: 1 / -1;
}

@media (max-width: 860px) {
  .wish-card {
    padding: 14px;
  }

  .wish-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .wish-head a {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.95rem;
    padding: 6px 10px;
  }

  .wish-bgm-row {
    grid-template-columns: 1fr;
  }

  .wish-bgm-row input,
  .wish-bgm-meta-row input,
  .wish-bgm-row button,
  .wish-tabs button,
  .wish-upload-btn {
    min-height: 44px;
    font-size: 1rem;
  }

  .wish-bgm-meta-row {
    grid-template-columns: 1fr;
  }

  .wish-bgm-card {
    grid-template-columns: 72px 1fr;
    gap: 10px;
  }

  #bgmArt {
    width: 72px;
    height: 72px;
  }

  .wish-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.wish-memo {
  width: calc(100% - 10px);
  margin: 6px 5px 4px;
  border: 1px solid #d7e7f4;
  border-radius: 8px;
  padding: 7px 8px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #4c7291;
  background: #fbfdff;
}

.wish-hash-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 10px;
}

.wish-hash-tabs button {
  border: 2px solid #d2e5f3;
  border-radius: 999px;
  background: #fbfdff;
  color: #4d7394;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.wish-hash-tabs button.active {
  background: #e6f3ff;
  border-color: #bfd8ec;
}

@media (max-width: 860px) {
  .wish-hash-tabs button {
    min-height: 40px;
    font-size: 0.96rem;
  }
}

/* Wishlist BGM - album card refresh */
.wish-bgm {
  background:
    linear-gradient(160deg, #fdfefe 0%, #eff7ff 55%, #ebf4ff 100%);
  border: 2px solid #c9deef;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.wish-bgm-card {
  margin-top: 6px;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  border: 1px solid #dbeaf7;
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(88, 124, 154, 0.12);
}

#bgmArt {
  width: 112px;
  height: 112px;
  border-radius: 14px;
  border: 1px solid #d2e5f3;
}

.bgm-info strong {
  font-size: 1.14rem;
  letter-spacing: 0.01em;
}

.bgm-info span {
  font-size: 1rem;
}

#bgmOpenLink {
  margin-top: 4px;
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
  color: #2f5f82;
  border: 1px solid #cfe2f1;
  background: #f7fbff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.92rem;
}

.wish-bgm-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.wish-bgm-actions button {
  border: 2px solid #bfd8ec;
  border-radius: 999px;
  background: #ffffff;
  color: #2f5f82;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}

.wish-bgm-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

@media (max-width: 860px) {
  .wish-bgm-card {
    grid-template-columns: 84px 1fr;
    border-radius: 14px;
  }

  #bgmArt {
    width: 84px;
    height: 84px;
    border-radius: 12px;
  }

  .wish-bgm-actions button {
    min-height: 44px;
    font-size: 1rem;
  }
}

/* Money mobile compact layout */
@media (max-width: 560px) {
  .money-shell {
    padding: 10px 8px 16px;
    place-items: start center;
  }

  .money-card {
    border-radius: 16px;
    padding: 10px;
  }

  .money-head {
    margin-bottom: 8px;
  }

  .money-head h1 {
    font-size: 1.65rem;
    line-height: 1;
  }

  .money-head a {
    padding: 5px 9px;
    font-size: 0.9rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  .money-toolbar {
    margin-bottom: 8px;
  }

  .money-toolbar label {
    font-size: 0.9rem;
    gap: 6px;
  }

  .money-toolbar input {
    min-height: 36px;
    padding: 5px 8px;
    font-size: 0.9rem;
  }

  .money-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 8px;
  }

  .money-summary article {
    border-radius: 10px;
    padding: 6px 7px;
  }

  .money-summary small {
    font-size: 0.75rem;
  }

  .money-summary strong {
    margin-top: 2px;
    font-size: 0.94rem;
  }

  .money-chart-section {
    padding: 8px;
    margin-bottom: 8px;
  }

  .money-chart-head {
    margin-bottom: 5px;
    font-size: 0.9rem;
  }

  #moneyPie {
    max-width: 170px;
  }

  .money-legend {
    gap: 4px;
  }

  .money-legend li {
    font-size: 0.82rem;
    gap: 6px;
  }

  .money-category-manage {
    gap: 6px;
    margin-bottom: 8px;
  }

  .money-category-manage input,
  .money-category-manage button {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.9rem;
  }

  .money-form {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
  }

  #entryMemo {
    grid-column: 1 / -1;
  }

  #entryAmount {
    grid-column: 1 / 2;
  }

  .money-form button {
    grid-column: 2 / 3;
  }

  .money-form input,
  .money-form select,
  .money-form button {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 0.9rem;
  }

  .money-table {
    min-width: 560px;
  }

  .money-table th,
  .money-table td {
    padding: 7px 6px;
    font-size: 0.82rem;
  }
}

/* Money mobile no-horizontal-scroll */
@media (max-width: 560px) {
  .money-form {
    grid-template-columns: 1fr;
  }

  #entryAmount,
  .money-form button {
    grid-column: auto;
  }

  .money-table-wrap {
    overflow: visible;
  }

  .money-table {
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .money-table thead {
    display: none;
  }

  .money-table,
  .money-table tbody,
  .money-table tr,
  .money-table td {
    display: block;
    width: 100%;
  }

  .money-table tr {
    border-bottom: 1px solid #d9e9f6;
    padding: 6px 0;
  }

  .money-table td {
    border-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    font-size: 0.84rem;
  }

  .money-table td::before {
    color: #6d92b1;
    font-size: 0.76rem;
  }

  .money-table td:nth-child(1)::before { content: "날짜"; }
  .money-table td:nth-child(2)::before { content: "구분"; }
  .money-table td:nth-child(3)::before { content: "분류"; }
  .money-table td:nth-child(4)::before { content: "내용"; }
  .money-table td:nth-child(5)::before { content: "금액"; }
  .money-table td:nth-child(6)::before { content: ""; }

  .money-del {
    width: 100%;
    margin-top: 2px;
  }
}
