/* ==========================================================
 * 커플 연표(chronicle_up) - 연·월 가로 연표
 * ========================================================== */
.chr-board {
    --chr-line: color-mix(in srgb, var(--content-font-color, #4a3f30) 35%, transparent);
    --chr-card-bg: var(--card-bg-color, rgba(255, 255, 255, 0.92));
    --chr-card-border: var(--card-border-color, rgba(0, 0, 0, 0.08));
    --chr-radius: var(--card-border-radius, 10px);
    --chr-empty-w: 30px;       /* 사건 없는 달 너비 */
    --chr-ev-w: 150px;         /* 사건 있는 달 너비 */
    --chr-card-w: 230px;       /* 사건 카드 너비 */
    --chr-half: 310px;         /* 연표 선 위/아래 공간 */
    --chr-lane: 40px;          /* 맨 위 시기 이름표 줄 */
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    color: var(--content-font-color);
    font-family: var(--content-font-family);
}

/* 위쪽 줄: 구분 + 연표 바꾸기 + 버튼 */
.chr-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.chr-top .chr-cate { margin: 0; }
.chr-top-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chr-top .chr-btns { margin: 0; }
.chr-btns button.btn { cursor: pointer; }

.chr-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 2px solid var(--chr-c, var(--accent-color));
    border-radius: 999px;
    background: var(--chr-card-bg);
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform var(--motion-duration-fast, .15s) ease, box-shadow var(--motion-duration-fast, .15s) ease;
}
.chr-switch:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(0, 0, 0, 0.14); }
.chr-switch:active { transform: scale(0.97); }
.chr-switch-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--chr-c, var(--accent-color)); }
.chr-switch .fa { opacity: 0.6; font-size: 0.9em; }

.chr-empty,
.chr-note {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted, #888);
    background: var(--chr-card-bg);
    border: 1px solid var(--chr-card-border);
    border-radius: var(--chr-radius);
}
.chr-note { padding: 10px 14px; margin-top: 10px; font-size: 0.85em; }

/* 연표 틀 */
.chr-frame { position: relative; }
.chr-frame[hidden] { display: none; }
.chr-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    cursor: grab;
    scrollbar-width: none;          /* 가로 스크롤바 숨김 (휠·끌기·좌우 버튼으로 넘김) */
    -ms-overflow-style: none;
    -webkit-user-select: none;
    user-select: none;
}
.chr-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }
.chr-scroll.is-dragging { cursor: grabbing; }
.chr-scroll.is-dragging .chr-card,
.chr-scroll.is-dragging .chr-add { pointer-events: none; }
.chr-scroll:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 2px; }
.chr-scroll img { -webkit-user-drag: none; }

.chr-track {
    position: relative;
    display: flex;
    width: max-content;
    min-width: 100%;
    height: calc(var(--chr-half) * 2 + var(--chr-lane));
    padding: var(--chr-lane) calc(var(--chr-card-w) / 2 + 20px) 0 20px;
    box-sizing: border-box;
}
/* 가운데 가로선 */
.chr-track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--chr-lane) + var(--chr-half));
    height: 2px;
    margin-top: -1px;
    background: var(--chr-line);
}

/* 한 해 */
.chr-year { position: relative; display: flex; flex: none; height: 100%; }
.chr-year-head {
    position: relative;
    flex: none;
    height: 100%;
    padding: 0 12px;
    z-index: 2;
}
.chr-year-head.in-era::after {
    /* 시기 구간이 해를 넘어갈 때 띠가 끊기지 않게 */
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--chr-half) - 4px);
    height: 8px;
    background: var(--chr-era);
    opacity: 0.85;
    z-index: -1;
}
.chr-year-head::before {
    /* 해가 바뀌는 곳 세로 눈금 */
    content: "";
    position: absolute;
    left: 50%;
    top: calc(var(--chr-half) - 34px);
    height: 68px;
    border-left: 2px dashed var(--chr-line);
    opacity: 0.6;
}
.chr-year-pill {
    position: relative;
    top: var(--chr-half);
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 62px;
    margin: 0;
    padding: 5px 12px;
    border-radius: 12px;
    background: var(--chr-card-bg);
    border: 2px solid var(--chr-line);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    color: inherit;
    font: inherit;
    line-height: 1.2;
    white-space: nowrap;
}
button.chr-year-pill { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
button.chr-year-pill:hover,
button.chr-year-pill.is-active { box-shadow: 0 0 0 3px color-mix(in srgb, var(--chr-line) 30%, transparent), 0 4px 12px rgba(0, 0, 0, 0.14); }
.chr-year-add {
    position: absolute;
    right: -8px;
    top: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--chr-line);
    color: #fff;
    font-style: normal;
    font-weight: 700;
    font-size: 13px;
    line-height: 18px;
    text-align: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity .15s ease, transform .15s ease;
}
button.chr-year-pill:hover .chr-year-add,
button.chr-year-pill:focus-visible .chr-year-add,
button.chr-year-pill.is-active .chr-year-add { opacity: 1; transform: none; }
.chr-year-pill strong { font-family: var(--title-font-family, inherit); font-size: 1.05em; }
.chr-year-pill span { font-size: 0.72em; opacity: 0.75; }

/* 한 달 */
.chr-m {
    position: relative;
    flex: none;
    width: var(--chr-empty-w);
    height: 100%;
}
.chr-m.has-ev { width: var(--chr-ev-w); }
.chr-m.is-mark { width: 120px; }
/* 시기 구간 색 띠 */
.chr-m.in-era::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(var(--chr-half) - 4px);
    height: 8px;
    background: var(--chr-era);
    opacity: 0.85;
}
.chr-tick {
    position: absolute;
    left: 50%;
    top: calc(var(--chr-half) - 5px);
    height: 10px;
    border-left: 1px solid var(--chr-line);
}
.chr-mnum {
    position: absolute;
    left: 50%;
    top: calc(var(--chr-half) + 9px);
    transform: translateX(-50%);
    font-size: 0.68em;
    opacity: 0.55;
}
/* 빈 달 클릭 → 그 달에 추가 */
.chr-add {
    position: absolute;
    left: 2px;
    right: 2px;
    top: calc(var(--chr-half) - 34px);
    height: 68px;
    border-radius: 8px;
    z-index: 1;
}
.chr-add::after {
    content: "+";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-radius: 50%;
    background: var(--accent-color, #c9a24b);
    color: #fff;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
    opacity: 0;
    transform: scale(0.6);
    transition: opacity .15s ease, transform .15s ease;
}
.chr-add:hover { background: color-mix(in srgb, var(--accent-color, #c9a24b) 14%, transparent); }
.chr-add:hover::after,
.chr-add:focus-visible::after { opacity: 1; transform: none; }

/* 탄생 표시 */
.chr-birth {
    position: absolute;
    left: 50%;
    top: calc(var(--chr-half) + 26px);
    transform: translateX(-50%);
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--chr-c) 30%, var(--chr-card-bg));
    border: 1px solid var(--chr-c);
    font-size: 0.75em;
    font-weight: 700;
    white-space: nowrap;
    z-index: 2;
}
.chr-birth { margin-top: calc(var(--chr-i, 0) * 26px); }
.chr-m.is-birth.has-ev.is-down .chr-birth { top: auto; bottom: calc(100% - var(--chr-half) + 34px); }

/* 시기 이름표 (맨 위 줄) */
.chr-era-tag {
    position: absolute;
    left: 0;
    top: calc(var(--chr-lane) * -1 + 4px);
    display: flex;
    align-items: baseline;
    gap: 6px;
    max-width: 260px;
    padding: 4px 12px;
    border: 2px solid var(--chr-era);
    border-left-width: 6px;
    border-radius: 6px;
    background: var(--chr-card-bg);
    color: inherit;
    font: inherit;
    white-space: nowrap;
    cursor: pointer;
    z-index: 3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.chr-era-tag::after {
    /* 이름표에서 연표 선까지 점선 */
    content: "";
    position: absolute;
    left: -6px;
    top: 100%;
    height: calc(var(--chr-half) - var(--chr-lane) + 36px);
    border-left: 2px dashed var(--chr-era);
    opacity: 0.6;
    pointer-events: none;
}
.chr-era-tag strong { font-family: var(--title-font-family, inherit); overflow: hidden; text-overflow: ellipsis; }
.chr-era-tag span { font-size: 0.75em; opacity: 0.7; }
.chr-era-tag:hover,
.chr-era-tag.is-active { background: color-mix(in srgb, var(--chr-era) 30%, var(--chr-card-bg)); }

/* 사건 있는 달 */
.chr-dot {
    position: absolute;
    left: 50%;
    top: var(--chr-half);
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--chr-c);
    box-shadow: 0 0 0 3px var(--chr-card-bg), 0 1px 4px rgba(0, 0, 0, 0.25);
    z-index: 2;
}
.chr-m.has-ev::after {
    /* 점에서 카드까지 잇는 선 */
    content: "";
    position: absolute;
    left: 50%;
    height: 26px;
    border-left: 2px solid var(--chr-c);
    opacity: 0.7;
}
.chr-m.is-up::after { top: calc(var(--chr-half) - 26px); }
.chr-m.is-down::after { top: var(--chr-half); }
.chr-ev-date {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.8em;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    background: color-mix(in srgb, var(--chr-c) 25%, var(--chr-card-bg));
    z-index: 2;
}
.chr-m.is-up .chr-ev-date { top: calc(var(--chr-half) + 14px); }
.chr-m.is-down .chr-ev-date { top: calc(var(--chr-half) - 36px); }

/* 카드 묶음: 중요 사건 카드와 간단한 정보 카드를 따로 떨어뜨려 쌓음 */
.chr-stack {
    position: absolute;
    left: 50%;
    width: var(--chr-card-w);
    margin-left: calc(var(--chr-card-w) / -2);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1;
}
.chr-stack.is-note-only { --chr-card-w: 190px; }
.chr-m.is-up .chr-stack { bottom: calc(100% - var(--chr-half) + 26px); }
.chr-m.is-down .chr-stack { top: calc(var(--chr-half) + 26px); }
.chr-stack:hover { z-index: 4; }
.chr-stack:has(.is-active) { z-index: 5; }

/* 카드 */
.chr-card {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 1px solid var(--chr-card-border);
    border-top: 4px solid var(--chr-c);
    border-radius: var(--chr-radius);
    background: var(--chr-card-bg);
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: transform var(--motion-duration-fast, .15s) ease, box-shadow var(--motion-duration-fast, .15s) ease;
    z-index: 1;
}
.chr-card:hover { box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16); z-index: 4; }
.chr-m.is-up .chr-card:hover { transform: translateY(-3px); }
.chr-m.is-down .chr-card:hover { transform: translateY(3px); }
.chr-card.is-active { z-index: 5; box-shadow: 0 0 0 2px var(--chr-c), 0 8px 22px rgba(0, 0, 0, 0.18); }
.chr-card:focus-visible { outline: 2px solid var(--chr-c); outline-offset: 2px; }
.chr-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 23 / 13;
    overflow: hidden;
    background: color-mix(in srgb, var(--chr-c) 15%, transparent);
}
.chr-card-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.chr-card-body { display: flex; flex-direction: column; gap: 4px; padding: 9px 12px 11px; }
.chr-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 0.74em; }
.chr-card-tit {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: var(--title-font-family, inherit);
    font-weight: 600;
    line-height: 1.35;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.chr-card.is-multi .chr-card-tit { -webkit-line-clamp: 1; font-size: 0.93em; }
.chr-card.is-multi .chr-card-tit::before { content: "· "; opacity: 0.6; }
.chr-card-more { font-size: 0.78em; opacity: 0.65; }
.chr-tag,
.chr-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--chr-c, var(--accent-color));
    color: #fff;
    font-size: 0.92em;
    font-weight: 700;
    line-height: 1.5;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}
.chr-tag-era { background: var(--content-font-color); }

/* 좌우 버튼 */
.chr-nav {
    position: absolute;
    top: calc(var(--chr-lane) + var(--chr-half));
    z-index: 6;
    width: 38px;
    height: 38px;
    margin-top: -19px;
    border: 1px solid var(--chr-card-border);
    border-radius: 50%;
    background: var(--chr-card-bg);
    color: var(--content-font-color);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: opacity .2s ease;
}
.chr-nav-prev { left: 4px; }
.chr-nav-next { right: 4px; }
.chr-nav:disabled { opacity: 0; pointer-events: none; }

/* 펼친 본문 */
.chr-detail {
    position: relative;
    margin-top: 14px;
    animation: chr-open .22s ease;
}
/* 펼친 내용: 중요 사건 / 간단한 정보 / 추가 칸을 각각 따로 떨어진 상자로 */
.chr-detail-inner { display: flex; flex-direction: column; gap: 10px; }
.chr-detail-inner > .chr-d-item,
.chr-detail-inner > .chr-d-notes,
.chr-detail-inner > .chr-d-addrow {
    margin: 0;
    padding: 18px 22px;
    border: 1px solid var(--chr-card-border);
    border-radius: var(--chr-radius);
    background: var(--chr-card-bg);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.chr-detail-inner > .chr-d-item { padding-top: 20px; padding-bottom: 22px; }
.chr-detail-inner > .chr-d-notes { padding-top: 6px; padding-bottom: 6px; }
.chr-detail-inner > .chr-d-addrow { padding-top: 12px; padding-bottom: 12px; }
.chr-d-notes .chr-note-row:last-child { border-bottom: 0; }
.chr-d-month { margin: 0 44px 0 4px; }
.chr-detail[hidden] { display: none; }
@keyframes chr-open {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}
.chr-detail-close {
    position: absolute;
    top: -6px;
    right: 0;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 1.05em;
    cursor: pointer;
    opacity: 0.6;
}
.chr-detail-close:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.chr-d-head {
    padding-right: 40px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid color-mix(in srgb, var(--chr-c) 45%, transparent);
}
.chr-d-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}
.chr-d-date { font-weight: 600; opacity: 0.8; }
.chr-d-tit {
    margin: 6px 0 0;
    font-family: var(--title-font-family, inherit);
    font-size: 1.35em;
    line-height: 1.35;
    color: var(--title-font-color, inherit);
}
.chr-d-links {
    position: absolute;
    top: 14px;
    right: 48px;
    display: flex;
    gap: 4px;
}
.chr-d-con {
    line-height: 1.75;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.chr-d-con img { max-width: 100%; height: auto; }
.chr-d-unused { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chr-d-unused img { max-height: 320px; width: auto; }
.chr-d-locked { padding: 20px 0; text-align: center; opacity: 0.8; }
.chr-d-locked a { text-decoration: underline; }

/* 글 보기 페이지의 날짜 줄 */
.chr-v-when {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.9em;
}
.chr-v-when .chr-d-date { opacity: 0.85; }

.chr-d-item .chr-d-head { position: relative; border-bottom-color: color-mix(in srgb, var(--accent-color, #c9a24b) 40%, transparent); }
.chr-d-item .chr-d-links { top: 0; right: 36px; }
.chr-d-item + .chr-d-item .chr-d-links { right: 0; }
.chr-d-add {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    padding: 6px 14px;
    border: 1px dashed var(--chr-line);
    border-radius: 999px;
    font-size: 0.88em;
}
.chr-d-add:hover { background: color-mix(in srgb, var(--accent-color, #c9a24b) 12%, transparent); }

/* 캐릭터 설정 창 */
.chr-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.4);
}
.chr-modal[hidden] { display: none; }
.chr-modal-box {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 22px 22px 18px;
    border-radius: 14px;
    background: var(--chr-card-bg, #fff);
    background-color: #fffdf6;
    color: #4a3f30;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}
.chr-modal-box h3 { margin: 0 0 12px; font-size: 1.15em; }
.chr-cfg-set { margin: 0 0 12px; padding: 10px 14px 6px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 10px; }
.chr-cfg-set legend { padding: 0 6px; font-weight: 700; }
.chr-cfg-set label { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.92em; }
.chr-cfg-set input.frm_input,
.chr-cfg-set select.frm_input { width: 100%; box-sizing: border-box; }
.chr-cfg-inline { display: flex; align-items: center; gap: 6px; }
.chr-cfg-inline input.frm_input { width: 80px; }
.chr-cfg-inline select.frm_input { width: 70px; }
.chr-cfg-set input[type="color"] { width: 46px; height: 30px; padding: 0; border: 1px solid #ccc; border-radius: 6px; background: none; }
.chr-cfg-btns { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.chr-cfg-msg { font-size: 0.85em; opacity: 0.75; }
html.chr-modal-open { overflow: hidden; }

/* 글 보기 페이지의 날짜 줄 */
.chr-v-when { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 0.9em; }
.chr-v-when .chr-d-date { opacity: 0.85; }
.chr-v-jump { margin-left: auto; font-size: 0.9em; text-decoration: underline; opacity: 0.75; }

/* 작은 화면 */
@media (max-width: 640px) {
    .chr-board { --chr-ev-w: 120px; --chr-card-w: 190px; --chr-half: 225px; }
    .chr-nav { display: none; }
    .chr-detail { padding: 18px 16px 20px; }
    .chr-d-links,
    .chr-d-item .chr-d-links { position: static; margin-top: 10px; }
    .chr-d-head { padding-right: 32px; }
    .chr-cfg-set label { grid-template-columns: 1fr; gap: 4px; }
    .chr-top-right { width: 100%; justify-content: space-between; }
}

/* 글쓰기: 연표 설정 */
.chr-w-box {
    padding: 14px 16px;
    border: 1px solid var(--form-border-color, rgba(0, 0, 0, 0.12));
    border-radius: var(--form-border-radius, 8px);
    background: var(--form-bg-color, transparent);
}
.chr-w-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: start;
    gap: 6px 12px;
    padding: 6px 0;
}
.chr-w-label { padding-top: 7px; font-weight: 600; font-size: 0.92em; }
.chr-w-req { color: var(--error-color, #d55); }
.chr-w-kind { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.chr-w-kind small { opacity: 0.65; }
.chr-w-help { margin: 4px 0 0; font-size: 0.8em; opacity: 0.65; }
.chr-w-color { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.chr-w-color input[type="color"] { width: 42px; height: 30px; padding: 0; border: 1px solid var(--form-border-color, #ccc); border-radius: 6px; background: none; cursor: pointer; }
.chr-w-color input[type="color"]:disabled { opacity: 0.35; cursor: default; }
@media (max-width: 640px) {
    .chr-w-row { grid-template-columns: 1fr; }
    .chr-w-label { padding-top: 0; }
}
.chr-v-jump { margin-left: auto; font-size: 0.9em; text-decoration: underline; opacity: 0.75; }

/* 카드 안 간단한 정보 */
.chr-card-notes { display: flex; flex-direction: column; gap: 3px; margin-top: 2px; }
.chr-card-note {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-left: 10px;
    position: relative;
    font-size: 0.84em;
    line-height: 1.4;
    opacity: 0.9;
}
/* 간단한 정보 앞 아이콘 (점·하트·별·왕관·클로버) */
.chr-ico { display: inline-block; width: 1em; height: 1em; fill: var(--chr-c, currentColor); vertical-align: -0.12em; flex: none; }
.chr-card-note { padding-left: 0; }
.chr-card-note .chr-ico { width: 1.15em; height: 1.15em; margin-right: 5px; vertical-align: -0.2em; }
.chr-card-note .chr-ico-dot { width: 0.7em; height: 0.7em; margin: 0 6px 0 2px; vertical-align: 0.02em; }
.chr-card.is-note-card { border-top-width: 1px; border-style: dashed; }
.chr-card.is-note-card .chr-card-body { gap: 5px; padding: 8px 12px 9px; }
.chr-card.is-note-card .chr-card-note { -webkit-line-clamp: 2; font-size: 0.88em; opacity: 1; }

/* 사건 추가 창 */
.chr-addbox {
    position: absolute;
    z-index: 50;
    width: 320px;
    max-width: calc(100% - 8px);
    padding: 12px 14px 10px;
    border-radius: 12px;
    background: #fffdf6;
    color: #4a3f30;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
    animation: chr-open .15s ease;
}
.chr-addbox-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chr-addbox-x { border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0.6; color: inherit; }
.chr-addbox-row { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.chr-addbox-row .frm_input { min-width: 0; height: 32px; box-sizing: border-box; }
.chr-addbox-row select[data-f="m"] { flex: 0 0 92px; }
.chr-addbox-row input[data-f="d"] { flex: 0 0 74px; }
.chr-addbox-row select[data-f="t"] { flex: 1 1 auto; }
.chr-addbox-row input[data-f="text"] { flex: 1 1 auto; }
.chr-addbox-row .btn { flex: none; height: 32px; padding: 0 12px; }
.chr-addbox-sub { margin: 4px 0 4px; font-weight: 700; font-size: 0.9em; }
.chr-addbox-sub small,
.chr-addbox-big small { font-weight: 400; opacity: 0.65; }
.chr-addbox-big {
    display: block;
    padding: 8px 10px;
    border: 1px dashed rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
}
.chr-addbox-big:hover { background: rgba(0, 0, 0, 0.04); }
.chr-addbox-msg { margin: 6px 0 0; min-height: 1em; font-size: 0.82em; opacity: 0.75; }

/* 펼친 본문: 달 제목 + 간단한 정보 목록 */
.chr-d-month { font-size: 0.85em; font-weight: 700; opacity: 0.75; }
.chr-d-notes ul { margin: 0; padding: 0; list-style: none; }
.chr-note-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 4px;
    border-bottom: 1px solid color-mix(in srgb, var(--chr-card-border) 70%, transparent);
}
.chr-note-row .chr-chip { font-size: 0.75em; }
.chr-note-day { font-size: 0.82em; opacity: 0.7; white-space: nowrap; }
.chr-note-text { flex: 1 1 auto; line-height: 1.5; overflow-wrap: anywhere; }
.chr-note-tools { display: flex; gap: 2px; opacity: 0.55; }
.chr-note-row:hover .chr-note-tools { opacity: 1; }
.chr-note-tools button { border: 0; background: none; color: inherit; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.chr-note-tools button:hover { background: rgba(0, 0, 0, 0.06); }
.chr-note-form { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.chr-note-form .frm_input { height: 30px; box-sizing: border-box; }
.chr-note-form input[data-f="y"] { width: 80px; }
.chr-note-form input[data-f="d"] { width: 60px; }
.chr-note-form input[data-f="text"] { flex: 1 1 200px; }
.chr-note-form .btn { height: 30px; padding: 0 10px; }
.chr-d-addrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.chr-d-quick { display: flex; gap: 6px; flex: 1 1 320px; }
.chr-d-quick .frm_input { height: 32px; box-sizing: border-box; }
.chr-d-quick input[data-f="text"] { flex: 1 1 auto; min-width: 0; }
.chr-d-quick .btn { height: 32px; padding: 0 12px; }
.chr-d-addrow .chr-d-add { margin-top: 0; }
.chr-d-msg { font-size: 0.82em; opacity: 0.75; }

/* 카드 이미지 보이는 부분 편집 */
.chr-card-img img { transition: transform .05s linear; }
.chr-img-edit {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 6;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transition: opacity .15s ease;
}
.chr-stack:hover .chr-img-edit,
.chr-img-edit:focus-visible { opacity: 1; }
.chr-m.is-up .chr-stack .chr-img-edit { top: 12px; }
.chr-stack.is-img-editing .chr-img-edit { display: none; }
.chr-stack.is-img-editing { z-index: 8; }
.chr-stack.is-img-editing .chr-card { cursor: default; transform: none !important; box-shadow: 0 0 0 2px var(--chr-c), 0 8px 22px rgba(0, 0, 0, 0.18); }
.chr-stack.is-img-editing .chr-card-img { cursor: move; touch-action: none; outline: 2px dashed rgba(255, 255, 255, 0.9); outline-offset: -6px; }
.chr-stack.is-img-editing .chr-card-img img { transition: none; }
.chr-img-bar {
    /* 카드 자리를 밀지 않게 카드 묶음 바로 아래에 띄움 */
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 9;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    padding: 7px 10px;
    border-radius: var(--chr-radius);
    background: #fffdf6;
    color: #4a3f30;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    font-size: 0.8em;
}
.chr-img-hint { flex: 1 1 100%; opacity: 0.7; }
.chr-img-zoom { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; }
.chr-img-zoom input { width: 100%; min-width: 60px; }
.chr-img-btns { display: flex; gap: 4px; }
.chr-img-btns button {
    padding: 4px 10px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
.chr-img-btns .is-save { background: var(--accent-color, #8a6d1f); border-color: transparent; color: #fff; font-weight: 700; }

/* 월 표시(점·'n월')는 눌러서 그 달 전체 보기 */
.chr-dot,
.chr-ev-date {
    border: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.chr-dot { padding: 0; }
.chr-ev-date { font-size: 0.8em; font-weight: 700; line-height: 1.4; }
.chr-dot:hover { transform: scale(1.25); }
.chr-ev-date:hover { box-shadow: 0 0 0 2px var(--chr-c); }
.chr-dot:focus-visible,
.chr-ev-date:focus-visible { outline: 2px solid var(--chr-c); outline-offset: 2px; }

/* 카드 제목 아래 간략 설명 */
.chr-card-sum {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: -1px;
    font-size: 0.82em;
    line-height: 1.45;
    opacity: 0.75;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.chr-card.has-img .chr-card-sum { -webkit-line-clamp: 2; }
.chr-card.is-multi .chr-card-tit:hover,
.chr-card.is-note-card .chr-card-note:hover { text-decoration: underline; text-underline-offset: 3px; }
.chr-d-summary { margin: 6px 0 0; font-size: 0.92em; line-height: 1.6; opacity: 0.8; }
.chr-w-summary { min-height: 56px; resize: vertical; line-height: 1.5; }

/* 입력칸·선택칸·버튼 세로 가운데 정렬 (사이트 기본 안쪽 여백 때문에 글자가 아래로 처지던 것) */
.chr-board .frm_input,
.chr-addbox .frm_input,
.chr-modal .frm_input {
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 10px;
    line-height: 32px;
    box-sizing: border-box;
    vertical-align: middle;
}
.chr-board select.frm_input,
.chr-addbox select.frm_input,
.chr-modal select.frm_input {
    padding-right: 26px;
    line-height: normal;
}
.chr-board .chr-addbox-row .btn,
.chr-board .chr-d-quick .btn,
.chr-board .chr-note-form .btn,
.chr-board .chr-note-form button,
.chr-board .chr-cfg-btns .btn,
.chr-modal .chr-cfg-btns .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 14px;
    line-height: 1;
    box-sizing: border-box;
    vertical-align: middle;
    white-space: nowrap;
}
.chr-board .chr-note-form [data-note-cancel] {
    border: 1px solid var(--chr-card-border);
    border-radius: var(--form-border-radius, 6px);
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.chr-note-form,
.chr-addbox-row,
.chr-d-quick { align-items: center; }
.chr-d-add,
.chr-addbox-big {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 34px;
    box-sizing: border-box;
    line-height: 1.2;
}
.chr-addbox-big { display: flex; }
.chr-note-row { min-height: 40px; }
.chr-note-row .chr-chip,
.chr-d-meta .chr-tag { line-height: 1.6; }
.chr-w-ymd { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chr-w-ymd .frm_input { height: 34px; padding: 0 10px; line-height: normal; box-sizing: border-box; }
.chr-w-ymd #chr_y { width: 96px; }
.chr-w-ymd #chr_m { width: 80px; }
.chr-w-ymd #chr_d { width: 90px; }
.chr-w-row input.frm_input:not([type="radio"]):not([type="checkbox"]),
.chr-w-row select.frm_input { height: 34px; padding-top: 0; padding-bottom: 0; line-height: normal; box-sizing: border-box; }
.chr-w-kind label { display: inline-flex; align-items: center; gap: 6px; }
.chr-w-color label { display: inline-flex; align-items: center; gap: 6px; }

/* 아래쪽 카드는 편집 도구를 카드 위쪽(연표 선 쪽)에 띄움 — 아래로 띄우면 연표 밖으로 잘림 */
.chr-m.is-down .chr-img-bar { top: auto; bottom: calc(100% + 8px); }

/* 회전 슬라이더 */
.chr-img-deg { min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.chr-img-r0 {
    height: 26px;
    padding: 0 8px;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 6px;
    background: #fff;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.chr-note-ico { display: inline-flex; align-items: center; font-size: 1.25em; }
.chr-icopick { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--form-border-color, rgba(0, 0, 0, 0.15)); border-radius: 8px; background: rgba(255, 255, 255, 0.6); flex: none; }
.chr-icopick label { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; --chr-c: #b9a46a; }
.chr-icopick input { position: absolute; opacity: 0; pointer-events: none; }
.chr-icopick .chr-ico { width: 17px; height: 17px; fill: var(--chr-c); opacity: 0.55; }
.chr-icopick .chr-ico-dot { width: 11px; height: 11px; }
.chr-icopick label:hover { background: rgba(0, 0, 0, 0.05); }
.chr-icopick input:checked + .chr-ico { opacity: 1; }
.chr-icopick label:has(input:checked) { background: color-mix(in srgb, var(--accent-color, #c9a24b) 22%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color, #c9a24b) 60%, transparent); }
.chr-icopick input:focus-visible + .chr-ico { outline: 2px solid var(--accent-color, #c9a24b); outline-offset: 3px; border-radius: 3px; }
.chr-addbox-icons { margin-bottom: 6px; }
.chr-d-quick .chr-icopick,
.chr-note-form .chr-icopick { height: 34px; box-sizing: border-box; }

/* 중요 사건 제목 앞 아이콘 */
.chr-tit-ico { display: inline-flex; vertical-align: -0.15em; margin-right: 5px; }
.chr-tit-ico .chr-ico { width: 1.1em; height: 1.1em; }
.chr-d-tit .chr-tit-ico .chr-ico { width: 0.95em; height: 0.95em; }
.chr-w-icopick label { width: auto; min-width: 34px; height: 34px; padding: 0 6px; }
.chr-w-icopick .chr-ico { width: 19px; height: 19px; }
.chr-ico-nonetxt { font-size: 0.85em; opacity: 0.6; }
.chr-icopick input:checked + .chr-ico-nonetxt { opacity: 1; font-weight: 700; }

/* 연표 검색 */
.chr-search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1 1 240px;
    max-width: 360px;
    height: 36px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--chr-card-border);
    border-radius: 999px;
    background: var(--chr-card-bg);
    box-sizing: border-box;
}
.chr-search > .fa { opacity: 0.5; margin-right: 8px; }
.chr-search-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.92em;
    box-shadow: none;
}
.chr-search-input::-webkit-search-cancel-button { display: none; }
.chr-search:focus-within { box-shadow: 0 0 0 2px color-mix(in srgb, var(--chr-line) 40%, transparent); }
.chr-search-clear { border: 0; background: none; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0.45; padding: 0 4px; }
.chr-search-clear:hover { opacity: 0.9; }
.chr-search-results {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    z-index: 60;
    width: max(100%, 340px);
    max-height: 360px;
    overflow-y: auto;
    padding: 6px;
    border-radius: 12px;
    background: #fffdf6;
    color: #4a3f30;
    border: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}
.chr-search-results[hidden] { display: none; }
.chr-search-results ul { margin: 0; padding: 0; list-style: none; }
.chr-search-results button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.chr-search-results button:hover,
.chr-search-results button:focus-visible { background: rgba(0, 0, 0, 0.05); }
.chr-sr-date { flex: none; width: 92px; font-size: 0.8em; opacity: 0.7; font-variant-numeric: tabular-nums; }
.chr-search-results .chr-chip { font-size: 0.72em; }
.chr-sr-title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.92em; }
.chr-sr-title .chr-ico { width: 1em; height: 1em; margin-right: 4px; vertical-align: -0.12em; fill: var(--chr-c); }
.chr-sr-count,
.chr-sr-empty { margin: 4px 8px 6px; font-size: 0.8em; opacity: 0.65; }
/* 검색 중: 맞는 카드만 또렷하게 */
.chr-track.is-searching .chr-card:not(.is-hit),
.chr-track.is-searching .chr-era-tag:not(.is-hit) { opacity: 0.35; }
.chr-track.is-searching .chr-card.is-hit { box-shadow: 0 0 0 2px var(--chr-c), 0 6px 16px rgba(0, 0, 0, 0.14); }
.chr-track.is-searching .chr-card-tit.is-hit,
.chr-track.is-searching .chr-card-note.is-hit { background: color-mix(in srgb, #ffe27a 55%, transparent); border-radius: 4px; }
@media (max-width: 640px) {
    .chr-search { max-width: none; flex-basis: 100%; order: 3; }
}

/* 아이콘 없음 */
.chr-icopick .chr-ico-none { width: auto; padding: 0 7px; }
.chr-card-note .chr-ico-none,
.chr-note-ico:empty { display: none; }

/* 아이콘 필터 버튼 (검색창 옆) */
.chr-icon-filter { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--chr-card-border); border-radius: 999px; background: var(--chr-card-bg); }
.chr-icon-filter button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8em;
    cursor: pointer;
    --chr-c: var(--chr-line);
}
.chr-icon-filter .chr-ico { width: 17px; height: 17px; opacity: 0.45; transition: opacity .15s ease, transform .15s ease; }
.chr-icon-filter .chr-ico-dot { width: 10px; height: 10px; }
.chr-icon-filter button:hover .chr-ico { opacity: 0.8; }
.chr-icon-filter button.is-on { background: color-mix(in srgb, var(--chr-line) 20%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chr-line) 55%, transparent); }
.chr-icon-filter button.is-on .chr-ico { opacity: 1; transform: scale(1.1); }
.chr-icon-filter .chr-filter-reset { padding: 0 10px; font-weight: 700; opacity: 0.75; }
.chr-icon-filter .chr-filter-reset[hidden] { display: none; }

/* ---- 아이콘 크기: 글씨보다 살짝 작게 ---- */
.chr-tit-ico { margin-right: 4px; vertical-align: -0.08em; }
.chr-tit-ico .chr-ico,
.chr-d-tit .chr-tit-ico .chr-ico { width: 0.88em; height: 0.88em; }
.chr-note-ico { font-size: 1em; }
.chr-note-ico .chr-ico { width: 0.92em; height: 0.92em; }
.chr-note-ico .chr-ico-dot { width: 0.55em; height: 0.55em; }
.chr-sr-title .chr-ico { width: 0.88em; height: 0.88em; }

/* ---- 간단한 정보 줄: 아이콘과 글씨 세로 가운데 ---- */
.chr-card-note,
.chr-card.is-note-card .chr-card-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding-left: 0;
    line-height: 1.45;
    -webkit-line-clamp: unset;
}
.chr-card-note .chr-ico {
    flex: none;
    width: 0.9em;
    height: 0.9em;
    margin: calc((1.45em - 0.9em) / 2 - 0.07em) 0 0;   /* 첫 줄 글씨 높이의 가운데에 (한글은 살짝 위에 앉아서 그만큼 올림) */
    vertical-align: 0;
}
.chr-card-note .chr-ico-dot {
    width: 0.5em;
    height: 0.5em;
    margin: calc((1.45em - 0.5em) / 2 - 0.05em) 0.2em 0;
}
.chr-note-t {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}
.chr-card.is-note-card .chr-note-t { -webkit-line-clamp: 2; }
.chr-card.is-note-card .chr-card-body { padding: 9px 12px; gap: 4px; }
.chr-note-row { align-items: center; }
.chr-note-row .chr-note-ico { display: inline-flex; align-items: center; height: 1.5em; }

/* ---- 중요 사건 카드: 제목 위 여백 = 간략 설명 아래 여백 ---- */
.chr-card:not(.is-note-card) .chr-card-body { padding: 10px 12px 10px; }
.chr-card-tit { line-height: 1.4; }
.chr-card-sum { line-height: 1.4; margin-top: 0; }

/* ==========================================================
 * 다이어리 스타일 (설정 > 디자인 > 다이어리)
 * ========================================================== */
.chr-board.is-diary {
    --chr-hand: 'Gaegu', var(--title-font-family, inherit), cursive;
    --chr-ink: #4a3f30;
    --chr-paper-line: color-mix(in srgb, var(--chr-line) 16%, transparent);
    --chr-card-bg: #fffdf8;
    --chr-card-border: rgba(90, 70, 40, 0.14);
    --chr-radius: 4px;
    --chr-lane: 46px;
    position: relative;
    border-radius: 6px 14px 14px 6px;
    background-color: var(--chr-paper);
    color: var(--chr-ink);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.6) inset,
        0 2px 4px rgba(60, 40, 10, 0.10),
        0 14px 36px rgba(60, 40, 10, 0.16),
        6px 6px 0 -1px color-mix(in srgb, var(--chr-paper) 85%, #c9b48a),   /* 뒤에 겹친 종이 한 장 */
        6px 6px 0 0 rgba(90, 70, 40, 0.12);
    box-sizing: border-box;
}
#bo_list.chr-board.is-diary { padding: 34px 26px 26px; box-sizing: border-box; }
/* 종이 무늬 */
.chr-board.is-diary.paper-grid {
    background-image:
        linear-gradient(var(--chr-paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--chr-paper-line) 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: -1px -1px;
}
.chr-board.is-diary.paper-lines {
    background-image:
        linear-gradient(90deg, transparent 58px, rgba(214, 120, 120, 0.35) 58px, rgba(214, 120, 120, 0.35) 60px, transparent 60px),
        repeating-linear-gradient(transparent 0, transparent 27px, var(--chr-paper-line) 27px, var(--chr-paper-line) 28px);
}
.chr-board.is-diary.paper-dots {
    background-image: radial-gradient(circle, color-mix(in srgb, var(--chr-line) 28%, transparent) 1.2px, transparent 1.5px);
    background-size: 20px 20px;
}
/* 위쪽 바인더 구멍 */
.chr-board.is-diary::before {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    top: 9px;
    height: 14px;
    background: radial-gradient(circle at 7px 7px, rgba(70, 50, 20, 0.28) 0 5px, rgba(255, 255, 255, 0.55) 5.5px 6.5px, transparent 7px) repeat-x;
    background-size: 34px 14px;
    pointer-events: none;
}

/* 손글씨 글꼴: 연도·월·시기·탄생·연표 버튼 */
.is-diary .chr-year-pill strong,
.is-diary .chr-ev-date,
.is-diary .chr-era-tag,
.is-diary .chr-birth,
.is-diary .chr-switch,
.is-diary .chr-d-month,
.is-diary .chr-d-date,
.is-diary .chr-sr-date { font-family: var(--chr-hand); }

/* 가운데 선: 손으로 그은 점선 */
.is-diary .chr-track::before {
    height: 0;
    margin-top: 0;
    background: none;
    border-top: 2px dashed var(--chr-line);
    opacity: 0.85;
}
.is-diary .chr-year-head::before { border-left-style: dotted; opacity: 0.5; }

/* 연도: 마스킹테이프 이름표 */
.is-diary .chr-year-pill {
    padding: 4px 12px 5px;
    border: 0;
    border-radius: 2px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.25) 0 6px, transparent 6px 12px),
        color-mix(in srgb, var(--chr-line) 22%, #fffaf0);
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.18);
    rotate: -2deg;
    clip-path: polygon(0 4%, 3% 0, 97% 3%, 100% 0, 99% 96%, 96% 100%, 3% 97%, 0 100%);
}
.is-diary .chr-year-pill strong { font-size: 1.35em; line-height: 1; }
.is-diary .chr-year-pill span { font-size: 0.72em; }
.is-diary button.chr-year-pill:hover,
.is-diary button.chr-year-pill.is-active { box-shadow: 0 3px 8px rgba(60, 40, 10, 0.25); rotate: 0deg; }

/* 월 표시: 형광펜 밑줄 */
.is-diary .chr-ev-date {
    padding: 0 4px;
    border-radius: 0;
    font-size: 1.05em;
    font-weight: 700;
    background: linear-gradient(transparent 55%, color-mix(in srgb, var(--chr-c) 45%, transparent) 55%, color-mix(in srgb, var(--chr-c) 45%, transparent) 90%, transparent 90%);
}
.is-diary .chr-ev-date:hover { box-shadow: none; text-decoration: underline wavy color-mix(in srgb, var(--chr-c) 70%, transparent); }

/* 점: 동그란 스티커 */
.is-diary .chr-dot {
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    box-shadow: 0 0 0 3px #fff, 0 2px 4px rgba(60, 40, 10, 0.3);
}
.is-diary .chr-m.has-ev::after { border-left-style: dotted; opacity: 0.6; }

/* 카드 묶음: 살짝 기울여 붙인 느낌 */
.is-diary .chr-stack { rotate: var(--tilt, 1deg); gap: 10px; }
.is-diary .chr-stack:hover,
.is-diary .chr-stack:has(.is-active),
.is-diary .chr-stack.is-img-editing { rotate: 0deg; transition: rotate .2s ease; }

/* 중요 사건 카드: 사진 인화지 + 마스킹테이프 */
.is-diary .chr-card:not(.is-note-card) {
    border: 0;
    border-radius: 3px;
    padding: 0;
    background: #fffefb;
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.16), 0 8px 18px rgba(60, 40, 10, 0.12);
    overflow: visible;
}
.is-diary .chr-card:not(.is-note-card).has-img { padding: 8px 8px 0; }
.is-diary .chr-card:not(.is-note-card) .chr-card-img { border-radius: 2px; overflow: hidden; }
.is-diary .chr-card:not(.is-note-card)::before {
    /* 마스킹테이프 */
    content: "";
    position: absolute;
    left: 50%;
    top: -11px;
    width: 76px;
    height: 22px;
    margin-left: -38px;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 5px, transparent 5px 10px),
        color-mix(in srgb, var(--chr-c) 60%, #fff);
    opacity: 0.88;
    rotate: -4deg;
    clip-path: polygon(3% 0, 97% 6%, 100% 50%, 96% 100%, 4% 94%, 0 50%);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    z-index: 2;
}
.is-diary .chr-card:not(.is-note-card):hover { box-shadow: 0 2px 4px rgba(60, 40, 10, 0.18), 0 14px 26px rgba(60, 40, 10, 0.16); }
.is-diary .chr-card.is-active { box-shadow: 0 0 0 2px color-mix(in srgb, var(--chr-c) 70%, transparent), 0 12px 24px rgba(60, 40, 10, 0.2); }
.is-diary .chr-card-tit { font-family: var(--title-font-family, inherit); }
.is-diary .chr-img-edit { top: 14px; right: 14px; }

/* 간단한 정보: 포스트잇 */
.is-diary .chr-card.is-note-card {
    border: 0;
    border-radius: 2px 2px 10px 2px;
    background:
        linear-gradient(135deg, transparent 0 calc(100% - 14px), color-mix(in srgb, var(--chr-c) 30%, #e9dcc0) calc(100% - 14px)),
        color-mix(in srgb, var(--chr-c) 20%, #fff8dc);
    box-shadow: 0 1px 1px rgba(60, 40, 10, 0.12), 0 6px 12px rgba(60, 40, 10, 0.12);
}
.is-diary .chr-card.is-note-card .chr-card-note { font-weight: 600; }

/* 시기 이름표: 종이 라벨 */
.is-diary .chr-era-tag {
    border: 0;
    border-left: 0;
    border-radius: 2px;
    padding: 4px 14px 5px;
    background:
        linear-gradient(90deg, var(--chr-era) 0 6px, transparent 6px),
        #fffdf6;
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.18), 0 4px 10px rgba(60, 40, 10, 0.08);
    rotate: -1.5deg;
}
.is-diary .chr-era-tag strong { font-size: 1.2em; }
.is-diary .chr-era-tag::after { border-left-style: dotted; }

/* 탄생: 스티커 */
.is-diary .chr-birth {
    border: 0;
    font-size: 0.95em;
    background: color-mix(in srgb, var(--chr-c) 35%, #fff);
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.2);
    rotate: 2deg;
}

/* 위쪽 버튼들 */
.is-diary .chr-switch { font-size: 1.15em; padding: 5px 16px; border-style: dashed; background: #fffdf6; }
.is-diary .chr-search,
.is-diary .chr-icon-filter { background: rgba(255, 253, 246, 0.9); }
.is-diary .chr-nav { background: #fffdf6; }

/* 펼친 내용: 줄노트 종이 + 테이프 */
.is-diary .chr-detail-inner > .chr-d-item,
.is-diary .chr-detail-inner > .chr-d-notes,
.is-diary .chr-detail-inner > .chr-d-addrow {
    position: relative;
    border: 0;
    border-radius: 3px;
    background-color: #fffefb;
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.14), 0 8px 18px rgba(60, 40, 10, 0.08);
}
.is-diary .chr-detail-inner > .chr-d-item {
    background-image: repeating-linear-gradient(transparent 0, transparent 29px, rgba(120, 100, 60, 0.12) 29px, rgba(120, 100, 60, 0.12) 30px);
    background-position: 0 14px;
}
.is-diary .chr-detail-inner > .chr-d-item::before {
    content: "";
    position: absolute;
    left: 22px;
    top: -9px;
    width: 64px;
    height: 18px;
    background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.35) 0 5px, transparent 5px 10px), color-mix(in srgb, var(--chr-line) 40%, #fff);
    opacity: 0.85;
    rotate: -3deg;
    clip-path: polygon(3% 0, 97% 6%, 100% 50%, 96% 100%, 4% 94%, 0 50%);
}
.is-diary .chr-detail-inner > .chr-d-notes { background: color-mix(in srgb, var(--chr-line) 8%, #fff9e6); }
.is-diary .chr-d-month { font-size: 1.2em; opacity: 0.85; }
.is-diary .chr-d-tit { font-family: var(--title-font-family, inherit); }

@media (max-width: 640px) {
    #bo_list.chr-board.is-diary { padding: 30px 12px 16px; }
}

/* ==========================================================
 * 다이어리 v2: 연표까지만 종이 한 장 + 바인더 구멍 투명 + 아래는 화이트보드
 * ========================================================== */
.chr-paper { position: relative; }
.chr-paper-shade { display: none; }

#bo_list.chr-board.is-diary {
    padding: 0;
    background: none;
    box-shadow: none;
    border-radius: 0;
}
.chr-board.is-diary::before { display: none; }

.is-diary .chr-paper {
    isolation: isolate;
    padding: 40px 26px 22px;
    margin-bottom: 20px;
}
/* 종이 그림자: 구멍 모양까지 따라가게 종이 바탕에만 그림자 */
.is-diary .chr-paper-shade {
    display: block;
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    filter: drop-shadow(0 1px 2px rgba(60, 40, 10, 0.14)) drop-shadow(0 12px 22px rgba(60, 40, 10, 0.16));
}
.is-diary .chr-paper-bg {
    position: absolute;
    inset: 0;
    border-radius: 6px 14px 14px 6px;
    background-color: var(--chr-paper);
    /* 위쪽 바인더 구멍: 진짜로 뚫려서 뒤가 보임 */
    -webkit-mask-image: radial-gradient(circle at 17px 18px, transparent 6px, #000 6.7px);
    -webkit-mask-size: 34px 100%;
    -webkit-mask-repeat: round no-repeat;
    mask-image: radial-gradient(circle at 17px 18px, transparent 6px, #000 6.7px);
    mask-size: 34px 100%;
    mask-repeat: round no-repeat;
}
.is-diary.paper-grid .chr-paper-bg {
    background-image:
        linear-gradient(var(--chr-paper-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--chr-paper-line) 1px, transparent 1px);
    background-size: 22px 22px;
    background-position: -1px -1px;
}
.is-diary.paper-lines .chr-paper-bg {
    background-image:
        linear-gradient(90deg, transparent 58px, rgba(214, 120, 120, 0.35) 58px, rgba(214, 120, 120, 0.35) 60px, transparent 60px),
        repeating-linear-gradient(transparent 0, transparent 27px, var(--chr-paper-line) 27px, var(--chr-paper-line) 28px);
}
.is-diary.paper-dots .chr-paper-bg {
    background-image: radial-gradient(circle, color-mix(in srgb, var(--chr-line) 28%, transparent) 1.2px, transparent 1.5px);
    background-size: 20px 20px;
}
.chr-board.is-diary.paper-grid,
.chr-board.is-diary.paper-lines,
.chr-board.is-diary.paper-dots { background-image: none; }

/* 아래 펼친 내용: 화이트보드 */
.is-diary .chr-detail {
    margin-top: 0;
    padding: 22px 24px 30px;
    border: 10px solid #d3d8db;
    border-radius: 8px;
    background:
        radial-gradient(ellipse 180px 60px at 82% 18%, rgba(120, 140, 170, 0.06), transparent 70%),
        radial-gradient(ellipse 240px 70px at 20% 85%, rgba(120, 140, 170, 0.05), transparent 70%),
        linear-gradient(165deg, #fdfefd 0%, #f2f5f4 55%, #fafbfb 100%);
    box-shadow:
        inset 0 0 0 1px rgba(0, 0, 0, 0.06),
        inset 0 2px 6px rgba(0, 0, 0, 0.05),
        0 0 0 1px #aab2b8,
        0 12px 26px rgba(40, 40, 40, 0.18);
}
.is-diary .chr-detail::after {
    /* 아래쪽 마커 받침대 */
    content: "";
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: -18px;
    height: 8px;
    border-radius: 0 0 6px 6px;
    background: linear-gradient(#c3c9cd, #9aa3a9);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}
.is-diary .chr-detail-close { top: 8px; right: 10px; }
.is-diary .chr-d-month { color: #2f4b7a; font-size: 1.35em; opacity: 1; margin: 0 44px 2px 2px; }
.is-diary .chr-detail-inner { gap: 16px; }
/* 화이트보드에 자석으로 붙인 종이 */
.is-diary .chr-detail-inner > .chr-d-item::before,
.is-diary .chr-detail-inner > .chr-d-notes::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -7px;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    border-radius: 50%;
    clip-path: none;
    rotate: 0deg;
    opacity: 1;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.7), transparent 45%), var(--chr-mag, #d9534f);
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
    z-index: 2;
}
.is-diary .chr-detail-inner > .chr-d-notes { position: relative; --chr-mag: #e2bf55; }
.is-diary .chr-detail-inner > .chr-d-item:nth-of-type(3n+2) { --chr-mag: #5b8bd0; }
.is-diary .chr-detail-inner > .chr-d-item:nth-of-type(3n+3) { --chr-mag: #6bb37a; }
.is-diary .chr-detail-inner > .chr-d-addrow { background: rgba(255, 255, 255, 0.75); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }

/* 펼친 본문 이미지: 세로로 긴 이미지는 왼쪽에 두고 글은 오른쪽으로 */
.chr-d-con { display: flow-root; }
.chr-d-con img.chr-img-side,
.chr-d-con .chr-d-unused.chr-img-side {
    float: left;
    max-width: 45%;
    height: auto;
    margin: 4px 22px 12px 0;
}
.chr-d-con .chr-d-unused.chr-img-side img { max-width: 100%; max-height: none; }
.chr-d-con img:not(.chr-img-side) { display: block; margin: 0 0 12px; }
.chr-d-con p:has(> img.chr-img-side:only-child) { display: contents; }
@media (max-width: 640px) {
    .chr-d-con img.chr-img-side,
    .chr-d-con .chr-d-unused.chr-img-side { float: none; max-width: 100%; margin: 0 0 12px; }
}

/* ==========================================================
 * 다이어리 v3: 화이트보드 없애고 노트만 / 테이프 / 만년 다이어리식 달 표시
 * ========================================================== */
/* 연도 이름표: 오른쪽 위 + 가 잘리지 않게 (모서리 자르기 대신 테이프 끝 무늬) */
.is-diary .chr-year-pill {
    clip-path: none;
    border-radius: 1px;
    -webkit-mask-image: none;
    mask-image: none;
}
.is-diary .chr-year-add { top: -9px; right: -9px; z-index: 2; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

/* 화이트보드 없앰 */
.is-diary .chr-detail {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}
.is-diary .chr-detail::after { display: none; }
.is-diary .chr-detail-close {
    top: 0;
    right: 0;
    background: rgba(255, 253, 246, 0.9);
    box-shadow: 0 1px 3px rgba(60, 40, 10, 0.2);
    opacity: 0.8;
}
.is-diary .chr-detail-inner { gap: 22px; padding-top: 4px; }

/* 노트 위에 마스킹테이프 (자석 대신) */
.is-diary .chr-detail-inner > .chr-d-item::before,
.is-diary .chr-detail-inner > .chr-d-notes::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -12px;
    width: 96px;
    height: 24px;
    margin-left: -48px;
    border-radius: 0;
    background:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.38) 0 6px, transparent 6px 12px),
        color-mix(in srgb, var(--chr-tape, var(--chr-line)) 45%, #fff);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
    opacity: 0.88;
    rotate: -2.5deg;
    clip-path: polygon(2% 8%, 6% 0, 94% 4%, 100% 0, 98% 50%, 100% 96%, 95% 100%, 5% 94%, 0 100%, 3% 50%);
    z-index: 2;
}
.is-diary .chr-detail-inner > .chr-d-item:nth-of-type(3n+2)::before { --chr-tape: #e0a8a8; rotate: 2deg; }
.is-diary .chr-detail-inner > .chr-d-item:nth-of-type(3n+3)::before { --chr-tape: #a9c39a; rotate: -1deg; }
.is-diary .chr-detail-inner > .chr-d-notes::before { --chr-tape: #e2bf55; rotate: 1.5deg; width: 72px; margin-left: -36px; }
.is-diary .chr-detail-inner > .chr-d-addrow { background: rgba(255, 253, 246, 0.85); box-shadow: 0 1px 2px rgba(60, 40, 10, 0.12); }

/* 만년 다이어리식 달 표시: 연도 + 1~12월, 해당 달에 동그라미 */
.chr-d-cal {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 44px 4px 2px;
    color: var(--chr-ink, var(--content-font-color));
}
.chr-d-cal-y {
    font-family: var(--chr-hand, inherit);
    font-size: 1.7em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}
.chr-d-cal-m {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin: 0;
    padding: 0 0 2px;
    list-style: none;
}
.chr-d-cal-m li {
    position: relative;
    width: 26px;
    height: 26px;
    font-family: var(--chr-hand, inherit);
    font-size: 1.05em;
    line-height: 26px;
    text-align: center;
    opacity: 0.45;
}
.chr-d-cal-m li.is-on { opacity: 1; font-weight: 700; }
.chr-d-cal-m li.is-on::before {
    /* 펜으로 그린 동그라미 */
    content: "";
    position: absolute;
    inset: -3px -4px -2px -3px;
    border: 2px solid #d0574f;
    border-radius: 52% 48% 55% 45% / 50% 55% 45% 50%;
    rotate: -12deg;
}
.chr-d-cal-m li.is-on::after {
    /* 동그라미 끝이 살짝 겹치게 */
    content: "";
    position: absolute;
    right: -5px;
    top: -4px;
    width: 9px;
    height: 7px;
    border-top: 2px solid #d0574f;
    border-radius: 50% 50% 0 0;
    rotate: 30deg;
}
.is-diary .chr-d-month { display: none; }

/* 삭제(X) 버튼 */
.chr-d-links .chr-d-del:hover { color: #c0392b; }

/* 달 표시를 종이 쪽지 위에: 위에 연도, 아래에 1~12월 */
.chr-d-cal {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    align-self: flex-start;
    margin: 0 0 2px;
    padding: 10px 16px 8px;
    border-radius: 3px;
    background: var(--chr-paper, #fbf6ea);
    box-shadow: 0 1px 2px rgba(60, 40, 10, 0.16), 0 6px 14px rgba(60, 40, 10, 0.1);
}
.is-diary .chr-d-cal { rotate: -1deg; }
.chr-d-cal-m { padding: 0; }

/* 해 바뀌는 곳 세로 점선 없앰 (연도 이름표로 충분히 구분됨) */
.chr-year-head::before { display: none; }

/* 연도 이름표: 스티치(박음질) 테두리 종이 라벨 */
.is-diary .chr-year-pill {
    padding: 5px 13px 6px;
    border: 0;
    border-radius: 5px;
    background: #fffdf7;
    box-shadow:
        inset 0 0 0 3px #fffdf7,
        inset 0 0 0 4px color-mix(in srgb, var(--chr-line) 0%, transparent),
        0 1px 2px rgba(60, 40, 10, 0.18),
        0 4px 10px rgba(60, 40, 10, 0.10);
    outline: 1.5px dashed color-mix(in srgb, var(--chr-line) 55%, transparent);
    outline-offset: -5px;
    rotate: -1.5deg;
}
.is-diary .chr-year-pill strong { font-size: 1.4em; letter-spacing: 0.04em; color: var(--chr-ink); }
.is-diary .chr-year-pill span { font-size: 0.7em; opacity: 0.7; margin-top: 1px; }
.is-diary button.chr-year-pill:hover,
.is-diary button.chr-year-pill.is-active {
    rotate: 0deg;
    box-shadow: 0 2px 4px rgba(60, 40, 10, 0.2), 0 8px 16px rgba(60, 40, 10, 0.14);
    outline-color: color-mix(in srgb, var(--chr-line) 85%, transparent);
}

/* 펼친 화면의 간단한 정보: 탁한 베이지 대신 중요 사건 노트와 같은 깨끗한 줄노트 종이 */
.is-diary .chr-detail-inner > .chr-d-notes {
    background-color: #fffefb;
    background-image: repeating-linear-gradient(transparent 0, transparent 39px, rgba(120, 100, 60, 0.10) 39px, rgba(120, 100, 60, 0.10) 40px);
    background-position: 0 6px;
}
.is-diary .chr-detail-inner > .chr-d-notes::before { --chr-tape: #f0c94a; opacity: 0.9; }
.is-diary .chr-d-notes .chr-note-row { border-bottom-color: transparent; }

/* 연표 바꾸기 버튼: 손글씨 대신 또렷한 글꼴 */
.is-diary .chr-switch {
    font-family: var(--title-font-family, var(--content-font-family, inherit));
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 6px 16px;
}

/* ---- 연표 바꾸기 버튼: 앞 점 없앰 ---- */
.chr-switch-dot { display: none; }

/* ---- 가운데 선은 첫 해 이름표부터 ---- */
.chr-track::before { left: var(--chr-line-start, 0); }

/* ---- 마스킹테이프: 사선 무늬 없이 반투명 민무늬 ---- */
.is-diary .chr-card:not(.is-note-card)::before {
    background: color-mix(in srgb, var(--chr-c) 55%, #fff);
    opacity: 0.78;
}
.is-diary .chr-detail-inner > .chr-d-item::before,
.is-diary .chr-detail-inner > .chr-d-notes::before {
    background: color-mix(in srgb, var(--chr-tape, var(--chr-line)) 45%, #fff);
    opacity: 0.8;
}

/* ---- 달 동그라미: 색연필 ---- */
.chr-d-cal-m li.is-on::before,
.chr-d-cal-m li.is-on::after { display: none; }
.chr-pencil-ring {
    position: absolute;
    left: -9px;
    top: -6px;
    width: 44px;
    height: 37px;
    overflow: visible;
    pointer-events: none;
    fill: none;
    stroke: #d0574f;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.85;
    filter: url(#chr_pencil_filter);
    rotate: -6deg;
}
.chr-pencil-ring .chr-pencil-2 { stroke-width: 1.3; opacity: 0.55; }

/* ==========================================================
 * 손글씨 글꼴 (설정 > 디자인 > 손글씨 글꼴 / 손글씨 쓰는 곳)
 *  --chr-hand-scale: 글꼴마다 실제 크기가 달라서 맞춰주는 배율
 * ========================================================== */
.is-diary .chr-year-pill strong { font-size: calc(1.4em * var(--chr-hand-scale, 1)); font-weight: 400; }
.is-diary .chr-ev-date { font-size: calc(1.05em * var(--chr-hand-scale, 1)); }
.is-diary .chr-era-tag strong { font-size: calc(1.2em * var(--chr-hand-scale, 1)); font-weight: 400; }
.is-diary .chr-birth { font-size: calc(0.95em * var(--chr-hand-scale, 1)); }
.is-diary .chr-d-date { font-size: calc(0.85em * var(--chr-hand-scale, 1)); }
.is-diary .chr-d-cal-y { font-family: var(--chr-hand); font-size: calc(1.7em * var(--chr-hand-scale, 1)); font-weight: 400; }
.is-diary .chr-d-cal-m li { font-family: var(--chr-hand); font-size: calc(1.05em * var(--chr-hand-scale, 1)); }
.is-diary .chr-year-pill span { font-family: var(--chr-hand); font-size: calc(0.75em * var(--chr-hand-scale, 1)); }

/* + 카드 제목·간단한 정보 */
.is-diary.hand-titles .chr-card-tit,
.is-diary.hand-all .chr-card-tit,
.is-diary.hand-titles .chr-d-tit,
.is-diary.hand-all .chr-d-tit {
    font-family: var(--chr-hand);
    font-weight: 400;
    font-size: calc(1.08em * var(--chr-hand-scale, 1));
}
.is-diary.hand-titles .chr-d-tit,
.is-diary.hand-all .chr-d-tit { font-size: calc(1.45em * var(--chr-hand-scale, 1)); }
.is-diary.hand-titles .chr-card-note,
.is-diary.hand-all .chr-card-note,
.is-diary.hand-titles .chr-note-text,
.is-diary.hand-all .chr-note-text {
    font-family: var(--chr-hand);
    font-weight: 400;
    font-size: calc(0.95em * var(--chr-hand-scale, 1));
}
.is-diary.hand-titles .chr-card-note,
.is-diary.hand-all .chr-card-note { font-size: calc(0.92em * var(--chr-hand-scale, 1)); }

/* + 본문까지 */
.is-diary.hand-all .chr-card-sum,
.is-diary.hand-all .chr-d-summary,
.is-diary.hand-all .chr-d-con {
    font-family: var(--chr-hand);
    font-size: calc(0.95em * var(--chr-hand-scale, 1));
}
.is-diary.hand-all .chr-d-con { font-size: calc(1em * var(--chr-hand-scale, 1)); line-height: 1.7; }

/* 종이 그림자: 덜 번지게 해서 아래가 잘리지 않게 */
.is-diary .chr-paper-shade {
    filter: drop-shadow(0 1px 1.5px rgba(60, 40, 10, 0.16)) drop-shadow(0 4px 5px rgba(60, 40, 10, 0.12));
}
#bo_list.chr-board.is-diary { padding-bottom: 12px; }

/* 펼친 글 오른쪽 위 버튼: 오른쪽 여백을 왼쪽 여백과 같게 */
.chr-d-item .chr-d-head { padding-right: 96px; }
.chr-d-item .chr-d-links,
.chr-d-item + .chr-d-item .chr-d-links { top: -4px; right: -6px; }
.chr-d-links .btn { margin: 0; }

/* 펼친 글의 날짜는 본문 글꼴 */
.chr-d-meta .chr-d-date,
.is-diary .chr-d-date {
    font-family: var(--content-font-family, inherit) !important;
    font-size: 0.82em !important;
    font-weight: 600;
}

/* 설정창: 캐릭터 설정 접기 */
.chr-cfg-fold { margin: 0 0 12px; border: 1px solid rgba(0, 0, 0, 0.12); border-radius: 10px; padding: 0 10px; }
.chr-cfg-fold > summary {
    padding: 10px 4px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.chr-cfg-fold > summary::-webkit-details-marker { display: none; }
.chr-cfg-fold > summary::before { content: "▸"; font-size: 0.85em; opacity: 0.6; transition: rotate .15s ease; }
.chr-cfg-fold[open] > summary::before { rotate: 90deg; }
.chr-cfg-fold > .chr-cfg-set { margin-bottom: 10px; }
.chr-cfg-set .chr-cfg-row { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.92em; }
.chr-cfg-checks { flex-wrap: wrap; gap: 6px 14px; }
.chr-cfg-checks label { display: inline-flex !important; align-items: center; gap: 4px; margin: 0 !important; grid-template-columns: none !important; }
.chr-cfg-inline .chr-cfg-y { width: 84px; }
@media (max-width: 640px) { .chr-cfg-set .chr-cfg-row { grid-template-columns: 1fr; gap: 4px; } }

/* 기념일 표시 (100일·1주년…) */
.chr-ann { --chr-c: #e58fa8; }
.chr-ann.is-start { --chr-c: #d9667f; font-weight: 800; }
.chr-ann-ico { color: #d9466a; }

/* 탄생·기념일 표시가 'n월' 글씨나 카드와 겹치지 않게 */
.chr-m.is-mark .chr-birth { top: calc(var(--chr-half) + 16px); }
.chr-m.has-ev.is-up .chr-birth { top: calc(var(--chr-half) + 42px); }
.chr-m.has-ev.is-down .chr-birth {
    top: auto;
    bottom: calc(100% - var(--chr-half) + 42px);
    margin-top: 0;
    margin-bottom: calc(var(--chr-i, 0) * 26px);
}
.chr-birth { white-space: nowrap; z-index: 3; }
.chr-m.is-mark.is-ann { width: 150px; }

/* 연표 바꾸기 버튼: 점선 대신 실선 */
.is-diary .chr-switch { border-style: solid; }

/* 연도 이름표: 안쪽 점선 없앰 */
.is-diary .chr-year-pill,
.is-diary button.chr-year-pill:hover,
.is-diary button.chr-year-pill.is-active { outline: 0; }

/* 간단한 정보 포스트잇: 오른쪽 아래 모서리가 안쪽으로 접힌 모양 */
.is-diary .chr-card.is-note-card {
    --chr-note-bg: color-mix(in srgb, var(--chr-c) 20%, #fff8dc);
    --chr-note-fold: color-mix(in srgb, var(--chr-c) 9%, #fffdf2);
    border-radius: 2px;
    background: linear-gradient(-45deg, transparent 11px, var(--chr-note-bg) 11px);
    box-shadow: none;
    filter: drop-shadow(0 1px 1px rgba(60, 40, 10, 0.14)) drop-shadow(0 4px 6px rgba(60, 40, 10, 0.10));
}
.is-diary .chr-card.is-note-card::after {
    /* 접혀 올라온 뒷면 (앞면보다 살짝 밝은 종이 + 접힌 선의 옅은 그림자) */
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 16px;
    height: 16px;
    background: linear-gradient(to left top, transparent 50%, var(--chr-note-fold) 50%);
    border-radius: 0 0 0 3px;
    filter: drop-shadow(-1px -1px 0.6px rgba(60, 40, 10, 0.12));
    pointer-events: none;
}
.is-diary .chr-card.is-note-card:hover { box-shadow: none; }
.is-diary .chr-card.is-note-card.is-active { box-shadow: none; outline: 2px solid color-mix(in srgb, var(--chr-c) 60%, transparent); outline-offset: 1px; }

/* 기념일 표시: 하트 달린 작은 말풍선 쪽지 */
.chr-birth.chr-ann {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-width: 46px;
    padding: 7px 9px 4px;
    border: 1.5px solid #e48aa2;
    border-radius: 7px;
    background: #fffafb;
    box-shadow: 0 1px 2px rgba(120, 40, 60, 0.15);
    color: #8c3a52;
    font-family: var(--chr-hand, inherit);
    line-height: 1.1;
    text-align: center;
    rotate: -2deg;
    margin-top: calc(var(--chr-i, 0) * 46px);
}
.chr-birth.chr-ann b { font-size: calc(1.05em * var(--chr-hand-scale, 1)); font-weight: 700; }
.chr-birth.chr-ann small { font-size: calc(0.78em * var(--chr-hand-scale, 1)); opacity: 0.8; margin-top: 1px; }
/* 위쪽 하트 */
.chr-ann-heart {
    position: absolute;
    left: 50%;
    top: -9px;
    translate: -50% 0;
    color: #e0577a;
    font-size: 13px;
    line-height: 1;
    text-shadow: 0 0 0 #fffafb, 1.5px 0 0 #fffafb, -1.5px 0 0 #fffafb, 0 1.5px 0 #fffafb;
}
/* 말풍선 꼬리: 연표 선 쪽(아래 표시는 위로, 위 표시는 아래로) */
.chr-birth.chr-ann::after {
    content: "";
    position: absolute;
    left: 10px;
    top: -5px;
    width: 8px;
    height: 8px;
    background: #fffafb;
    border-left: 1.5px solid #e48aa2;
    border-top: 1.5px solid #e48aa2;
    rotate: 45deg;
    z-index: -1;
}
.chr-m.has-ev.is-down .chr-birth.chr-ann::after { top: auto; bottom: -5px; rotate: 225deg; }
.chr-m.has-ev.is-down .chr-birth.chr-ann { margin-bottom: calc(var(--chr-i, 0) * 46px); }
.chr-birth.chr-ann.is-start { border-color: #d9466a; background: #fff3f6; }
.chr-m.is-mark.is-ann { width: 96px; }

/* ==========================================================
 * 기념일 표시: 홈페이지 D-day 위젯 말풍선과 같은 모양
 *  (위젯 설정의 말풍선 색·하트 색·글씨 색·글꼴을 그대로 씀)
 * ========================================================== */
.chr-ann {
    position: absolute;
    left: 50%;
    top: calc(var(--chr-half) + 18px + var(--chr-i, 0) * 54px);
    translate: -50% 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 6px 10px 5px;
    font-family: var(--f-pre, var(--content-font-family, inherit));
    background: var(--tip-bg, rgb(from var(--bg-color, #ffffff) r g b / 92%));
    border: 1px solid var(--bg-glass-dark, rgba(0, 0, 0, 0.12));
    border-radius: var(--card-border-radius, 8px);
    box-shadow: var(--shadow-glass, 0 4px 14px rgba(0, 0, 0, 0.12));
    white-space: nowrap;
    line-height: 1;
}
/* 꼬리: 연표 선 쪽 */
.chr-ann::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -5px;
    width: 9px;
    height: 9px;
    background: inherit;
    border-left: 1px solid var(--bg-glass-dark, rgba(0, 0, 0, 0.12));
    border-top: 1px solid var(--bg-glass-dark, rgba(0, 0, 0, 0.12));
    transform: translateX(-50%) rotate(45deg);
}
.chr-ann-heart {
    font-size: calc(var(--tip-size, 14px) * 0.8);
    line-height: 1;
    color: var(--tip-heart, var(--accent-color, #e0577a));
}
.chr-ann-count {
    font-family: var(--tip-font, inherit);
    font-size: calc(var(--tip-size, 14px) * 0.88);
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--tip-text, var(--content-font-color, #333));
}
.chr-ann-date {
    font-size: 10px;
    line-height: 1.1;
    opacity: 0.6;
    color: var(--tip-text, var(--content-font-color, #333));
    font-variant-numeric: tabular-nums;
}
/* 카드가 아래쪽에 있는 달에서는 위쪽에 (꼬리는 아래로) */
.chr-m.has-ev.is-down .chr-ann { top: auto; bottom: calc(100% - var(--chr-half) + 40px + var(--chr-i, 0) * 54px); }
.chr-m.has-ev.is-down .chr-ann::after { top: auto; bottom: -5px; transform: translateX(-50%) rotate(225deg); }
.chr-m.has-ev.is-up .chr-ann { top: calc(var(--chr-half) + 40px + var(--chr-i, 0) * 54px); }
.chr-m.is-mark.is-ann { width: 80px; }
.chr-ann .chr-ann-heart { position: static; translate: none; top: auto; left: auto; text-shadow: none; }
.chr-ann::before { display: none; }

/* 기념일 말풍선: 위젯 색·그림자는 따르지 않고 깨끗한 흰색, 크기 조금 작게 */
.chr-ann {
    gap: 0;
    padding: 4px 8px 3px;
    background: #fffefd;
    border: 1px solid rgba(232, 120, 150, 0.35);
    border-radius: 7px;
    box-shadow: 0 1px 3px rgba(120, 60, 80, 0.12);
    font-family: var(--content-font-family, inherit);
}
.chr-ann::after {
    width: 7px;
    height: 7px;
    top: -4px;
    background: #fffefd;
    border-left: 1px solid rgba(232, 120, 150, 0.35);
    border-top: 1px solid rgba(232, 120, 150, 0.35);
}
.chr-m.has-ev.is-down .chr-ann::after { bottom: -4px; }
.chr-ann .chr-ann-heart { font-size: 9px; color: #f06b8b; }
.chr-ann-count { font-family: inherit; font-size: 11.5px; font-weight: 800; color: #5a4a3c; }
.chr-ann-date { font-size: 9px; color: #8a7a6c; opacity: 1; }
.chr-ann.is-start { border-color: rgba(232, 90, 130, 0.6); background: #fff7f9; }
.chr-ann.is-start::after { background: #fff7f9; border-color: rgba(232, 90, 130, 0.6); }
.chr-m.is-mark.is-ann { width: 68px; }

/* 탄생일: 기념일 말풍선과 같은 모양, 케이크 + 캐릭터 색 */
.chr-ann.chr-born {
    background: color-mix(in srgb, var(--chr-c) 9%, #fffefd);
    border-color: color-mix(in srgb, var(--chr-c) 55%, transparent);
}
.chr-ann.chr-born::after {
    background: color-mix(in srgb, var(--chr-c) 9%, #fffefd);
    border-color: color-mix(in srgb, var(--chr-c) 55%, transparent);
}
.chr-ann-cake { width: 11px; height: 11px; fill: color-mix(in srgb, var(--chr-c) 85%, #000); }
.chr-m.is-mark.is-birth { width: 68px; }

/* 펼친 글 위쪽 이름표·날짜: 조금 위로, 1px 크게 */
.chr-d-item .chr-d-meta { margin-top: 0; position: relative; top: -5px; }   /* 이름표·날짜만 위로 (제목·설명 자리는 그대로) */
.chr-d-item .chr-d-meta .chr-tag { font-size: calc(0.92em + 1px); }
.chr-d-item .chr-d-meta .chr-d-date { font-size: calc(0.82em + 1px) !important; }

/* 같은 달에 여러 개: 연표 선에 가장 가까운 것만 꼭지, 나머지는 꼭지 없이 붙여 쌓기 */
.chr-ann.no-tail::after { display: none; }
.chr-ann { top: calc(var(--chr-half) + 18px + var(--chr-i, 0) * 48px); }
.chr-m.has-ev.is-up .chr-ann { top: calc(var(--chr-half) + 40px + var(--chr-i, 0) * 48px); }
.chr-m.has-ev.is-down .chr-ann { bottom: calc(100% - var(--chr-half) + 40px + var(--chr-i, 0) * 48px); margin-bottom: 0; }

/* 설정창: 기념일 여러 개 */
.chr-ann-set { position: relative; padding-bottom: 14px; }
.chr-ann-row { position: relative; padding: 10px 0 2px; }
.chr-ann-row + .chr-ann-row { border-top: 1px dashed rgba(0, 0, 0, 0.14); margin-top: 6px; }
.chr-ann-del {
    position: absolute;
    right: -4px;
    top: 4px;
    z-index: 1;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.45;
}
.chr-ann-del:hover { opacity: 1; background: rgba(0, 0, 0, 0.06); }
.chr-ann-row > label:first-of-type { padding-right: 24px; }
.chr-ann-add {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 50%;
    background: var(--btn-primary-bg, #8a6d1f);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 26px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.chr-ann-add:hover { filter: brightness(1.08); }
.chr-ann-row [data-ann-dday] { padding-right: 34px; }

/* ==========================================================
 * 연표 선 모양 (설정 > 디자인 > 연표 선 모양)
 * ========================================================== */
.chr-board.line-solid .chr-track::before {
    height: 0;
    margin-top: -1px;
    background: none;
    border-top: 2px solid var(--chr-line);
    opacity: 0.85;
    filter: none;
}
.chr-board.line-dashed .chr-track::before {
    height: 0;
    margin-top: -1px;
    background: none;
    border-top: 2px dashed var(--chr-line);
    opacity: 0.85;
    filter: none;
}
.chr-board.line-pencil .chr-track::before {
    height: 2.4px;
    margin-top: -1.2px;
    border: 0;
    background: var(--chr-line);
    opacity: 0.8;
    filter: url(#chr_pencil_filter);
}

/* ---- 점에서 카드까지 잇는 선을 길게 (카드가 연도 이름표에 닿지 않게) ---- */
.chr-board { --chr-stem: 42px; --chr-half: 324px; }
.chr-m.has-ev::after { height: var(--chr-stem); }
.chr-m.is-up::after { top: calc(var(--chr-half) - var(--chr-stem)); }
.chr-m.is-down::after { top: var(--chr-half); }
.chr-m.is-up .chr-stack { bottom: calc(100% - var(--chr-half) + var(--chr-stem)); }
.chr-m.is-down .chr-stack { top: calc(var(--chr-half) + var(--chr-stem)); }
@media (max-width: 640px) { .chr-board { --chr-half: 250px; --chr-stem: 34px; } }

/* ---- 좌우 화살표: 투명도 80%, 그쪽 가장자리에 마우스를 가까이 댈 때만 ---- */
.chr-nav { opacity: 0; transition: opacity .2s ease; }
.chr-frame.near-left .chr-nav-prev:not(:disabled),
.chr-frame.near-right .chr-nav-next:not(:disabled) { opacity: 0.8; }
.chr-nav:hover:not(:disabled) { opacity: 0.8; }
.chr-nav:disabled { opacity: 0; }

/* ==========================================================
 * 1109: 진짜 연필선 · 쪽지마다 다른 기울기 · 작은 원 표시 · 도트 점선
 * ========================================================== */
/* 연필선: 흑연 결이 보이는 몇 겹의 가는 선 (선 색은 설정의 '연표 선 색') */
.chr-board.line-pencil .chr-track::before {
    height: 12px;
    margin-top: -6px;
    border: 0;
    opacity: 1;
    filter: none;
    background: var(--chr-line);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='12' viewBox='0 0 400 12'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.1 0.6' numOctaves='2' seed='4' stitchTiles='stitch' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='2.2' xChannelSelector='R' yChannelSelector='G' result='d'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7 1.8' numOctaves='2' seed='9' stitchTiles='stitch' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -0.35' result='ga'/%3E%3CfeComposite in='d' in2='ga' operator='in' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.01 0.05' numOctaves='1' seed='2' stitchTiles='stitch' result='v'/%3E%3CfeColorMatrix in='v' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.1' result='va'/%3E%3CfeComposite in='s' in2='va' operator='in'/%3E%3C/filter%3E%3Cg filter='url%28%23p%29' fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M-10 6C60 5.5 120 6.5 200 5.8S330 6.4 410 6' stroke-width='2.6'/%3E%3Cpath d='M-10 6.8C80 7.2 160 6.5 240 7S340 6.7 410 6.8' stroke-width='1.2' opacity='.6'/%3E%3C/g%3E%3C/svg%3E") 0 50% / 400px 12px repeat-x;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='12' viewBox='0 0 400 12'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.1 0.6' numOctaves='2' seed='4' stitchTiles='stitch' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='2.2' xChannelSelector='R' yChannelSelector='G' result='d'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7 1.8' numOctaves='2' seed='9' stitchTiles='stitch' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -0.35' result='ga'/%3E%3CfeComposite in='d' in2='ga' operator='in' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.01 0.05' numOctaves='1' seed='2' stitchTiles='stitch' result='v'/%3E%3CfeColorMatrix in='v' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.1' result='va'/%3E%3CfeComposite in='s' in2='va' operator='in'/%3E%3C/filter%3E%3Cg filter='url%28%23p%29' fill='none' stroke='%23000' stroke-linecap='round'%3E%3Cpath d='M-10 6C60 5.5 120 6.5 200 5.8S330 6.4 410 6' stroke-width='2.6'/%3E%3Cpath d='M-10 6.8C80 7.2 160 6.5 240 7S340 6.7 410 6.8' stroke-width='1.2' opacity='.6'/%3E%3C/g%3E%3C/svg%3E") 0 50% / 400px 12px repeat-x;
}

/* 쪽지·카드마다 각도를 따로 (사람이 하나씩 붙인 느낌) */
.is-diary .chr-stack { rotate: 0deg; }
.is-diary .chr-stack > .chr-card { rotate: var(--ct, 0deg); transition: rotate .2s ease, transform .2s ease; }
.is-diary .chr-stack > .chr-card:hover,
.is-diary .chr-stack > .chr-card.is-active,
.is-diary .chr-stack.is-img-editing > .chr-card { rotate: 0deg; }
.is-diary .chr-stack > .chr-card.is-note-card:nth-of-type(even) { translate: 4px 0; }
.is-diary .chr-stack > .chr-card.is-note-card:nth-of-type(3n) { translate: -5px 0; }

/* 넘치는 쪽지는 '+' 하나만 */
.chr-card.is-note-more { align-self: center; width: auto; min-width: 42px; }
.chr-card.is-note-more .chr-card-body { padding: 3px 12px 5px; align-items: center; }
.chr-card.is-note-more .chr-card-more { margin: 0; font-size: 1.25em; font-weight: 700; line-height: 1; opacity: .8; }
.is-diary .chr-card.is-note-more::after { width: 9px; height: 9px; }
.is-diary .chr-card.is-note-more { background: linear-gradient(-45deg, transparent 6px, var(--chr-note-bg) 6px); }

/* 월 표시 원: 조금 작게 */
.chr-dot { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
.is-diary .chr-dot { width: 12px; height: 12px; margin: -6px 0 0 -6px; box-shadow: 0 0 0 2.5px #fff, 0 1px 3px rgba(60, 40, 10, 0.3); }

/* 탄생일·기념일 자리 표시: 짧은 세로선 → 월보다 작은 원 */
.chr-tick {
    top: var(--chr-half);
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border: 0;
    border-radius: 50%;
    background: var(--chr-line);
    box-shadow: 0 0 0 2px var(--chr-paper, #fbf6ea);
    z-index: 1;
}

/* 점에서 카드까지: 동글동글한 도트 점선 */
.chr-m.has-ev::after,
.is-diary .chr-m.has-ev::after {
    width: 4px;
    margin-left: -2px;
    border: 0;
    opacity: 0.75;
    background: radial-gradient(circle, currentColor 1.4px, transparent 1.9px) 50% 0 / 4px 6px repeat-y;
}

/* ==========================================================
 * 1109-2: 위·아래 칸 길이 맞춤 / 넘치면 옆에 + / 간단한 정보는 양옆 포스트잇
 * ========================================================== */
/* 선 아래 칸도 선 위 칸(검색줄 아래부터)과 같은 길이로 */
.chr-board .chr-track { height: calc(var(--chr-half) * 2 + var(--chr-lane) * 2 - 14px); }

/* 연표 칸에 다 안 들어가는 카드 */
.chr-stack > .chr-card.is-overflow,
.chr-stack > .chr-card.is-overflow + .chr-img-edit { display: none !important; }
.chr-stack-more {
    position: absolute;
    right: -30px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--chr-c, #b0893b);
    font: 700 18px/24px sans-serif;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--chr-c, #b0893b) 70%, transparent), 0 2px 5px rgba(60, 40, 10, 0.18);
    transition: transform .15s ease;
    z-index: 3;
}
.chr-stack-more:hover { transform: scale(1.12); }
.chr-m.is-up .chr-stack-more { top: 0; }
.chr-m.is-down .chr-stack-more { bottom: 0; }

.chr-d-full { font-size: 0.85em; opacity: 0.7; }

/* 양옆 포스트잇 */
.chr-side { position: static; }
.chr-side-col {
    position: fixed;
    z-index: 60;
    width: var(--chr-side-w, 220px);
    display: flex;
    flex-direction: column;
    gap: 26px;
    pointer-events: none;
}
.chr-side-col.is-left { align-items: flex-end; }
.chr-postit {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 20px 16px 22px;
    list-style: none;
    color: #4a3d2c;
    --chr-pi-bg: color-mix(in srgb, var(--chr-c) 26%, #fff6cf);
    --chr-pi-fold: color-mix(in srgb, var(--chr-c) 12%, #fffdf2);
    background: linear-gradient(-45deg, transparent 15px, var(--chr-pi-bg) 15px);
    filter: drop-shadow(0 1px 1px rgba(60, 40, 10, 0.16)) drop-shadow(0 8px 12px rgba(40, 25, 5, 0.22));
    rotate: var(--pr, 0deg);
    pointer-events: auto;
    animation: chr-postit-in .28s cubic-bezier(.2, .9, .3, 1.2) both;
}
.chr-side-col > .chr-postit:nth-child(2) { animation-delay: .06s; }
@keyframes chr-postit-in { from { opacity: 0; transform: translateY(-10px) scale(.96); } }
.chr-postit::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 21px;
    height: 21px;
    background: linear-gradient(to left top, transparent 50%, var(--chr-pi-fold) 50%);
    border-radius: 0 0 0 4px;
    filter: drop-shadow(-1px -1px 0.8px rgba(60, 40, 10, 0.14));
}
.chr-postit-tape {
    position: absolute;
    top: -11px;
    left: 50%;
    width: 74px;
    height: 22px;
    margin-left: -37px;
    background: rgba(240, 226, 180, 0.78);
    rotate: calc(var(--pr, 0deg) * -1.4);
    box-shadow: 0 1px 1px rgba(60, 40, 10, 0.08);
}
.chr-postit-x {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 17px;
    line-height: 22px;
    opacity: 0;
    cursor: pointer;
    transition: opacity .15s;
}
.chr-postit:hover .chr-postit-x { opacity: .55; }
.chr-postit-x:hover { opacity: 1 !important; }
.chr-postit-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 12px; }
.chr-postit .chr-chip {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--chr-c);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.6;
}
.chr-postit-date { opacity: .7; letter-spacing: .02em; }
.chr-postit-text {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.55;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
.chr-side.is-diary .chr-postit-text,
.chr-side.is-diary .chr-postit-date { font-family: var(--chr-hand, inherit); }
.chr-side.is-diary .chr-postit-text { font-size: calc(17px * var(--chr-hand-scale, 1)); font-weight: 400; }
.chr-postit .chr-note-ico { display: inline-block; margin-right: 5px; color: var(--chr-c); vertical-align: -0.12em; }
.chr-postit .chr-note-ico .chr-ico { width: 1em; height: 1em; }
.chr-postit .chr-note-tools {
    position: absolute;
    right: 24px;
    bottom: 3px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity .15s;
}
.chr-postit:hover .chr-note-tools { opacity: 1; }
.chr-postit .chr-note-tools button {
    width: 24px; height: 24px; padding: 0; border: 0; background: none;
    color: inherit; opacity: .6; cursor: pointer;
}
.chr-postit .chr-note-tools button:hover { opacity: 1; }
/* 포스트잇 안에서 고치기 */
.chr-postit.is-editing { rotate: 0deg; }
.chr-postit .chr-note-form { display: flex; flex-wrap: wrap; gap: 5px; }
.chr-postit .chr-note-form .frm_input { height: 30px; padding: 0 6px; min-width: 0; }
.chr-postit .chr-note-form [data-f="y"] { width: 64px; }
.chr-postit .chr-note-form [data-f="d"] { width: 48px; }
.chr-postit .chr-note-form [data-f="text"] { flex: 1 1 100%; }
.chr-postit .chr-note-form .btn { height: 30px; padding: 0 10px; }
.chr-postit .chr-icopick { flex: 1 1 100%; }
.chr-side .chr-postit { display: block; margin: 0; border: 0; border-radius: 2px; }

/* ==========================================================
 * 1109-3: 테이프 안 겹치게 / 잇는 선·원도 연표 선 모양 따라 / 포스트잇 따로따로
 * ========================================================== */
/* 사진 카드의 마스킹테이프가 바로 앞 쪽지에 겹치지 않게 간격 벌리기 */
.is-diary .chr-stack > .chr-card + .chr-card:not(.is-note-card) { margin-top: 12px; }
.is-diary .chr-stack > .chr-img-edit + .chr-card { margin-top: 12px; }
.is-diary .chr-stack > .chr-card:not(.is-note-card) + .chr-img-edit + .chr-card.is-note-card,
.is-diary .chr-stack > .chr-card:not(.is-note-card) + .chr-card.is-note-card { margin-top: 0; }

/* 점에서 카드까지 잇는 선: 연표 선과 같은 모양, 조금 더 가늘게 */
.chr-board .chr-m.has-ev::after {
    border: 0;
    background: none;
    opacity: 0.85;
    filter: none;
}
.chr-board.line-solid .chr-m.has-ev::after {
    width: 1.5px;
    margin-left: -0.75px;
    background: var(--chr-line);
}
.chr-board.line-dashed .chr-m.has-ev::after {
    width: 0;
    margin-left: -0.75px;
    border-left: 1.5px dashed var(--chr-line);
}
.chr-board.line-pencil .chr-m.has-ev::after {
    width: 1.7px;
    margin-left: -0.85px;
    background: var(--chr-line);
    filter: url(#chr_pencil_filter);
}

/* 월 표시 원 · 기념일 자리 원도 선 모양에 맞춰 */
.chr-board.line-solid .chr-tick { background: var(--chr-line); }
.chr-board.line-dashed .is-diary .chr-dot,
.chr-board.line-dashed .chr-dot {
    box-shadow: 0 0 0 2px #fff;
    outline: 1.5px dashed var(--chr-c);
    outline-offset: 2.5px;
}
.chr-board.line-dashed .chr-tick {
    width: 9px;
    height: 9px;
    margin: -4.5px 0 0 -4.5px;
    box-sizing: border-box;
    background: #fff;
    border: 1.5px dashed var(--chr-line);
    box-shadow: none;
}
.chr-board.line-pencil .chr-dot {
    box-shadow: 0 0 0 2px #fff, 0 0 0 3.4px var(--chr-c);
    filter: url(#chr_pencil_filter);
}
.chr-board.line-pencil .chr-tick {
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    box-shadow: 0 0 0 1.5px #fff;
    filter: url(#chr_pencil_filter);
}

/* 포스트잇: 한 장씩 빈 곳에 (테이프 없이) */
.chr-side .chr-postit {
    position: fixed;
    width: var(--chr-side-w, 220px);
    z-index: 60;
}
.chr-postit-tape { display: none; }
.chr-postit [data-note-text] { border-radius: 3px; }
.chr-postit [data-note-text][contenteditable],
.chr-note-row [data-note-text][contenteditable] {
    display: inline-block;
    min-width: 3em;
    outline: 1.5px dashed color-mix(in srgb, var(--chr-c) 70%, #6b5a40);
    outline-offset: 3px;
    background: rgba(255, 255, 255, 0.45);
    cursor: text;
}
.chr-postit.is-typing, .chr-postit.is-editing { rotate: 0deg; }
.chr-postit.is-typing .chr-note-tools, .chr-postit.is-typing .chr-postit-x { display: none; }
.chr-postit .chr-note-form [data-f="t"] { flex: 1 1 auto; }
.chr-note-form-btns { display: flex; gap: 5px; flex: 1 1 100%; justify-content: flex-end; }

/* 아래 펼침: 달마다 머리에 '접기' */
.chr-d-cal { position: relative; }
.chr-d-sec-x {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    font-size: 18px;
    line-height: 26px;
    opacity: 0.45;
    cursor: pointer;
}
.chr-d-sec-x:hover { opacity: 0.9; background: rgba(0, 0, 0, 0.05); }
.chr-detail-inner > .chr-d-cal ~ .chr-d-cal { margin-top: 26px; }

/* 간단한 정보 추가 줄: 날짜(일)까지 */
.chr-d-quick { flex-wrap: wrap; }
.chr-d-when { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9em; white-space: nowrap; }
.chr-d-when b { font-weight: 600; opacity: 0.8; }
.chr-d-when [data-f="d"] { width: 58px; }

/* 포스트잇 글 영역 어디를 눌러도 고치기 */
.chr-postit-text { display: flex; align-items: flex-start; gap: 0; min-height: 1.6em; }
.chr-postit-text .chr-note-ico { flex: none; margin-top: .1em; }
.chr-postit-text [data-note-text] { flex: 1 1 auto; min-width: 0; min-height: 1.5em; white-space: pre-wrap; }
.chr-postit-text:has([data-note-text][title]) { cursor: text; }
.chr-postit-text:has([data-note-text][title]):hover [data-note-text] { background: rgba(255, 255, 255, 0.28); }
.chr-postit [data-note-text][contenteditable] { display: block; min-width: 0; }

/* 연필선일 때 카드와 잇는 선도 연필로 그은 듯 (연표 선보다 가늘게, 살짝 삐뚤빼뚤) */
.chr-board.line-pencil .chr-m.has-ev::after {
    width: 16px;
    margin-left: -8px;
    background: var(--chr-line);
    filter: none;
    opacity: 0.9;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='180' viewBox='0 0 16 180'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.08' numOctaves='2' seed='5' stitchTiles='stitch' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='2.3' xChannelSelector='R' yChannelSelector='G' result='d'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.8 0.7' numOctaves='2' seed='11' stitchTiles='stitch' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -0.3' result='ga'/%3E%3CfeComposite in='d' in2='ga' operator='in' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.05 0.012' numOctaves='1' seed='3' stitchTiles='stitch' result='v'/%3E%3CfeColorMatrix in='v' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.05' result='va'/%3E%3CfeComposite in='s' in2='va' operator='in'/%3E%3C/filter%3E%3Cg filter='url%28%23p%29' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.0 -4C6.35 8 9.38 14 7.34 26S9.65 40 8.33 50 5.91 62 7.12 74 9.98 86 8.77 98 6.35 110 6.79 122 9.54 136 8.55 148 6.68 162 7.45 172 8.0 184' stroke-width='1.6'/%3E%3Cpath d='M8.44 -4C9.38 16 7.01 30 8.22 52S9.65 88 7.78 112 6.9 150 8.66 168 8.44 184' stroke-width='.8' opacity='.5'/%3E%3C/g%3E%3C/svg%3E") 50% 0 / 16px 180px repeat-y;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='180' viewBox='0 0 16 180'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.5 0.08' numOctaves='2' seed='5' stitchTiles='stitch' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='2.3' xChannelSelector='R' yChannelSelector='G' result='d'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.8 0.7' numOctaves='2' seed='11' stitchTiles='stitch' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -0.3' result='ga'/%3E%3CfeComposite in='d' in2='ga' operator='in' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.05 0.012' numOctaves='1' seed='3' stitchTiles='stitch' result='v'/%3E%3CfeColorMatrix in='v' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.05' result='va'/%3E%3CfeComposite in='s' in2='va' operator='in'/%3E%3C/filter%3E%3Cg filter='url%28%23p%29' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.0 -4C6.35 8 9.38 14 7.34 26S9.65 40 8.33 50 5.91 62 7.12 74 9.98 86 8.77 98 6.35 110 6.79 122 9.54 136 8.55 148 6.68 162 7.45 172 8.0 184' stroke-width='1.6'/%3E%3Cpath d='M8.44 -4C9.38 16 7.01 30 8.22 52S9.65 88 7.78 112 6.9 150 8.66 168 8.44 184' stroke-width='.8' opacity='.5'/%3E%3C/g%3E%3C/svg%3E") 50% 0 / 16px 180px repeat-y;
}

/* 연표 연필선: 잇는 선만큼 삐뚤빼뚤하게 */
.chr-board.line-pencil .chr-track::before {
    height: 14px;
    margin-top: -7px;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='14' viewBox='0 0 400 14'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.1 0.6' numOctaves='2' seed='4' stitchTiles='stitch' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='2.2' xChannelSelector='R' yChannelSelector='G' result='d'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7 1.8' numOctaves='2' seed='9' stitchTiles='stitch' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -0.35' result='ga'/%3E%3CfeComposite in='d' in2='ga' operator='in' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.01 0.05' numOctaves='1' seed='2' stitchTiles='stitch' result='v'/%3E%3CfeColorMatrix in='v' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.1' result='va'/%3E%3CfeComposite in='s' in2='va' operator='in'/%3E%3C/filter%3E%3Cg filter='url%28%23p%29' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M-4 7C0.2 6.91 12.7 6.63 21 6.44C29.3 6.25 37.7 5.71 46 5.88C54.3 6.05 62.7 7.52 71 7.48C79.3 7.44 87.7 5.69 96 5.63C104.3 5.57 112.7 6.95 121 7.11C129.3 7.27 137.7 6.82 146 6.57C154.3 6.32 162.7 5.51 171 5.59C179.3 5.67 187.7 7.03 196 7.02C204.3 7.01 212.7 5.56 221 5.52C229.3 5.48 237.7 6.77 246 6.79C254.3 6.81 262.7 5.8 271 5.62C279.3 5.44 287.7 5.5 296 5.69C304.3 5.88 312.7 6.37 321 6.76C329.3 7.15 337.7 8.21 346 8.05C354.3 7.89 361.3 5.97 371 5.8C380.7 5.62 398.5 6.8 404 7' stroke-width='2.6'/%3E%3Cpath d='M-4 7.7C3.5 7.57 26.0 6.87 41 6.93C56.0 6.99 71.0 7.72 86 8.06C101.0 8.4 116.0 8.97 131 8.95C146.0 8.93 161.0 8.18 176 7.92C191.0 7.66 206.0 7.23 221 7.41C236.0 7.59 251.0 9.19 266 9.03C281.0 8.87 296.0 6.48 311 6.43C326.0 6.38 340.5 8.49 356 8.7C371.5 8.91 396.0 7.87 404 7.7' stroke-width='1.2' opacity='.6'/%3E%3C/g%3E%3C/svg%3E") 0 50% / 400px 14px repeat-x;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='14' viewBox='0 0 400 14'%3E%3Cfilter id='p' x='0' y='0' width='100%25' height='100%25' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.1 0.6' numOctaves='2' seed='4' stitchTiles='stitch' result='w'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='w' scale='2.2' xChannelSelector='R' yChannelSelector='G' result='d'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7 1.8' numOctaves='2' seed='9' stitchTiles='stitch' result='g'/%3E%3CfeColorMatrix in='g' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2.2 0 0 0 -0.35' result='ga'/%3E%3CfeComposite in='d' in2='ga' operator='in' result='s'/%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.01 0.05' numOctaves='1' seed='2' stitchTiles='stitch' result='v'/%3E%3CfeColorMatrix in='v' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 0 0 0 -0.1' result='va'/%3E%3CfeComposite in='s' in2='va' operator='in'/%3E%3C/filter%3E%3Cg filter='url%28%23p%29' fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M-4 7C0.2 6.91 12.7 6.63 21 6.44C29.3 6.25 37.7 5.71 46 5.88C54.3 6.05 62.7 7.52 71 7.48C79.3 7.44 87.7 5.69 96 5.63C104.3 5.57 112.7 6.95 121 7.11C129.3 7.27 137.7 6.82 146 6.57C154.3 6.32 162.7 5.51 171 5.59C179.3 5.67 187.7 7.03 196 7.02C204.3 7.01 212.7 5.56 221 5.52C229.3 5.48 237.7 6.77 246 6.79C254.3 6.81 262.7 5.8 271 5.62C279.3 5.44 287.7 5.5 296 5.69C304.3 5.88 312.7 6.37 321 6.76C329.3 7.15 337.7 8.21 346 8.05C354.3 7.89 361.3 5.97 371 5.8C380.7 5.62 398.5 6.8 404 7' stroke-width='2.6'/%3E%3Cpath d='M-4 7.7C3.5 7.57 26.0 6.87 41 6.93C56.0 6.99 71.0 7.72 86 8.06C101.0 8.4 116.0 8.97 131 8.95C146.0 8.93 161.0 8.18 176 7.92C191.0 7.66 206.0 7.23 221 7.41C236.0 7.59 251.0 9.19 266 9.03C281.0 8.87 296.0 6.48 311 6.43C326.0 6.38 340.5 8.49 356 8.7C371.5 8.91 396.0 7.87 404 7.7' stroke-width='1.2' opacity='.6'/%3E%3C/g%3E%3C/svg%3E") 0 50% / 400px 14px repeat-x;
}

/* '+'는 카드에서 조금 더 오른쪽으로 */
.chr-stack-more { right: -44px; }
/* 이미지 편집 버튼: 사진 카드 왼쪽 위 바깥 옆에 (위치는 스크립트가 카드 높이에 맞춰 잡음) */
.chr-stack > .chr-img-edit,
.is-diary .chr-stack > .chr-img-edit,
.chr-m.is-up .chr-stack > .chr-img-edit { left: -40px; right: auto; top: var(--chr-ie-top, 6px); }

/* 중요 사건: 두 번 눌러 바로 고치기 (쓴 사람·관리자) */
[data-ev-edit] .chr-d-tit,
[data-ev-edit] .chr-d-summary,
[data-ev-edit] .chr-d-con[data-ev-field] { cursor: text; border-radius: 4px; transition: background-color .15s; }
[data-ev-edit] .chr-d-tit:hover,
[data-ev-edit] .chr-d-summary:hover,
[data-ev-edit] .chr-d-con[data-ev-field]:hover { background-color: rgba(255, 236, 170, 0.18); }
[data-ev-edit] .chr-d-con[data-ev-field] { min-height: 2.4em; }
.chr-d-summary.is-empty::before { content: attr(data-placeholder); opacity: 0; font-style: normal; transition: opacity .15s; }
[data-ev-edit]:hover .chr-d-summary.is-empty::before { opacity: 0.4; }
.chr-d-summary.is-empty { min-height: 1.4em; }
[data-ev-edit] .is-typing {
    outline: 1.5px dashed color-mix(in srgb, var(--chr-line, #8a7a5c) 80%, transparent);
    outline-offset: 4px;
    background: rgba(255, 255, 255, 0.6) !important;
    white-space: pre-wrap;
}
.chr-d-tit-text.is-typing { display: inline-block; min-width: 4em; }
.chr-d-coned { margin: 8px 0 4px; }
.chr-d-coned textarea {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font: inherit;
    line-height: 1.7;
    resize: vertical;
    border: 1.5px dashed color-mix(in srgb, var(--chr-line, #8a7a5c) 70%, transparent);
    background: rgba(255, 255, 255, 0.75);
}
.chr-d-coned-bar { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.chr-d-coned-hint { margin-right: auto; font-size: 0.8em; opacity: 0.55; }
.chr-d-coned-bar .btn { height: 32px; padding: 0 14px; }

/* 중요 사건 바로 고치기: 마우스를 올려도 겉모습은 그대로 (더블클릭만) */
[data-ev-edit] .chr-d-tit,
[data-ev-edit] .chr-d-summary,
[data-ev-edit] .chr-d-con[data-ev-field] { cursor: auto; transition: none; }
[data-ev-edit] .chr-d-tit:hover,
[data-ev-edit] .chr-d-summary:hover,
[data-ev-edit] .chr-d-con[data-ev-field]:hover { background-color: transparent; }
.chr-d-summary.is-empty::before,
[data-ev-edit]:hover .chr-d-summary.is-empty::before { content: none; }

/* '+'는 그 달 카드에 마우스를 올렸을 때만 */
.chr-stack-more { opacity: 0; transition: opacity .2s ease .8s, transform .15s ease; }   /* 카드→'+'로 옮겨 가는 사이 바로 사라지지 않게 살짝 늦게 숨김 */
.chr-stack:hover .chr-stack-more,
.chr-stack-more:focus-visible { opacity: 1; transition-delay: 0s; }

/* 이미지 편집 버튼은 그 중요 사건 카드에 마우스를 올렸을 때만 (옮겨 가는 사이 잠깐 남아 있음) */
.chr-stack .chr-img-edit,
.chr-stack:hover .chr-img-edit { opacity: 0; transition: opacity .2s ease .8s; }
.chr-stack > .chr-card:not(.is-note-card):hover + .chr-img-edit,
.chr-stack .chr-img-edit:hover,
.chr-stack .chr-img-edit:focus-visible { opacity: 1; transition-delay: 0s; }

/* '+' 위치: 조금 왼쪽, 카드 끝보다 살짝 바깥(아래로 뜨는 달은 아래, 위로 뜨는 달은 위) */
.chr-stack-more { right: -32px; }
.chr-m.is-down .chr-stack-more { bottom: -14px; top: auto; }
.chr-m.is-up .chr-stack-more { top: -14px; bottom: auto; }

/* 연표를 12px 위로: 위·아래로 실제로 카드가 들어가는 칸 높이를 똑같이 맞춤
   (아래 칸은 수첩 아래 여백만큼 덜 쓰이므로 그만큼 올림) — 시기 이름표 줄이 쓰이지 않을 때만 */
.chr-top { position: relative; z-index: 7; }
.chr-board:not(.has-eras) .chr-frame { margin-top: -12px; }
.chr-board:not(.has-eras) .chr-track { height: calc(var(--chr-half) * 2 + var(--chr-lane) * 2 - 14px + 12px); }

/* 검색줄의 빈 곳이 바로 아래 카드·'+'의 클릭을 가로채지 않게 */
.chr-top { pointer-events: none; }
.chr-top > * { pointer-events: auto; }

/* 연표 안의 빈 곳(달 칸·카드 묶음·연도 칸)은 클릭이 통과하고, 실제 누를 것만 클릭을 받음 */
.chr-track .chr-year,
.chr-track .chr-m,
.chr-track .chr-stack,
.chr-track .chr-year-head { pointer-events: none; }
.chr-track button,
.chr-track a,
.chr-track .chr-card,
.chr-track .chr-ann,
.chr-track .chr-year-pill,
.chr-track .chr-era-tag,
.chr-track [data-add-year],
.chr-track .chr-img-bar { pointer-events: auto; }

/* 추가 칸만 펼쳐질 때 오른쪽 위 닫기(×)와 겹치지 않게 아래로 */
.chr-detail-inner > .chr-d-addrow:first-child { margin-top: 44px; }
.chr-detail-close { z-index: 5; }

/* 간단한 정보 추가 줄: 양옆 여백과 칸 사이 간격 넉넉하게 */
.chr-detail-inner > .chr-d-addrow,
.is-diary .chr-detail-inner > .chr-d-addrow { padding: 16px 32px; gap: 14px 18px; }
.chr-d-addrow .chr-d-quick { gap: 10px; }
.chr-d-addrow .chr-d-when { gap: 8px; margin: 0 4px; }

/* 손글씨 쓰는 곳 = 연도만: 연도 숫자(연표 이름표·펼친 다이어리 머리)만 손글씨, 나머지는 기본 글꼴 */
.is-diary.hand-years .chr-ev-date,
.is-diary.hand-years .chr-era-tag,
.is-diary.hand-years .chr-era-tag strong,
.is-diary.hand-years .chr-birth,
.is-diary.hand-years .chr-switch,
.is-diary.hand-years .chr-d-month,
.is-diary.hand-years .chr-d-date,
.is-diary.hand-years .chr-sr-date,
.is-diary.hand-years .chr-d-cal-m li,
.is-diary.hand-years .chr-year-pill span,
.chr-side.is-diary.hand-years .chr-postit-text,
.chr-side.is-diary.hand-years .chr-postit-date { font-family: inherit; --chr-hand-scale: 1; }
.chr-side.is-diary.hand-years .chr-postit-text { font-size: 15px; font-weight: 600; }

/* 설정 > 연도 아래 나이: 숨기기 */
.chr-board.no-age .chr-year-pill span { display: none; }

/* 설정 > 포스트잇 색: 한 가지 색으로 (연표 위 쪽지 + 양옆 포스트잇) */
.chr-board.note-one .chr-card.is-note-card { --chr-note-bg: var(--chr-note-color, #fbe9a8); }
.chr-side.note-one .chr-postit {
    --chr-pi-bg: var(--chr-note-color, #fbe9a8);
    --chr-pi-fold: color-mix(in srgb, var(--chr-note-color, #fbe9a8) 45%, #fffdf2);
}
.chr-board.note-one .chr-card.is-note-card { --chr-note-fold: color-mix(in srgb, var(--chr-note-color, #fbe9a8) 45%, #fffdf2); }
.chr-cfg-pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chr-cfg-pair select { flex: 1 1 auto; min-width: 0; }
.chr-cfg-pair input[type="color"] { flex: none; }

/* 포스트잇 색: 노란 바탕을 섞지 않고 연표(인물) 색을 흰색으로만 옅게 */
.is-diary .chr-card.is-note-card {
    --chr-note-bg: color-mix(in srgb, var(--chr-c) 22%, #fff);
    --chr-note-fold: color-mix(in srgb, var(--chr-c) 9%, #fff);
}
.chr-postit {
    --chr-pi-bg: color-mix(in srgb, var(--chr-c) 26%, #fff);
    --chr-pi-fold: color-mix(in srgb, var(--chr-c) 11%, #fff);
}
.chr-board.note-one .chr-card.is-note-card {
    --chr-note-bg: var(--chr-note-color, #fbe9a8);
    --chr-note-fold: color-mix(in srgb, var(--chr-note-color, #fbe9a8) 45%, #fff);
}
.chr-side.note-one .chr-postit {
    --chr-pi-bg: var(--chr-note-color, #fbe9a8);
    --chr-pi-fold: color-mix(in srgb, var(--chr-note-color, #fbe9a8) 45%, #fff);
}

/* 포스트잇 색 조금 더 진하게 */
.is-diary .chr-card.is-note-card {
    --chr-note-bg: color-mix(in srgb, var(--chr-c) 38%, #fff);
    --chr-note-fold: color-mix(in srgb, var(--chr-c) 18%, #fff);
}
.chr-postit {
    --chr-pi-bg: color-mix(in srgb, var(--chr-c) 42%, #fff);
    --chr-pi-fold: color-mix(in srgb, var(--chr-c) 20%, #fff);
}

/* 포스트잇·쪽지 카드 바탕만 더 진하게 (접힌 모서리는 그대로) */
.is-diary .chr-card.is-note-card { --chr-note-bg: color-mix(in srgb, var(--chr-c) 52%, #fff); }
.chr-postit { --chr-pi-bg: color-mix(in srgb, var(--chr-c) 56%, #fff); }

/* 연표 노트 뒤에 한 장 더 겹쳐 있는 느낌 */
.is-diary .chr-paper-shade::before {
    content: "";
    position: absolute;
    inset: 34px 0 0 0;   /* 바인더 구멍 아래부터라 앞장 구멍과 안 겹침 */
    border-radius: 4px 12px 14px 6px;
    background-color: color-mix(in srgb, var(--chr-paper) 74%, #c9b28a);   /* 뒷장은 앞장보다 진하게 */
    transform: translate(8px, 9px) rotate(0.6deg);
    transform-origin: 50% 50%;
}
/* 뒷장이 오른쪽·아래로 살짝 보이도록 앞장에 여유 */
.is-diary .chr-paper { margin-right: 14px; margin-bottom: 28px; }
.is-diary .chr-paper-bg { z-index: 1; }

/* 포스트잇 잡아서 옮기기 */
.chr-side .chr-postit { cursor: grab; touch-action: none; }
.chr-side .chr-postit.is-dragging {
    cursor: grabbing;
    user-select: none;
    animation: none;
    filter: drop-shadow(0 2px 2px rgba(60, 40, 10, 0.18)) drop-shadow(0 14px 20px rgba(40, 25, 5, 0.3));
    scale: 1.03;
}

/* ==========================================================
 * 낙서하기 (저장 안 됨)
 * ========================================================== */
.chr-doodle-tools { position: relative; display: flex; align-items: center; }
.chr-doodle-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    height: 34px; padding: 0 12px;
    border: 1.5px dashed color-mix(in srgb, var(--chr-line, #8a7a5c) 60%, transparent);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.6);
    color: inherit; font-size: 13px; cursor: pointer;
}
.chr-doodle-toggle[aria-pressed="true"] { border-style: solid; background: #fff; box-shadow: 0 1px 4px rgba(60, 40, 10, 0.18); }
.chr-doodle-bar {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 20;
    display: flex; align-items: center; gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(60, 40, 10, 0.2);
    white-space: nowrap;
}
.chr-doodle-bar[hidden] { display: none; }
.chr-doodle-bar button { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; color: #6b5a44; cursor: pointer; line-height: 24px; text-align: center; }
.chr-doodle-color { background: var(--dc) !important; box-shadow: inset 0 0 0 2px #fff; }
.chr-doodle-color.is-on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--dc); }
.chr-doodle-size { font-size: 10px; opacity: 0.45; }
.chr-doodle-size b { font-size: 16px; }
.chr-doodle-size.is-on, .chr-doodle-eraser.is-on { opacity: 1; background: rgba(0, 0, 0, 0.07) !important; }
.chr-doodle-sep { width: 1px; height: 18px; background: rgba(0, 0, 0, 0.12); }
.chr-doodle-canvas {
    position: absolute; left: 0; top: 0; z-index: 6;
    pointer-events: none;
}
.chr-board.is-doodling .chr-doodle-canvas { pointer-events: auto; cursor: crosshair; touch-action: none; }

/* 낙서 버튼: 테두리·글씨 없이 붓 아이콘만 */
.chr-doodle-toggle,
.chr-doodle-toggle[aria-pressed="true"] {
    width: 34px; padding: 0; justify-content: center;
    border: 0; background: none; box-shadow: none;
    font-size: 16px; opacity: 0.55;
    transition: opacity .15s ease, transform .15s ease;
}
.chr-doodle-toggle:hover { opacity: 0.85; }
.chr-doodle-toggle[aria-pressed="true"] { opacity: 1; transform: rotate(-12deg) scale(1.12); }

/* 설정·글쓰기 버튼 아이콘: 사이트 '기본 버튼' 글자색을 따라가게 (원래는 회색으로 덮여 있었음) */
.chr-btns .btn_b01,
.chr-btns a.btn_b01 { color: var(--btn-primary-text, #fff); }
.chr-btns .btn_b01:hover,
.chr-btns a.btn_b01:hover { color: var(--btn-primary-text, #fff); background: rgba(255, 255, 255, 0.14); }

/* 낙서 도구 (크레용·색연필·지우개 / 색 / 굵기 슬라이더) */
.chr-doodle-bar {
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 10px 12px; border-radius: 14px; min-width: 250px;
}
.chr-doodle-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.chr-doodle-bar .chr-doodle-mode {
    width: auto; height: 28px; padding: 0 10px; border-radius: 999px;
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 12px; line-height: 1; opacity: 0.6;
}
.chr-doodle-bar .chr-doodle-mode.is-on { opacity: 1; background: rgba(0, 0, 0, 0.07) !important; }
.chr-doodle-bar .chr-doodle-clear { margin-left: auto; opacity: 0.6; }
.chr-doodle-bar .chr-doodle-clear:hover { opacity: 1; }
.chr-doodle-bar .chr-doodle-color { width: 22px; height: 22px; }
.chr-doodle-pick {
    position: relative; width: 22px; height: 22px; border-radius: 50%; cursor: pointer;
    background: conic-gradient(#f66, #fc6, #9e6, #6cf, #96f, #f6c, #f66);
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 0 2px #fff, 0 0 0 1.5px var(--dc, #3b2f22);
}
.chr-doodle-pick span { color: #fff; font-weight: 700; font-size: 14px; text-shadow: 0 0 2px rgba(0, 0, 0, 0.5); pointer-events: none; }
.chr-doodle-pick input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }
.chr-doodle-size-row { flex-wrap: nowrap; gap: 10px; }
.chr-doodle-dot { flex: none; border-radius: 50%; width: 8px; height: 8px; }
.chr-doodle-size-row .chr-doodle-dot { min-width: 3px; }
.chr-doodle-bar input.chr-doodle-size { flex: 1 1 auto; width: auto; height: auto; accent-color: #8a7a5c; }
.chr-doodle-size-val { flex: none; width: 22px; text-align: right; font-size: 12px; opacity: 0.7; }

/* 낙서 도구: 글씨 없이 3줄 (도구+휴지통 / 색 / 굵기) */
.chr-doodle-bar { min-width: 0; width: max-content; }
.chr-doodle-bar .chr-doodle-mode { width: 30px; height: 28px; padding: 0; justify-content: center; font-size: 14px; }
.chr-doodle-colors { flex-wrap: nowrap; gap: 5px; }

/* 아래 칸도 중요 사건 1개 + 간단한 정보 2개까지 들어가게 선 아래 칸을 52px 늘림 (위 칸은 그대로) */
.chr-board .chr-track { height: calc(var(--chr-half) * 2 + var(--chr-lane) * 2 - 14px + 52px); }
.chr-board:not(.has-eras) .chr-track { height: calc(var(--chr-half) * 2 + var(--chr-lane) * 2 - 14px + 12px + 52px); }
.chr-doodle-status { font-size: 11px; opacity: 0.55; text-align: right; min-height: 1em; }
.chr-doodle-status:empty { display: none; }
.chr-doodle-status.is-bad { color: #c0392b; opacity: 1; }
