:root {
  color-scheme: light;
  --desk: #f4efe7;
  --paper: #fffcf4;
  --ink: #302c25;
  --muted: #665d50;
  --line: #ddd2be;
  --rust: #913e29;
  --green: #343f31;
  --display: "KoPub Batang", "Batang", "AppleMyungjo", Georgia, serif;
  font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 22%, #faf6ee, transparent 75%), var(--desk);
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--rust); outline-offset: 3px; }
.masthead {
  max-width: 1160px; padding: 23px 28px; margin: auto;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid #dfd5c4;
}
.wordmark { color: var(--ink); text-decoration: none; font: bold 1.24rem var(--display); }
.wordmark span { color: var(--rust); margin-right: .35em; }
.today-link, .primary {
  border: 0; border-radius: 6px; background: var(--green); color: #fffaf0;
  padding: 8px 15px; font-size: .9rem;
}
.desk { width: min(1010px, calc(100% - 48px)); margin: 34px auto 25px; }
.tabs { display: flex; gap: 5px; padding-left: 22px; }
.tabs button {
  border: 1px solid #dcd0ba; border-bottom: 0; border-radius: 8px 8px 0 0;
  background: #ebe0cb; color: #4b4336; padding: 8px 16px; min-height: 42px;
  font-size: .88rem; white-space: nowrap;
}
.tabs button[aria-current="page"] { background: var(--green); border-color: var(--green); color: #fff9e8; }
.book {
  position: relative; min-width: 0; border-radius: 9px;
  background: #555a43; padding: 5px 6px 8px 5px;
  box-shadow: 0 13px 30px #3c2a1724, 0 3px 5px #3c2a1728;
}
.spread {
  min-height: 545px; border-radius: 5px; overflow: hidden;
  background: var(--paper);
}
.spread.is-turning {
  animation: turn .28s ease-out;
  transform-origin: left center;
}
@keyframes turn { from { opacity: .72; transform: perspective(1200px) rotateY(-2.5deg); } to { opacity: 1; transform: none; } }
.cover-spread { display: grid; grid-template-columns: .9fr 1.1fr; }
.cover {
  min-height: 100%; position: relative; display: grid; place-items: center; text-align: center;
  color: #f8ebc9; padding: 24px;
  background: repeating-linear-gradient(90deg, #ffffff03 0 1px, #00000004 1px 3px),
    repeating-linear-gradient(0deg, #ffffff04 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 45% 30%, #576047, #343f31 85%);
}
.cover::before, .cover::after { content: ""; position: absolute; pointer-events: none; }
.cover::before { inset: 19px; border: 1px solid #d6bd806b; border-radius: 3px; }
.cover::after { inset: 24px; border: 1px solid #d6bd803d; border-radius: 3px; }
.cover-inner { padding: 22px 0; }
.cover-mark { color: #dfc789; font: 3.6rem/1 var(--display); margin-bottom: 19px; display: block; }
.cover h1 { font: 700 clamp(3.4rem, 7vw, 5.5rem)/1.13 var(--display); letter-spacing: -.08em; margin: 0 0 14px; }
.cover p { color: #f0dfb2; margin: 0; }
.cover-year { display: inline-block; margin-top: 26px; padding-top: 12px; border-top: 1px solid #d6bd806b; font: 1.3rem Georgia, serif; letter-spacing: .18em; }
.dashboard, .paper { padding: clamp(25px, 5.3vw, 66px); min-width: 0; }
.dashboard { background: linear-gradient(90deg, #d5c5a655, transparent 19px), var(--paper); }
.paper { background: linear-gradient(90deg, #d5c5a677, transparent 22px), var(--paper); }
.eyebrow { color: var(--rust); font-weight: 700; font-size: .84rem; margin: 0 0 8px; }
h2, h3 { font-family: var(--display); }
h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.55rem); line-height: 1.22; }
h3 { margin: 0 0 12px; font-size: 1.26rem; }
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rule { border: 0; border-top: 1px solid var(--line); margin: 22px 0 20px; }
.muted { color: var(--muted); }
.empty { color: var(--muted); margin: 0; padding: 12px 0; font-size: .94rem; }
.task-list { list-style: none; padding: 0; margin: 4px 0 14px; }
.task-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 0; min-height: 46px;
  border-bottom: 1px solid #ece3d2;
}
.task-row input { width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.task-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.tag { border-radius: 20px; padding: 2px 8px; font-size: .78rem; white-space: nowrap; }
.tag.normal { background: #e9eadb; color: #3a4733; }
.tag.star { background: #f4e5b9; color: #664516; }
.tag.bolt { background: #f3ddd3; color: #853925; }
.text-button, .icon-button { background: transparent; color: var(--rust); border: 0; padding: 4px 5px; }
.text-button { text-decoration: underline; text-underline-offset: 4px; }
.icon-button { min-width: 38px; min-height: 40px; }
.dashboard .primary { margin-top: 18px; }
.task-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 7px; }
.task-form input, select, input[type="date"] { min-width: 0; padding: 7px 8px; background: #fffdf8; border: 1px solid #cfc2ae; border-radius: 5px; }
.task-form .primary { white-space: nowrap; }
.writing { margin-top: 24px; }
.writing label { display: block; font: bold 1.3rem var(--display); margin-bottom: 7px; }
.writing-area {
  display: block; width: 100%; border: 0; border-radius: 0; resize: vertical;
  line-height: 36px; padding: 0 5px; min-height: 144px;
  background: repeating-linear-gradient(transparent 0 35px, var(--line) 35px 36px);
}
.writing-area.diary { min-height: 290px; }
.month-controls { display: flex; align-items: center; gap: 4px; }
.month-controls .icon-button { border: 1px solid var(--line); border-radius: 5px; font-size: 1.35rem; line-height: 1; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.weekday { text-align: center; padding: 8px 0; font-size: .87rem; color: var(--muted); }
.day, .blank { min-height: 54px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; padding: 7px 8px; }
.day:hover { background: #efe6d3; }
.day[aria-current="date"] { background: #e6eadb; font-weight: 700; color: #34412e; }
.day span { display: block; color: var(--rust); font-size: .8rem; line-height: 1; }
.date-picker { font-size: .9rem; }
.date-form { display: flex; gap: 7px; align-items: center; }
.line-entries { margin-top: 18px; }
.line-entry { display: grid; grid-template-columns: 65px 1fr; gap: 10px; align-items: start; border-bottom: 1px solid var(--line); padding: 11px 0; }
.line-entry label, .line-year { font: 1.08rem/1.8 Georgia, serif; color: var(--rust); }
.line-entry textarea { width: 100%; min-height: 36px; padding: 3px 5px; background: transparent; border: 0; resize: vertical; }
.folio { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 12px; gap: 8px; }
.folio button { justify-self: start; border: 0; padding: 4px 6px; background: transparent; min-height: 40px; font-size: .9rem; }
.folio button:last-child { justify-self: end; }
.folio button:disabled { opacity: .42; cursor: default; }
.folio button span { font: 1.6rem/1 Georgia, serif; vertical-align: -2px; padding: 0 4px; }
#page-name, .storage { color: var(--muted); font-size: .84rem; text-align: center; }
.storage { margin: 6px 0 0; }
.storage.error { color: var(--rust); font-weight: 700; }
@media (max-width: 660px) {
  .masthead { padding: 14px 17px; }
  .desk { width: calc(100% - 22px); margin-top: 19px; }
  .tabs { padding-left: 7px; }
  .tabs button { padding-inline: 10px; }
  .spread { min-height: 460px; }
  .cover-spread { grid-template-columns: 1fr; }
  .cover { min-height: 232px; }
  .cover-mark { font-size: 2.1rem; margin-bottom: 9px; }
  .cover h1 { font-size: 3.15rem; margin-bottom: 6px; }
  .cover-year { margin-top: 13px; padding-top: 6px; font-size: 1rem; }
  .dashboard, .paper { padding: 23px 17px; }
  .day, .blank { padding-inline: 4px; min-height: 48px; }
  .section-top { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .spread.is-turning { animation: none; } }
