/* ===========================
   기본 설정
=========================== */

:root {
    --c-main: #87b6e2;
    --c-main-hover: #78aadb;
    --c-accent: #4a82bb;
    --c-accent-dark: #345f8f;
    --c-tint: #eef5fc;
    --c-ink: #1e3652;
    --header-row-height: 68px;
    --header-col-width: 140px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #ffffff;
    font-family:
        "Pretendard",
        "Noto Sans KR",
        sans-serif;
    color: #222;
}

.wrapper {
    width: 100%;
    min-height: 100vh;
    padding: 32px 0 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: visible;
}

.scale-wrap {
    margin: 0 auto;
    overflow: hidden;
    position: relative;
}

.capture-area {
    width: 1100px;
    margin: 0 auto;
    padding: 28px 50px 34px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .08);
    transform-origin: top left;
}

/* 잊페스 / 공수 취향표: 탭을 오갈 때 로고 위치가 달라 보이지 않도록 위쪽 여백을 똑같이 맞춘다 */
#captureArea,
#captureAreaLr {
    padding-top: 44px;
}

/* 공수 취향표: 가로가 더 길고 세로는 더 짧게 나오도록 폭을 넓힌다.
   JS의 CAPTURE_WIDTH.lr 값과 항상 같아야 한다. 
   모바일(반응형 100% 폭)에서는 적용하지 않는다. */
@media (min-width: 769px) {
    /* 잊페스: 좌우 여백 60px -> 표(최대 980px)가 딱 맞게 들어가 사방 여백이 고르다 */
    #captureArea {
        padding-left: 60px;
        padding-right: 60px;
    }

    /* 공수: 좌우 여백 64px. 이 값을 바꾸면 script.js의 LR_PC_TEXT_WIDTH도 같이 바꿔야 한다. */
    #captureAreaLr {
        width: 1820px;
        padding-left: 64px;
        padding-right: 64px;
    }
}

/* ===========================
   탭 전환
=========================== */

.tab-wrap {
    display: flex;
    gap: 8px;
    background: var(--c-tint);
    padding: 6px;
    border-radius: 999px;
    margin-bottom: 18px;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 800;
    color: var(--c-accent);
    cursor: pointer;
    transition: .2s;
}

.tab-btn:hover {
    color: var(--c-accent-dark);
}

.tab-btn.active {
    background: var(--c-main);
    color: var(--c-ink);
}

/* ===========================
   상단
=========================== */

.logo {
    display: block;
    width: 250px;
    height: auto;
    margin: 0 auto 14px;
}

/* 제목은 항상 정확히 가운데. 날짜는 제목 오른쪽 옆에 따로 띄워서(위치만 차지) 켜고 꺼도 제목이 안 움직인다. */
h1 {
    position: relative;
    width: max-content;
    max-width: 100%;
    text-align: center;
    font-size: 34px;   /* 저장 이미지 기준: 제목이 로고(250px)보다 좁게 */
    line-height: 1.15;
    font-weight: 900;
    color: var(--c-accent);
    margin: 0 auto 34px;
    white-space: nowrap;
}

.capture-id-bottom {
    display: block;
    text-align: center;
    margin: 26px 0 0;
    color: #bbb;
    font-size: 14px;
    font-weight: 600;
}

.chart-date {
    position: absolute;
    left: 100%;
    bottom: .12em;
    margin-left: 16px;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    color: var(--c-accent);
    white-space: nowrap;
}

/* ===========================
   표
=========================== */

.table-wrap {
    position: relative;
    margin-top: 0;
}

.table-nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    max-width: 980px;
    margin: 0 auto 8px;
}

.nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--c-tint);
    color: var(--c-accent);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .15s;
}

.nav-btn:hover:not(:disabled) {
    background: #d9e8f7;
    transform: none;
}

.nav-btn:disabled {
    opacity: .35;
    cursor: default;
}

/* 둥근 모서리와 클리핑(가로 스크롤)은 이 컨테이너가 맡는다.
   고정(sticky)된 왼쪽 칸도 이 둥근 모서리 안에서 같이 잘려서 뾰족한 모서리가 안 보인다. */
.table-clip {
    max-width: 980px;
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e3e3e3;
}

/* 기본 스크롤바는 숨기고, 표 아래에 따로 띄운 둥근 스크롤바(.table-scrollbar)를 쓴다 */
.table-scroll {
    overflow: hidden;
    scrollbar-width: none;
}

.table-scroll::-webkit-scrollbar {
    display: none;
}

.table-scrollbar {
    display: none;
    position: relative;
    max-width: 980px;
    height: 8px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: var(--c-tint);
    touch-action: none;
}

.table-scrollbar.active {
    display: block;
}

.table-scrollbar-thumb {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    background: var(--c-main);
    cursor: grab;
}

table {
    width: 100%;
    margin: 0;
    border-collapse: separate; /* 스크롤/고정 중에도 칸 테두리가 같이 움직이도록 */
    border-spacing: 0;
    table-layout: fixed;
}

/* 헤더 칸은 모두 같은 기본색(#87b6e2) 단색. 불투명이라 모바일에서 왼쪽 칸을 고정해도 뒤가 비치지 않는다. */
th {
    background: var(--c-main);
    color: var(--c-ink);
    height: var(--header-row-height);
    font-size: 19px;
    font-weight: 800;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.45);
    border-bottom: 1px solid rgba(255,255,255,.45);
    padding: 0 2px;
    word-break: keep-all;
}

th:first-child {
    width: var(--header-col-width);
}

.clickable-header {
    cursor: pointer;
    transition: .15s;
}

.clickable-header:hover {
    filter: brightness(.92);
}

td {
    height: 68px;
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    background: #fff;
    border: 0;
    border-right: 1px solid #e3e3e3;
    border-bottom: 1px solid #e3e3e3;
    cursor: pointer;
    transition: .15s;
}

/* 바깥 테두리는 컨테이너가 그리므로 맨 오른쪽/맨 아래 칸 테두리는 뺀다 */
tr > :last-child { border-right: 0; }
tr:last-child > * { border-bottom: 0; }

td:hover {
    transform: scale(1.025);
    position: relative;
    z-index: 2;
}

/* ===========================
   범례
=========================== */

.legend {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
    margin-top: 25px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 22px;
    font-weight: 700;
}

.color {
    width: 27px;
    height: 27px;
    border-radius: 50%;
    border: 2px solid #d8d8d8;
}

.color.dashed {
    border-style: dashed;
    border-color: #bbb;
    background: #fff !important;
}

/* ===========================
   공수 취향표
=========================== */

.lr-grid {
    /* 3열 x 2행(2-2-2)으로 배치하되, 세로(위→아래) 우선으로 채운다. */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    gap: 34px 30px;
}

.lr-row {
    display: flex;
    align-items: flex-start;
    gap: 18px;
}

/* 프로필 사진 + 그 아래 "제외하기" 체크박스 */
.lr-side {
    flex: 0 0 auto;
    width: 112px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.lr-exclude {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    color: #7d9cbc;
    cursor: pointer;
    user-select: none;
}

.lr-exclude input {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    margin: 0;
    accent-color: var(--c-accent);
    cursor: pointer;
}

/* 제외한 멤버는 화면에서 흐리게 (체크박스는 그대로 선명하게) */
.lr-row.excluded .lr-avatar,
.lr-row.excluded .lr-content {
    opacity: .35;
}

/* 저장 이미지에는 체크박스를 넣지 않는다 */
.capturing .lr-exclude {
    display: none;
}

.lr-avatar {
    position: relative;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    overflow: hidden;
    flex: 0 0 auto;
    cursor: pointer;
    border: 4px solid var(--c-tint);
    background: var(--c-tint);
}

.lr-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.lr-avatar .avatar-edit {
    position: absolute;
    inset: auto 0 0 0;
    height: 22px;
    background: rgba(0,0,0,.5);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: .15s;
}

.lr-avatar:hover .avatar-edit {
    opacity: 1;
}

.lr-content {
    flex: 1;
    min-width: 0;
}

.lr-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.lr-label-l,
.lr-label-r {
    font-size: 18px;
    font-weight: 800;
    color: var(--c-accent);
    flex: 0 0 auto;
}

.lr-bar {
    flex: 1;
    display: flex;
    height: 38px;
    border: 2px solid #cfe0f2;
    border-radius: 8px;
    overflow: hidden;
}

.lr-cell {
    flex: 1;
    height: 100%;
    background: #fff;
    border-right: 1px solid #e1edf8;
    cursor: pointer;
    transition: .1s;
}

.lr-cell:last-child {
    border-right: none;
}

.lr-cell:hover {
    background: #f1f7fd;
}

.lr-cell.filled {
    background: var(--c-main);
}

.lr-text-wrap {
    position: relative;
}

/* --k: 모바일에서 PC 저장 레이아웃 대비 칸 폭 비율(JS가 설정, PC는 1).
   --fs: 멤버별 글자 크기(저장 이미지 기준 px).
   k만큼 글자/칸/안쪽 여백을 똑같이 줄이면 줄바꿈이 저장 이미지와 같아진다.
   칸 높이는 고정이고, 글이 넘치면 안에서 스크롤되며 경고가 뜬다.
   (테두리 2px은 고정이라 안쪽 여백에서 보정) */
.lr-text {
    width: 100%;
    height: calc(190px * var(--k, 1));
    resize: none;
    overflow-y: auto;
    border: 2px solid #cfe0f2;
    border-radius: 10px;
    padding: calc(12px * var(--k, 1) - 2px) calc(14px * var(--k, 1) - 2px) calc(26px * var(--k, 1) - 2px);
    font-size: calc(var(--fs, 17) * var(--k, 1) * 1px);
    line-height: 1.5;
    font-family: inherit;
    word-break: break-word;
    color: #222;
    outline: none;
}

.lr-text:focus {
    border-color: var(--c-accent);
}

.lr-text::placeholder {
    color: #7d9cbc;
}

.lr-font-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    color: #7d9cbc;
    font-weight: 700;
}

.lr-font-ctrl input[type="range"] {
    flex: 1;
    min-width: 0;
    accent-color: var(--c-accent);
}

.lr-font-s { font-size: 12px; }
.lr-font-l { font-size: 18px; }

.lr-font-val {
    font-size: 12px;
    min-width: 36px;
    text-align: right;
}

/* 이미지 저장 중에는 글자 크기 조절 바를 숨김 */
.capturing .lr-font-ctrl {
    display: none;
}

.lr-warn {
    display: none;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #e0457b;
}

.lr-row.overflow .lr-warn {
    display: block;
}

.lr-row.overflow .lr-text {
    border-color: #e0457b;
}

/* 이미지 저장 중에는 경고를 숨김 */
.capturing .lr-warn {
    display: none !important;
}

.lr-char-count {
    position: absolute;
    right: 12px;
    bottom: 8px;
    font-size: 12px;
    color: #7d9cbc;
    font-weight: 600;
    pointer-events: none;
}

/* ===========================
   버튼 / 안내
=========================== */

.button-wrap {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 22px;
}

button {
    border: none;
    border-radius: 14px;
    font-size: 21px;
    font-weight: 800;
    cursor: pointer;
    transition: .2s;
}

button:hover {
    transform: translateY(-2px);
}

#saveBtn,
#resetBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    height: 48px;
    padding: 0 26px;
    border-radius: 999px;
    font-size: 16px;
}

#saveBtn {
    background: var(--c-main);
    color: var(--c-ink);
}

#saveBtn:hover {
    background: var(--c-main-hover);
}

#resetBtn {
    background: #fff;
    color: #666;
    border: 1.5px solid #ddd;
}

#resetBtn:hover {
    background: #f5f5f5;
}

.btn-icon {
    font-size: 16px;
    line-height: 1;
}

.date-toggle-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 20px;
}

.date-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: #777;
    cursor: pointer;
    user-select: none;
}

.date-toggle input {
    width: 17px;
    height: 17px;
    accent-color: var(--c-accent);
    cursor: pointer;
}

.guide-list {
    text-align: center;
    margin: 0 0 18px;
}

/* 공수 취향표 탭: 안내 글자와 프로필 사이를 조금 더 띄운다 */
#guideListLr {
    margin-bottom: 32px;
}

.guide-list p {
    margin: 0;
    color: #999;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
}

/* 이미지 저장(캡처) 시 안내 문구 / 이전-이후 버튼을 숨기는 상태.
   h1의 margin-bottom(18px)만 남아 제목과 표 사이 간격이
   너무 좁거나 멀지 않게 유지된다. */
.capturing .guide-list,
.capturing .table-nav {
    display: none;
}

/* ---- 저장 이미지 배치 (잊페스 / 공수 공통) ----
   두 탭 모두 같은 구조: 로고 → 제목(날짜는 제목 오른쪽 옆) → 내용.
   위·아래 여백도 두 이미지가 같은 값. */
.title-block {
    position: relative;
}

/* 날짜를 켜지 않았으면 아무것도 차지하지 않도록 */
.chart-date:empty {
    display: none;
}

#captureArea.capturing,
#captureAreaLr.capturing {
    padding-top: 56px;
    padding-bottom: 40px;
}

/* 호감도 범례는 저장 이미지에서 줄바꿈되거나 잘리지 않고 항상 한 줄로 */
#captureArea.capturing .legend {
    flex-wrap: nowrap;
    margin-top: 42px;
}

#captureArea.capturing .legend-item {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ---- 화면(PC) 전용: 탭을 넘나들어도 로고/제목/안내 글자 크기가 똑같이 보이게 ----
   탭마다 저장 폭이 달라서 화면에 맞춰 줄이는 배율(--s)이 다르다.
   그 배율의 역수(--u)를 곱해 두면 배율이 몇이든 화면에서 보이는 크기는 항상 같다.
   (저장 중에는 .capturing 이라 이 규칙이 적용되지 않는다) */
@media (min-width: 769px) {
    .capture-area:not(.capturing) {
        --u: calc(1px / var(--s, 1));
    }

    #captureArea:not(.capturing),
    #captureAreaLr:not(.capturing) {
        padding-top: calc(var(--u) * 32);
    }

    .capture-area:not(.capturing) .logo {
        width: calc(var(--u) * 150);
        margin-bottom: calc(var(--u) * 10);
    }

    .capture-area:not(.capturing) h1 {
        font-size: calc(var(--u) * 30);
        margin-bottom: calc(var(--u) * 20);
    }

    .capture-area:not(.capturing) .chart-date {
        font-size: calc(var(--u) * 14);
        margin-left: calc(var(--u) * 10);
    }

    .capture-area:not(.capturing) .guide-list p {
        font-size: calc(var(--u) * 15);
    }

    .capture-area:not(.capturing) .guide-list,
    .capture-area:not(.capturing) #guideListLr {
        margin-bottom: calc(var(--u) * 22);
    }
}

/* 저장 이미지에서는 스크롤/고정을 풀어 표 전체가 그대로 찍히게 한다 */
.capturing .table-scrollbar {
    display: none !important;
}

.capturing .table-scroll {
    overflow: hidden;
}

.capturing tr > :first-child {
    position: static;
    box-shadow: none;
}

/* ===========================
   색상 선택 모달
=========================== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.hidden {
    display: none;
}

.modal-box {
    width: 440px;
    background: #fff;
    border-radius: 24px;
    padding: 34px 26px 26px;
    position: relative;
    box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: none !important;
    border: none;
    font-size: 34px;
    cursor: pointer;
    color: #555;
}

.modal-title {
    text-align: center;
    font-size: 21px;
    font-weight: 900;
    color: #111;
    margin-bottom: 22px;
}

.option-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px 10px;
}

.option-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 2px;
    border-radius: 14px;
    cursor: pointer;
    transition: .15s;
}

.option-card:hover {
    background: #f4f4f4;
}

.option-dot {
    display: inline-block;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #e2e2e2;
}

.option-dot.dashed {
    border-style: dashed;
    border-color: #bbb;
    background: #fff !important;
}

.option-label {
    font-size: 12.5px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.option-dot-wrap {
    display: inline-block;
    position: relative;
    width: 46px;
    height: 46px;
}

.option-dot-wrap .option-dot {
    width: 100%;
    height: 100%;
}

.color-edit-btn {
    position: absolute;
    right: -6px;
    bottom: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 1.5px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
}

.color-edit-btn:hover {
    background: #f4f4f4;
}

.color-edit-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    border: none;
    padding: 0;
}

.reset-colors-link {
    text-align: center;
    margin-top: 16px;
    font-size: 12.5px;
    font-weight: 700;
    color: #999;
    text-decoration: underline;
    cursor: pointer;
}

.reset-colors-link:hover {
    color: var(--c-accent);
}

.modal-extra {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.hide-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 16px;
    font-size: 13px;
    font-weight: 700;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.hide-toggle input {
    width: 16px;
    height: 16px;
    accent-color: var(--c-accent);
    cursor: pointer;
}

.clear-card .option-dot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f3f3 !important;
    border: 2px solid #e2e2e2;
    font-size: 20px;
}

/* ===========================
   저장 완료 모달
=========================== */

.save-box {
    width: 620px;
    max-height: 92vh;
    overflow: auto;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.save-box h2 {
    font-size: 32px;
    line-height: 1.25;
    word-break: keep-all;
}

.save-box p {
    font-size: 18px;
    color: #777;
    margin: 8px 0 20px;
}

#previewImage {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    margin: 18px auto 20px;
    border-radius: 12px;
}

#closeSaveModal {
    width: 180px;
    background: #111;
    color: #fff;
}

/* ===========================
   반응형
=========================== */

@media (max-width: 768px) {
    .wrapper {
        padding: 16px 12px 24px;
    }

    /* 모바일에서는 JS 축소(transform: scale) 대신
       실제 레이아웃 폭을 화면에 맞춰 다시 짜기 때문에
       scale-wrap / capture-area 모두 폭을 100%로 풀어준다. */
    .scale-wrap {
        width: 100% !important;
        height: auto !important;
        overflow: visible;
    }

    .capture-area {
        width: 100%;
        padding: 20px 14px 22px;
        border-radius: 16px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    }

    .logo {
        width: 130px;
        margin: 0 auto 14px;
    }

    h1 {
        font-size: 19px;
        margin: 0 auto 14px;
    }

    .chart-date {
        font-size: 11px;
        margin-left: 6px;
    }

    .guide-list {
        margin-bottom: 12px;
    }

    #guideListLr {
        margin-bottom: 26px;
    }

    .guide-list p {
        font-size: 11px;
        line-height: 1.5;
    }

    /* 잊페스 취향표 (모바일)
       - 6명이라 스크롤 없이 표 전체가 화면 폭에 딱 맞게 줄어든다.
       - 이름 칸은 15%, 나머지 칸은 남은 폭을 똑같이 나눠 가진다. */
    .table-scroll {
        overflow: hidden;
    }

    table {
        --header-row-height: 40px;
        --header-col-width: 15%;
        --row-h: 40px;

        width: 100%;
        min-width: 0;
        max-width: none;
    }

    th {
        height: var(--row-h);
        font-size: 12px;
        padding: 0 1px;
        white-space: nowrap;
    }

    td {
        height: var(--row-h);
        font-size: 12px;
        padding: 0 1px;
        white-space: nowrap;
    }

    td:hover {
        transform: none;
    }

    /* 터치 후 hover가 남아도 배경이 투명해지지 않도록 밝기만 살짝 바꾼다 */
    .clickable-header:hover {
        filter: none;
    }

    /* 스크롤이 없으니 왼쪽 이름 칸을 고정할 필요가 없다 */
    tr > :first-child {
        width: var(--header-col-width);
    }

    .table-nav {
        margin-bottom: 6px;
    }

    .nav-btn {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .legend {
        gap: 10px 14px;
        margin-top: 16px;
    }

    .legend-item {
        font-size: 11px;
        gap: 5px;
    }

    .color {
        width: 14px;
        height: 14px;
        border-width: 1.5px;
    }

    .capture-id-bottom {
        font-size: 11px;
        margin-top: 14px;
    }

    .tab-wrap {
        margin-bottom: 14px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .button-wrap {
        gap: 12px;
        margin-top: 18px;
    }

    #saveBtn,
    #resetBtn {
        height: 42px;
        padding: 0 18px;
        font-size: 14px;
    }

    .date-toggle {
        font-size: 12px;
    }

    .save-box {
        width: 75%;
        max-width: 340px;
        padding: 20px;
        border-radius: 18px;
    }

    .save-box h2 {
        font-size: 27px;
    }

    .save-box p {
        font-size: 14px;
        line-height: 1.4;
    }

    .modal-box {
        width: 75%;
        max-width: 340px;
        padding: 26px 18px 18px;
        border-radius: 18px;
    }

    .modal-title {
        font-size: 17px;
        margin-bottom: 16px;
    }

    .option-grid {
        gap: 14px 6px;
    }

    .option-dot {
        width: 38px;
        height: 38px;
    }

    .option-dot-wrap {
        width: 38px;
        height: 38px;
    }

    .color-edit-btn {
        width: 17px;
        height: 17px;
        font-size: 9px;
    }

    .option-label {
        font-size: 11px;
    }

    .lr-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-auto-flow: row;
        gap: 26px;
    }

    .lr-row {
        gap: 14px;
    }

    .lr-side {
        width: 110px;
    }

    .lr-avatar {
        width: 110px;
        height: 110px;
        border-width: 3px;
    }

    .lr-bar-wrap {
        gap: 8px;
        margin-bottom: 10px;
    }

    .lr-label-l,
    .lr-label-r {
        font-size: 15px;
    }

    .lr-bar {
        height: 28px;
        border-radius: 8px;
    }

    /* 저장 이미지(190px)보다 조금만 낮게(165px) 해서 화면에서 살짝 더 컴팩트하게.
       그만큼 넘침 경고가 실제보다 조금 일찍 뜰 수 있지만, 경고 없이 잘리는 일은 없다. */
    .lr-text {
        height: calc(165px * var(--k, 1));
        padding: calc(10px * var(--k, 1) - 2px) calc(12px * var(--k, 1) - 2px) calc(24px * var(--k, 1) - 2px);
    }

    .lr-char-count {
        font-size: 11px;
    }
}
