/* 딴짓 · 디데이 계산기 — 책상 위 탁상 일력: 크림 종이, 검은 스프링, 빨간 큰 숫자, 넘어가는 낱장 */
:root {
  --desk: #3b4a3f; --paper: #fbf6ea; --paper-2: #efe6d2; --ink: #23201c; --red: #d8352a; --blue: #2f5fb8; --dim: #6c6150;
  --num: 'Do Hyeon', 'Pretendard Variable', sans-serif;
  --serif: 'Gowun Batang', serif;
  --ui: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; min-height: 100svh; color: var(--paper); font: 500 16px/1.55 var(--ui); overflow-x: clip;
  background: radial-gradient(ellipse at 50% 20%, #4d5f51, var(--desk) 70%) fixed var(--desk); }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #ffd35a; outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; max-width: 980px; margin: 0 auto; }
.logo { font: 400 21px/1 var(--num); color: var(--ink); background: var(--paper); padding: 9px 12px 7px; border-radius: 6px; text-decoration: none; }
.today { font-size: 14px; font-weight: 700; opacity: .8; }
.stage { max-width: 980px; margin: 0 auto; padding: 0 16px 28px; display: grid; gap: 18px; }

/* 일력 */
.pad { position: relative; width: min(100%, 420px); margin: 10px auto 0; perspective: 900px; }
.rings { position: absolute; top: -12px; left: 0; right: 0; display: flex; justify-content: space-evenly; z-index: 3; }
.rings i { width: 12px; height: 30px; border-radius: 7px; background: linear-gradient(90deg, #111, #555 45%, #111); box-shadow: 0 2px 2px rgba(0,0,0,.4); }
.sheet, .under { background: var(--paper); color: var(--ink); border-radius: 6px 6px 10px 10px; }
.sheet { position: relative; z-index: 2; padding: 34px 18px 22px; text-align: center; min-height: 320px; display: flex; flex-direction: column; justify-content: center;
  border-top: 26px solid var(--red); box-shadow: 0 2px 0 var(--paper-2), 0 4px 0 #e2d7bf, 0 6px 0 #d8ccb2, 0 16px 30px rgba(0,0,0,.35); transform-origin: 50% 0; }
.under { position: absolute; inset: 26px 0 0; z-index: 1; background: var(--paper-2); }
.sheet.flip { animation: flip .16s ease-in; }
@keyframes flip { 50% { transform: rotateX(-70deg); opacity: .4; } }
.ttl { margin: 0; font: 700 clamp(18px, 5.4vw, 24px)/1.3 var(--serif); color: var(--dim); word-break: keep-all; min-height: 1.3em; }
.big { margin: 4px 0 2px; font: 400 clamp(84px, 27vw, 138px)/1 var(--num); color: var(--red); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.big.plus { color: var(--blue); }
.date { margin: 6px 0 0; font: 700 clamp(17px, 4.8vw, 21px)/1.3 var(--serif); }
.sub { margin: 6px 0 0; font-size: 14px; color: var(--dim); word-break: keep-all; }

/* 입력 */
.form { width: min(100%, 520px); margin: 0 auto; background: rgba(0,0,0,.18); border-radius: 14px; padding: 14px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mode button { appearance: none; min-height: 46px; border: 2px solid var(--paper); border-radius: 10px; background: transparent; font-weight: 800; cursor: pointer; }
.mode [aria-checked="true"] { background: var(--paper); color: var(--ink); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 10px; }
@media (max-width: 380px) { .row { grid-template-columns: minmax(0, 1fr); } }
.fld { display: grid; gap: 4px; font-weight: 700; font-size: 13px; opacity: .95; min-width: 0; }
.fld input { width: 100%; min-width: 0; min-height: 48px; border: 0; border-radius: 10px; background: var(--paper); color: var(--ink); padding: 0 10px; font-size: 16px; }
.chk { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.chk input { width: 20px; height: 20px; accent-color: #ffd35a; }
.chk small { opacity: .75; font-weight: 500; }
.chk[hidden] { display: none; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.quick button { appearance: none; min-height: 40px; padding: 0 12px; border: 1.5px dashed rgba(251,246,234,.7); border-radius: 999px; background: transparent; font-weight: 700; font-size: 14px; cursor: pointer; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btn { appearance: none; min-height: 50px; border: 2px solid var(--paper); border-radius: 12px; background: transparent; font-weight: 800; font-size: 15px; cursor: pointer; }
.btn.main { background: #ffd35a; border-color: #ffd35a; color: var(--ink); }

/* 기념일 */
.miles { width: min(100%, 520px); margin: 0 auto; }
.miles h2 { margin: 6px 0 8px; font: 400 26px/1.2 var(--num); }
.miles ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.miles li { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; background: var(--paper); color: var(--ink); border-radius: 8px; padding: 10px 12px; }
.miles li b { font: 400 22px/1 var(--num); color: var(--red); }
.miles li span { font-weight: 700; }
.miles li em { font-style: normal; color: var(--dim); font-size: 14px; white-space: nowrap; }
.miles li.past { opacity: .55; } .miles li.past span { text-decoration: line-through; }
.miles li.next { outline: 3px solid #ffd35a; }
.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; margin: 0; padding: 12px 16px; background: var(--paper); color: var(--ink); border-radius: 10px; font-weight: 700; width: max-content; max-width: calc(100vw - 32px); text-align: center; }
.toast[hidden] { display: none; }

.guide { background: var(--paper); color: var(--ink); margin-top: 20px; }
.guide-in { max-width: 760px; margin: 0 auto; padding: 30px 20px 44px; content-visibility: auto; contain-intrinsic-size: auto 1600px; }
.guide h2 { font: 400 25px/1.3 var(--num); margin: 30px 0 10px; word-break: keep-all; }
.guide section:first-of-type h2 { margin-top: 6px; }
.guide p, .guide li, .guide dd, .guide td { word-break: keep-all; }
.steps { padding-left: 1.3em; } .steps li { margin: 6px 0; } .steps b { margin-right: 4px; }
.guide table { width: 100%; border-collapse: collapse; font-size: 15px; }
.guide th, .guide td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #e3d8c2; vertical-align: top; }
.faq dl { margin: 0; } .faq dt { font-weight: 800; margin-top: 16px; } .faq dd { margin: 4px 0 0; color: #4a4236; }
.more ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.more a { display: block; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 8px; color: var(--ink); text-decoration: none; }
.more a b { margin-right: 6px; }
.site-foot { margin-top: 30px; font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.site-foot a { color: var(--dim); display: inline-block; padding: 10px 0; }
@media (min-width: 900px) {
  .stage { grid-template-columns: 420px minmax(0, 1fr); align-items: start; column-gap: 40px; }
  .pad { grid-row: 1 / 3; position: sticky; top: 30px; }
  .form, .miles { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .sheet.flip { animation: none; } }
