/* 퇴사일 달력. 출처: 은행이 나눠 주는 스프링 탁상달력과 볼펜 동그라미(docs/DESIGN.md) */
:root {
  --desk: #e4e7ea;      /* 사무실 책상 회색 */
  --desk-2: #cfd4d9;
  --paper: #ffffff;
  --ink: #1b1d21;
  --sub: #5c636c;
  --line: #d5d9de;
  --sun: #c8302c;       /* 일요일 빨강 */
  --sat: #2b5bb0;       /* 토요일 파랑 */
  --pen: #d42a1f;       /* 빨간 볼펜 */
  --blue: #1d3b78;      /* 볼펜 파랑, 채움 버튼 하나 */
  --metal: #8f979f;
  --hand: "Nanum Pen Script", "Gaegu", cursive;
  --body: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font: 15px/1.5 var(--body); }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 10px; }
.top h1 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.top p { margin: 0; color: var(--sub); font-size: 14px; }
.hero { position: relative; border-radius: 6px; overflow: hidden; background: var(--desk-2); }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.layout { display: grid; gap: 16px; padding-bottom: 28px; }

/* 입력: 달력 옆 메모지 */
.memo { background: var(--paper); border-radius: 4px; padding: 14px; box-shadow: 0 1px 0 var(--desk-2), 0 6px 18px rgba(30, 35, 40, .08); }
.memo .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.memo label { display: block; font-size: 13px; color: var(--sub); }
.memo input[type=date], .memo input[type=number], .memo select {
  display: block; width: 100%; height: 44px; margin-top: 4px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 16px;
}
.memo .unit { position: relative; }
.memo .unit::after { content: "만 원"; position: absolute; right: 10px; bottom: 11px; color: var(--sub); font-size: 14px; pointer-events: none; }
.memo .unit input { padding-right: 48px; }
.memo .ex { margin: 8px 0 0; font-size: 13px; color: var(--sub); }
.more { margin-top: 10px; background: none; border: 0; padding: 6px 0; color: var(--blue); font-size: 14px; cursor: pointer; min-height: 32px; }
.extra[hidden] { display: none; }
.extra { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.extra .chk { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 18px; color: var(--ink); font-size: 14px; }
.extra .chk input { width: 20px; height: 20px; }

/* 갈림 날짜 목록 */
.next { display: grid; gap: 6px; margin-top: 12px; }
.nx { display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; grid-template-rows: auto auto; align-items: baseline; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.nx b { font-size: 16px; }
.nx span { font-size: 13px; color: var(--sub); }
.nx em { font: 24px/1 var(--hand); color: var(--pen); font-style: normal; grid-row: span 2; align-self: center; }
.nx small { grid-column: 1 / 3; font-size: 12px; color: var(--sub); }
.quiet { color: var(--sub); font-size: 14px; margin: 8px 0 0; }
.live { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: 13px; color: var(--sub); }
.live span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #2f8f5b; animation: blink 2.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* 탁상달력 */
.desk { position: relative; }
.calnav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.calnav span { font-size: 14px; color: var(--sub); }
.calnav button { width: 44px; height: 36px; border: 1px solid var(--desk-2); border-radius: 4px; background: #f5f6f7; cursor: pointer; font-size: 18px; }
.calnav button:disabled { opacity: .35; cursor: default; }
.cal { display: grid; gap: 18px; perspective: 900px; }
.sheet { position: relative; background: var(--paper); border-radius: 3px; padding: 22px 10px 12px; box-shadow: 0 2px 0 #eef0f2, 0 4px 0 var(--desk-2), 0 10px 22px rgba(30, 35, 40, .10); transform-origin: top center; }
.rings { position: absolute; top: -9px; left: 8%; right: 8%; display: flex; justify-content: space-between; pointer-events: none; }
.rings i { width: 8px; height: 20px; border-radius: 4px; background: linear-gradient(90deg, #6f777e, #c6ccd1 45%, #7d858c); }
.sheet h3 { margin: 0 4px 6px; font-size: 18px; letter-spacing: -0.01em; }
.wd, .grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.wd span { text-align: center; font-size: 12px; color: var(--sub); padding: 2px 0 4px; border-bottom: 1px solid var(--line); }
.wd .sun, .c.sun b { color: var(--sun); }
.wd .sat, .c.sat b { color: var(--sat); }
.c { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-height: 52px; padding: 5px 0 3px; background: none; border: 0; border-bottom: 1px solid #f0f1f3; cursor: pointer; }
.c b { font-size: 15px; font-weight: 600; line-height: 1.1; }
.c i { font-style: normal; font-size: 10.5px; color: var(--sub); margin-top: 3px; white-space: nowrap; letter-spacing: -0.03em; }
.c.off { cursor: default; }
.c.off b { opacity: .35; }
.c.pad { border: 0; }
.c.today b { text-decoration: underline 2px; text-underline-offset: 3px; }
.c.sel { background: #eef3fb; outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 3px; }
.c .gain { font: 17px/1 var(--hand); color: var(--pen); margin-top: 2px; }
.ring { position: absolute; inset: 1px 1px 2px; width: calc(100% - 2px); height: calc(100% - 3px); overflow: visible; pointer-events: none; }
.ring path { fill: none; stroke: var(--pen); stroke-width: 2.2; stroke-linecap: round; opacity: .85; }
.cal.draw .ring path { stroke-dasharray: 160; stroke-dashoffset: 160; animation: pen 520ms cubic-bezier(.5, .1, .3, 1) forwards; }
@keyframes pen { to { stroke-dashoffset: 0; } }
.cal.flip .sheet { animation: flip 300ms cubic-bezier(.3, .7, .2, 1); }
.cal.flip .sheet + .sheet { animation-delay: 60ms; }
@keyframes flip { from { transform: rotateX(-14deg); opacity: .4; } to { transform: none; opacity: 1; } }

/* 날짜 자세히 */
.detail { background: var(--paper); border-radius: 4px; padding: 14px; box-shadow: 0 6px 18px rgba(30, 35, 40, .08); }
.detail:empty { display: none; }
.dhead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.dhead h3 { margin: 0; font-size: 18px; }
.dhead span { font-size: 13px; color: var(--sub); }
.hand { margin: 4px 0 0; font: 26px/1.1 var(--hand); color: var(--pen); }
.sum { display: flex; justify-content: space-between; align-items: baseline; margin: 10px 0 6px; padding: 10px 0; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.sum b { font-size: 24px; letter-spacing: -0.02em; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f2; font-size: 14px; }
.row b { font-weight: 600; text-align: right; }
.row.muted b { color: var(--sub); font-weight: 500; }
.facts { margin-top: 8px; padding-top: 4px; }
.facts .row { font-size: 13.5px; }
.tip { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-left: 2px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--sub); font-size: 12px; cursor: help; vertical-align: middle; }
.tipbox { position: absolute; z-index: 20; padding: 10px 12px; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.5; border-radius: 4px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.jump { display: block; width: 100%; margin-top: 12px; height: 46px; border: 0; border-radius: 4px; background: var(--blue); color: #fff; font-size: 15px; cursor: pointer; }
.jump em { font: 22px/1 var(--hand); font-style: normal; margin-left: 6px; color: #ffd9d5; }

/* 아래 칸들 */
.band { background: var(--paper); border-radius: 4px; padding: 18px 16px; margin-bottom: 16px; }
.band h2 { margin: 0 0 10px; font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; color: var(--ink); text-decoration: none; }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--desk-2); }
.card b { display: block; padding: 8px 10px 2px; font-size: 15px; }
.card span { display: block; padding: 0 10px 10px; font-size: 13px; color: var(--sub); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.t th, .t td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.t th:first-child, .t td:first-child { text-align: left; }
.t thead th { font-size: 12.5px; color: var(--sub); font-weight: 600; }
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lead { margin: 0 0 12px; color: var(--sub); font-size: 14px; }
.stat { display: flex; flex-wrap: wrap; gap: 10px; }
.stat div { flex: 1 1 140px; border: 1px solid var(--line); border-radius: 4px; padding: 10px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12.5px; color: var(--sub); }
.shop { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop a { display: block; border: 1px solid var(--line); border-radius: 4px; padding: 8px; color: var(--ink); text-decoration: none; font-size: 13px; }
.shop img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.disclose { font-size: 12px; color: var(--sub); margin: 0 0 8px; }
.crumbs { font-size: 13px; color: var(--sub); margin: 0 0 6px; }
.crumbs a { color: var(--sub); }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a { display: inline-block; padding: 8px 12px; min-height: 36px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 14px; text-decoration: none; }
footer { padding: 18px 0 40px; font-size: 13px; color: var(--sub); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
footer button { border: 1px solid var(--desk-2); background: #f5f6f7; border-radius: 4px; padding: 6px 12px; min-height: 36px; cursor: pointer; }
dialog { border: 0; border-radius: 6px; padding: 18px; width: min(420px, calc(100vw - 32px)); }
dialog textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 4px; padding: 8px; font: inherit; }
dialog .acts { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
dialog .acts button { min-height: 40px; padding: 0 14px; border-radius: 4px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
dialog .acts button[type=submit] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (max-width: 759px) {
  .hero { height: 120px; margin-bottom: 12px; }
  .top { flex-wrap: wrap; gap: 2px 10px; }
}
@media (min-width: 760px) {
  .cal { grid-template-columns: 1fr 1fr; }
  .cards { grid-template-columns: repeat(4, 1fr); }
  .shop { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1000px) {
  .layout { grid-template-columns: 340px 1fr; align-items: start; }
  .side { position: sticky; top: 12px; display: grid; gap: 14px; }
  .hero { height: 190px; }
  .c { min-height: 58px; }
  .c i { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .cal.draw .ring path, .cal.flip .sheet, .live span::before { animation: none; stroke-dashoffset: 0; }
}
.calnav .navr { display: flex; gap: 6px; }
.calnav .snd { width: auto; padding: 0 10px; font-size: 13px; color: var(--sub); }
.calnav .snd[aria-pressed=true] { color: var(--ink); border-color: var(--ink); }
.ring path.again { stroke-dasharray: 160; stroke-dashoffset: 160; animation: pen 1600ms cubic-bezier(.5, .1, .3, 1) forwards !important; animation-delay: 0ms !important; }
@media (prefers-reduced-motion: reduce) { .ring path.again { animation: none !important; stroke-dashoffset: 0; } }
.memo .two { row-gap: 10px; }
.memo select { appearance: auto; }
.msg { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--blue); background: #eef3fb; font-size: 14px; }
.msg[hidden] { display: none; }
.memo input[aria-invalid=true] { border-color: var(--blue); box-shadow: 0 0 0 2px #cfdcf3; }
.sum2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.sum2:empty { display: none; }
.s2 { text-align: left; background: #f6f7f8; border: 1px solid var(--line); border-radius: 4px; padding: 8px 10px; cursor: pointer; }
.s2 span { display: block; font-size: 12.5px; color: var(--sub); }
.s2 b { display: block; font-size: 20px; letter-spacing: -0.02em; }
.nxh { margin: 4px 0 0; font-size: 13px; color: var(--sub); }
.sev { border-bottom: 1px solid #eef0f2; }
.row.moel b { color: var(--blue); }
.row b small { font-weight: 500; color: var(--sub); font-size: 12.5px; }
.row b strong { font-size: 16px; }
.home { margin: 12px 0 0; font-size: 14px; }
footer #snd { color: var(--sub); }
.topband { overflow: hidden; }
.topband .timg { display: block; width: 100%; height: 96px; object-fit: cover; border-radius: 3px; margin-bottom: 10px; }
.fold:not(.open) tbody tr:nth-child(n+5), .fold:not(.open) .tscroll + .lead + .tscroll, .fold:not(.open) .lead { display: none; }
.unfold { margin-top: 8px; background: none; border: 1px solid var(--line); border-radius: 4px; padding: 6px 12px; min-height: 36px; color: var(--blue); cursor: pointer; font-size: 14px; }
@media (min-width: 760px) { .topband .timg { float: right; width: 240px; height: 120px; margin: 0 0 8px 16px; } }
/* 가만히 있어도 다음 갈림 금액 밑에 볼펜 밑줄이 그려졌다 사라진다(빈 시간에도 살아 있는 화면, D4) */
.nx:first-of-type em { position: relative; }
.nx:first-of-type em::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px; border-radius: 2px; background: var(--pen); opacity: .85; transform-origin: left; transform: scaleX(.25); animation: underline 2.6s ease-in-out infinite alternate; }
@keyframes underline { from { transform: scaleX(.25); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .nx:first-of-type em::after { animation: none; } }
.row b small { display: block; white-space: nowrap; }
.hero img { object-position: 35% 100%; }
.cend { display: block; margin-top: 10px; font-size: 13px; color: var(--sub); }
.cend[hidden] { display: none; }
.extra .wide { grid-column: 1 / -1; }
.note { margin: 6px 0 8px; padding: 8px 10px; background: #f6f7f8; border-radius: 4px; font-size: 13px; color: var(--sub); }
.swipe { margin: 0 0 6px; font-size: 12.5px; color: var(--sub); }
.tscroll.more { background: linear-gradient(to left, rgba(29, 59, 120, .10), transparent 28px) right / 28px 100% no-repeat; }
