@font-face { font-family: "Hyemin"; src: url("/fonts/IM_Hyemin-Bold.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Glasses"; src: url("/fonts/BaGlasses.woff2") format("woff2"); font-display: swap; }

:root {
  --desk: #E9E5DC;
  --paper: #FBF8F1;
  --paper-2: #F4EFE4;
  --ink: #3B3A36;
  --muted: #6F6B63;
  --hint: #A8A193;
  --line: #B9B2A4;
  --line-2: #D6D0C4;
  --line-3: #E3DED3;
  --accent: #3E5C4A;
  --red: #B0463C;
  --fade: #BDB7AA;
  --head: "Hyemin", "Apple SD Gothic Neo", sans-serif;
  --body: "Glasses", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--desk); color: var(--ink); font-family: var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.head { font-family: var(--head); }
.muted { color: var(--muted); }
.icon-btn { all: unset; cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 22px; color: var(--ink); }
.icon-btn:hover { background: rgba(62, 92, 74, 0.07); }
.icon-btn:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 책상과 펼친 책 (PC) ── */
.desk { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 48px 48px 32px; }
.book-wrap { position: relative; }
.book { position: absolute; top: 0; left: 0; width: 1200px; height: 800px; transform-origin: top left; border-radius: 4px;
  box-shadow: 0 18px 40px rgba(60, 55, 40, 0.18), 0 1px 0 rgba(0, 0, 0, 0.06); }
.spread { display: flex; width: 1200px; height: 800px; }
.page { width: 600px; height: 800px; background: var(--paper); position: relative; }
.page.left { border-radius: 4px 0 0 4px; box-shadow: inset -16px 0 20px -16px rgba(0, 0, 0, 0.2); }
.page.right { border-radius: 0 4px 4px 0; box-shadow: inset 16px 0 20px -16px rgba(0, 0, 0, 0.2); }
.to-cover { position: absolute; left: 0; top: -38px; font-size: 13px; color: var(--muted); text-decoration: none; padding: 6px 0; }

/* 오른쪽 인덱스 탭 */
.tabs { position: absolute; right: -34px; top: 60px; display: flex; flex-direction: column; gap: 6px; }
.tabs a { width: 34px; min-height: 64px; padding: 8px 0; border-radius: 0 6px 6px 0; background: #DCD5C6; color: var(--ink);
  text-decoration: none; font-size: 13px; writing-mode: vertical-rl; display: flex; align-items: center; justify-content: center; }
.tabs a[aria-current="page"] { background: var(--accent); color: var(--paper); }
.tabs a:hover:not([aria-current]) { background: #D3CBBA; }

/* ── 한 면 보기 (좁은 창·iPhone) ── */
.phone { min-height: 100vh; min-height: 100dvh; background: var(--paper); display: flex; flex-direction: column; max-width: 640px; margin: 0 auto; }
.single { flex: 1; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
.bottombar { position: sticky; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-2);
  background: #F6F2E8; padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.bottombar a { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--muted); font-size: 12px; }
.bottombar a[aria-current="page"] { color: var(--accent); }
.bottombar svg { width: 20px; height: 20px; }

/* ── 표지 ── */
.cover-desk { align-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.cover { position: relative; width: min(520px, 88vw, calc((100dvh - 48px) * 520 / 760)); aspect-ratio: 520 / 760; background: var(--accent); border-radius: 6px 14px 14px 6px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08), 0 18px 40px rgba(40, 50, 40, 0.22), inset 10px 0 0 rgba(0, 0, 0, 0.1); overflow: hidden; }
.cover .year { position: absolute; top: 7.4%; right: 10.8%; display: flex; flex-direction: column; align-items: flex-end;
  font-family: var(--head); font-size: clamp(40px, 12vw, 64px); line-height: 0.95; letter-spacing: 2px; color: rgba(255, 255, 255, 0.2); }
.cover .band { position: absolute; left: 0; right: 0; top: 56.6%; height: 26.3%; background: #F6F2E8; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; }
.cover .band .y { font-family: var(--head); font-size: 22px; letter-spacing: 3px; }
.cover .band .rule { width: 120px; height: 1px; background: var(--line); }
.cover .band .t { font-family: var(--head); font-size: clamp(30px, 8vw, 40px); letter-spacing: 2px; color: var(--accent); }
.cover .band .s { font-size: 14px; letter-spacing: 1px; color: var(--muted); }
.cover .open { position: absolute; left: 50%; bottom: 5.8%; transform: translateX(-50%); min-height: 44px; padding: 0 24px; display: flex;
  align-items: center; border: 1px solid rgba(255, 255, 255, 0.45); border-radius: 22px; color: #F6F2E8; text-decoration: none; font-size: 16px; }
.cover .open:hover { background: rgba(255, 255, 255, 0.08); }

/* ── 월간 (PC) ── */
.m-left { display: flex; padding: 36px 0 36px 36px; height: 100%; }
.m-side { width: 150px; padding-right: 16px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; justify-content: space-between; }
.m-side .yr { font-family: var(--head); font-size: 16px; color: var(--muted); }
.m-side .num { font-family: var(--head); font-size: 76px; line-height: 1; }
.m-side .en { font-family: var(--head); font-size: 13px; letter-spacing: 2px; color: var(--accent); }
.m-side .nav { display: flex; margin: 10px 0 0 -12px; }
.mini { display: flex; flex-direction: column; gap: 4px; }
.mini + .mini { margin-top: 22px; }
.mini .mh { display: flex; justify-content: space-between; align-items: baseline; }
.mini .mh b { font-family: var(--head); font-weight: normal; font-size: 15px; }
.mini .mh span { font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.mini .g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 2px; font-size: 10px; text-align: center; }
.mgrid { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.m-right { position: relative; padding: 36px 36px 36px 0; height: 100%; display: flex; flex-direction: column; }
.mhead { height: 40px; display: grid; align-items: center; border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: 1px; color: var(--muted); }
.mhead span { padding-left: 10px; }
.mrow { flex: 1; display: grid; border-bottom: 1px solid var(--line-2); min-height: 0; }
.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mcell { all: unset; cursor: pointer; border-left: 1px solid var(--line-3); padding: 8px 8px 6px 10px; display: flex; flex-direction: column; gap: 5px;
  min-width: 0; overflow: hidden; }
.mcell:hover { background: rgba(62, 92, 74, 0.04); }
.mcell .top { display: flex; gap: 6px; align-items: baseline; }
.mcell .n { font-family: var(--head); font-size: 17px; }
.mcell.today .n { color: var(--paper) !important; background: var(--accent); border-radius: 12px; padding: 0 7px; }
.mcell .hol { font-size: 11px; color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .ev { display: flex; gap: 5px; align-items: center; font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcell .ev::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.mcell .more { font-size: 11px; color: var(--muted); }
.legend { position: absolute; right: 36px; bottom: 12px; display: flex; justify-content: flex-end; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); }
.legend::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* ── 월간 (한 면) ── */
.sm-head { padding: 20px 16px 12px; display: flex; align-items: flex-end; justify-content: space-between; }
.sm-head .num { font-family: var(--head); font-size: 56px; line-height: 0.9; }
.sm-head .sub { display: flex; flex-direction: column; gap: 2px; padding-bottom: 2px; }
.sm-grid { padding: 0 12px; }
.sm-dow, .sm-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.sm-dow { height: 30px; align-items: center; text-align: center; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); }
.sm-week { border-bottom: 1px solid var(--line-3); }
.sm-day { all: unset; cursor: pointer; height: 58px; display: flex; flex-direction: column; align-items: center; gap: 5px; padding-top: 7px; }
.sm-day .n { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 17px; }
.sm-day.sel .n { background: var(--accent); color: var(--paper) !important; }
.sm-day.today:not(.sel) .n { box-shadow: inset 0 0 0 1.5px var(--accent); }
.sm-day .dots { display: flex; gap: 3px; height: 6px; }
.sm-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.sm-day .dots i.h { background: var(--red); }
.sm-panel { margin: 16px; padding: 16px; background: var(--paper-2); border-radius: 10px; display: flex; flex-direction: column; gap: 10px; }
.sm-panel .ph { display: flex; align-items: baseline; gap: 8px; }
.sm-panel .ph b { font-family: var(--head); font-weight: normal; font-size: 22px; }
.sm-panel .ev { display: flex; gap: 10px; align-items: center; font-size: 16px; min-height: 28px; }
.sm-panel .ev::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* ── 준비 중 화면 ── */
.soon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; height: 100%; padding: 40px; text-align: center; }
.soon .head { font-size: 30px; }
.more-list { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.more-list a { min-height: 64px; padding: 0 18px; display: flex; align-items: center; border-radius: 12px; background: var(--paper-2);
  color: var(--ink); text-decoration: none; font-family: var(--head); font-size: 20px; }

.notice { font-size: 11px; color: var(--muted); }
