/* 📱 태블릿 (js/tablet.js · 도련 11-13) : 책상 위 태블릿 → 화면 가운데로 크게 · 홈 화면 앱 6개 · 🧩 📄 그림 앱
   z 940 = 예전 만들기 화면(속지 · 떡메 · 마테 · 시트 꾸미기)보다 아래 → 그 화면을 닫으면 태블릿 홈이 그대로 */
.ip-room { position: fixed; inset: 0; z-index: 940; display: none; }
.ip-room.show { display: block; }
.ip-dim { position: absolute; inset: 0; background: rgba(70, 44, 56, .34); opacity: 0; transition: opacity .35s ease; }
.ip-room.lit .ip-dim { opacity: 1; }
.ip-pad { position: absolute; transform-origin: 0 0; }
.ip-img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-select: none; }
.ip-scr { position: absolute; overflow: hidden; border-radius: 3.2% / 4.6%; transition: opacity .25s ease; display: flex; flex-direction: column; color: #5b3f4a; container-type: size; }
.ip-pad.fly .ip-scr, .ip-scr.off { opacity: 0; }

/* 🏠 홈 화면 */
.ip-home { background: linear-gradient(#ffe6f0, #fff4e6 55%, #e8f3ff); align-items: center; }
.ip-stat { padding-top: 4cqh; font-size: 9cqh; line-height: 1; letter-spacing: .5px; color: #8a6070; font-family: 'Jua', sans-serif; }
.ip-stat b { font-weight: 400; }
.ip-apps { flex: 1; width: 86%; display: grid; grid-template-columns: repeat(3, 1fr); align-content: center; gap: 6cqh 4cqw; }
.ip-app { display: flex; flex-direction: column; align-items: center; gap: 1.6cqh; border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: #6b4a58; }
.ip-app i { display: grid; place-items: center; width: min(15cqh * 1.25, 12cqw); aspect-ratio: 1; border-radius: 26%; font-style: normal; font-size: min(9cqh, 6cqw);
    border: 2px solid #6b3f35; box-shadow: 0 3px 0 rgba(107, 63, 53, .18); transition: transform .15s ease; }
.ip-app span { font-size: min(4.2cqh, 2.4cqw); font-weight: 800; white-space: nowrap; }
.ip-app:hover i { transform: translateY(-2px); } .ip-app:active i, .ip-app.tap i { transform: scale(.9); }
.ip-app .a-leaf { background: #fff0b8; } .ip-app .a-tk { background: #ffe0c8; } .ip-app .a-tape { background: #ffd1df; }
.ip-app .a-seal { background: #cfe4ff; } .ip-app .a-piece { background: #cdeec8; } .ip-app .a-paper { background: #e7d6ff; }
.ip-bar { width: 18%; height: 1.2cqh; min-height: 3px; border-radius: 9px; background: #8a6070; opacity: .45; margin: 0 0 2.4cqh; }

/* ✏️ 그림 앱 (🧩 조각 · 📄 모조지) */
.ip-draw { background: #fffaf3; }
.ipd-top { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: #ffe6f0; border-bottom: 1.5px solid #f3c2d3; flex-wrap: wrap; }
.ipd-top b { font-size: 14px; margin-left: 2px; }
.ipd-sp { flex: 1; }
.ipd-b { border: 1.5px solid #e9b4c6; background: #fff; color: #7a4a5d; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.ipd-b:active { transform: translateY(1px); }
.ipd-go { background: #ff8fb0; border-color: #ff8fb0; color: #fff; }
.ipd-go:disabled { opacity: .7; }
.ipd-mid { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.ipd-cv { position: relative; height: 100%; max-width: 100%; border-radius: 10px; box-shadow: 0 0 0 1.5px #e9cfd8, 0 4px 12px rgba(120, 70, 90, .12);
    background: repeating-conic-gradient(#f4ecef 0 25%, #fff 0 50%) 0 0 / 18px 18px; touch-action: none; }   /* 🧩 투명 = 체크무늬 */
.ipd-cv.paper { background: #fff; }
.ipd-cv canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; }
#ipdInk { cursor: crosshair; touch-action: none; }
.ipd-tools { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 8px 4px; flex-wrap: wrap; }
.ipd-pen { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1.5px #d8b6c3; cursor: pointer; padding: 0; }
.ipd-pen.on { box-shadow: 0 0 0 2.5px #ff6f9c; transform: scale(1.12); }
.ipd-gap { width: 8px; }
.ipd-sz { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid #e2c3cf; background: #fff; display: grid; place-items: center; cursor: pointer; padding: 0; }
.ipd-sz i { display: block; border-radius: 50%; background: #6b4a58; }
.ipd-sz.on { border-color: #ff6f9c; box-shadow: 0 0 0 1.5px #ff6f9c; }
.ipd-er { height: 28px; border-radius: 14px; border: 1.5px solid #e2c3cf; background: #fff; padding: 0 9px; cursor: pointer; font-size: 15px; }
.ipd-er.on { border-color: #ff6f9c; background: #ffe6f0; }
.ipd-tip { text-align: center; font-size: 11.5px; color: #9a7685; padding: 0 10px 7px; word-break: keep-all; }

/* 🪑 책상 위 작은 태블릿 화면 (js/desk.js deskItemHtml) */
.dk-pad { position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%; pointer-events: none; overflow: hidden; border-radius: 6px;
    background: linear-gradient(#ffe6f0, #fff4e6 55%, #e8f3ff); }
.dk-pad b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 11px; line-height: 1; color: #8a6070; }
.dk-pad span { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px 7px; }
.dk-pad i { width: 16px; height: 16px; border-radius: 5px; border: 1.2px solid #6b3f35; display: grid; place-items: center; font-style: normal; font-size: 9px; line-height: 1; }
.dk-pad i:nth-child(1) { background: #fff0b8; } .dk-pad i:nth-child(2) { background: #ffe0c8; } .dk-pad i:nth-child(3) { background: #ffd1df; }
.dk-pad i:nth-child(4) { background: #cfe4ff; } .dk-pad i:nth-child(5) { background: #cdeec8; } .dk-pad i:nth-child(6) { background: #e7d6ff; }
/* 📱 태블릿에서 연 만들기 = 다이어리와 상관없이 🗄️ 서랍에 넣기만 (도련 11-13 : 다이어리모드가 실행됐어요) · 📃 끼우기 · 🧻 꺼내기 · 🎀 붙이기 · ‹ 스티커만들기 숨김 */
body.ip-on #lmGo, body.ip-on #leafMakeModal .mt-back, body.ip-on #leafMakeModal .sub-modal-btns, body.ip-on .smk-room button[onclick^="tpmFinish(true"] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ip-dim, .ip-scr { transition: none; } }

/* 🖥 화면 가득 작업대 (js/tablet.js wsOpen · 도련 11-13 : 디자인하려면 화면이 넓어야 해요) = 🗂️ 시트 꾸미기 모양 (css/sheetmaker.css .shm-*)
   .smk-room 은 예전 만들기 화면 칸의 모양을 그대로 쓰려고 붙여요 (보이기 · 자리는 아래 #tbWs 가 정해요) */
#tbWs.smk-room { z-index: 985; display: none; overflow: hidden; background: linear-gradient(#fbe9ef, #f7dfe8 86px, #e9c9b0 86px); color: #5b3f4a; }
#tbWs.smk-room.show { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
#tbWs.smk-room { padding: 0; filter: none; }   /* .smk-room 팝업 카드 모양(둘레 · 그림자) 대신 화면 가득 */
#tbWs .shm-bar, #tbWs .shm-body { align-self: stretch; width: auto; max-width: none; }   /* .smk-room 가운데 모으기 대신 화면 가득 */
#tbWs .shm-bar { justify-content: flex-start; }   /* 태블릿이 켜진 동안 책상 메뉴는 숨어 있어요 (body.ip-on .desk-top-r) */
#tbWs .tb-ws-x { order: 99; margin-left: auto; flex: none; }   /* ✕ = 위 막대 오른쪽 끝 · 태블릿 닫기 (도련 11-15 · 모양 = css/anime.css .try-x) */
#tbWs .shm-body { grid-template-columns: 270px minmax(0, 1fr) 270px; }
#tbWs .tb-mid { min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; overflow: auto; padding: 6px; }
.tb-hide { visibility: hidden !important; pointer-events: none !important; }
body.tb-ws-on .ip-room { visibility: hidden; }                                   /* 작업대가 뜬 동안 태블릿은 뒤에서 기다려요 */
/* ✏️ 그림 앱 */
#tbWs .ipd-cv { height: 100%; width: auto; max-width: 100%; max-height: 100%; }
#tbWs .ipd-pens { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; justify-items: center; }
#tbWs .ipd-pen { width: 34px; height: 34px; }
#tbWs .ipd-sz { width: 40px; height: 40px; }
#tbWs .ipd-er.on { border-color: #ff6f9c; background: #ffe6f0; }
/* 📃 🧻 속지 · 떡메 칸 */
#tbWs #lmBox { height: min(100%, 78vh); width: auto; max-width: 100%; margin: 0; }
#tbWs.lm-tk #lmBox { height: min(92%, 70vh); margin-top: 20px; }
#tbWs .lm-tabs { display: flex; flex-direction: column; gap: 6px; }
#tbWs .lm-tabs .stk-tab { width: 100%; }
#tbWs .lm-glue-box { display: none; } #tbWs.lm-tk .lm-glue-box { display: block; }
#tbWs #lmKeep.btn, #tbWs .shm-panel > .smk-go.smk-sub { margin-top: auto; width: 100%; background: var(--pk, #e88fb0); color: #fff; border: 0; border-radius: 14px; padding: 12px; font-size: 16px; font-weight: 900; min-height: 48px; box-shadow: 0 4px 0 #c2457a; }
/* 🎀 마스킹테이프 칸 */
#tbWs .tpm-top { width: 100%; }
#tbWs #tpmTabs { display: flex; flex-direction: column; gap: 6px; }
#tbWs #tpmTabs button { width: 100%; }
#tbWs .shm-panel > .smk-go.smk-sub::before { display: none; }
html #tbWs #lmKeep.btn { background: #e88fb0 !important; color: #fff !important; border: 0 !important; box-shadow: 0 4px 0 #c2457a !important; }   /* html.an .btn 보다 먼저 */

/* 태블릿 안 (홈 · 작업대) = 책상 오른쪽 위 메뉴(책상 꾸미기 · 이동)는 숨겨요 · ✕ 없이 바깥을 누르면 닫혀요 (도련 11-14) */
body.ip-on .desk-top-r { display: none !important; }

/* 🎨 태블릿 작업대 색 (도련 11-14) : 위 = 연보라 · 아래 작업판 = 연핑크 모눈 (시트 꾸미기는 분홍 · 녹색 그대로) */
#tbWs.smk-room { background: linear-gradient(#f3ecfb, #e6d8f3 86px, #e9c9b0 86px); }
#tbWs .shm-body { background-color: #f6dce6; }
@media (max-width: 760px) { #tbWs.smk-room { background: linear-gradient(#f3ecfb, #e6d8f3 64px, #e9c9b0 64px); } }
#tbWs .pp-doc { box-shadow: 0 0 0 4px #dcaabd, 0 14px 34px rgba(90, 50, 60, .28); }   /* 연핑크 작업판 위에서도 종이 둘레가 보이게 */

/* 🎨 셀 애니메이션 아이콘 · ✏️ 디자인 스튜디오 표시 (도련 11-14) */
.ip-studio { display: flex; flex-direction: column; align-items: center; gap: .6cqh; margin-top: 2.2cqh; }
.ip-studio b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: min(4.4cqh, 2.6cqw); color: #c2457a; background: #fff; border: 2px solid #5b3a33; border-radius: 99px; padding: .5cqh 2.2cqw; box-shadow: 0 2px 0 rgba(91, 58, 51, .25); }
.ip-studio b { display: flex; align-items: center; gap: .4em; } .ip-studio b svg { width: 1.3em; height: 1.3em; overflow: visible; }
.ip-studio small { font-size: min(3cqh, 1.8cqw); font-weight: 700; color: #8a6070; }
.ip-app i svg { width: 74%; height: 74%; overflow: visible; }
.ip-app span { display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.ip-app span em { font-style: normal; font-size: .62em; font-weight: 800; color: #fff; background: #ff8fb1; border: 1.5px solid #5b3a33; border-radius: 99px; padding: 0 .7em; margin-top: .35em; }
.ip-apps { gap: 4.5cqh 4cqw; }
.dk-pad i svg { width: 88%; height: 88%; overflow: visible; }
/* 🧩 담은 조각 (도련 11-14 · 한 도안에 4개까지 · 톡 = 빼기) */
.ipd-pcs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 4px 0 6px; min-height: 30px; }
.ipd-pc { position: relative; aspect-ratio: 1; border: 1.5px solid #e2c3cf; border-radius: 10px; background: #fff7fa; padding: 3px; cursor: pointer; }
.ipd-pc img { width: 100%; height: 100%; object-fit: contain; }
.ipd-pc b { position: absolute; right: -5px; top: -5px; width: 16px; height: 16px; border-radius: 50%; background: #c2457a; color: #fff; font-size: 9px; display: grid; place-items: center; }
h4 em { font-style: normal; font-size: 11px; color: #a07a88; margin-left: 4px; }

/* 📐 내 도안 (도련 11-15 · js/tablet.js dzOpen) : 홈 오른쪽 위 버튼 · 작업대 = 종류 · 도안 · 고른 도안 + 🗑 */
.ip-dz { position: absolute; top: 3.4cqh; right: 3cqw; font: inherit; font-family: 'Jua', sans-serif; font-size: min(3.4cqh, 2cqw); color: #c2457a; background: #fff; border: 2px solid #5b3a33; border-radius: 99px; padding: .6cqh 1.6cqw; box-shadow: 0 .5cqh 0 #5b3a33; cursor: pointer; }
.ip-dz:active { translate: 0 .4cqh; box-shadow: 0 .1cqh 0 #5b3a33; }
#tbWs.tb-dz .shm-body { grid-template-columns: 220px minmax(0, 1fr) 300px; }
#tbWs.tb-dz .tb-mid { justify-content: flex-start; align-items: stretch; padding: 14px; }
.dz-h { margin: 2px 0 4px; font-size: 14px; color: #5b3a33; }
.dz-k { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 12px; border: 2px solid #f1d3de; border-radius: 12px; background: #fff; font: inherit; font-weight: 800; font-size: 14px; color: #6b4438; cursor: pointer; }
.dz-k i { font-style: normal; font-size: 18px; } .dz-k em { margin-left: auto; font-style: normal; font-size: 12px; color: #b0798c; }
.dz-k.on { border-color: #f08fb0; background: #fff0f5; color: #c2457a; }
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.dz-it { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 9px; border: 2.5px solid #ead4dc; border-radius: 16px; background: #fffdf8; font: inherit; color: #5b3a33; cursor: pointer; min-width: 0; }
.dz-it.on { border-color: #f08fb0; box-shadow: 0 0 0 3px #ffd3e2; }
.dz-th { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: repeating-conic-gradient(#f6eef1 0 25%, #fff 0 50%) 0 0 / 16px 16px; font-size: 40px; overflow: hidden; }
.dz-th img { max-width: 92%; max-height: 92%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(90, 60, 50, .25)); }
.dz-it b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dz-it small { font-size: 11px; color: #a08890; min-height: 1em; }
.dz-empty { margin: auto; text-align: center; font-weight: 800; color: #8a6070; line-height: 1.7; } .dz-empty small { font-weight: 700; color: #a08890; }
.dz-pv { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid #ead4dc; border-radius: 14px; background: repeating-conic-gradient(#f6eef1 0 25%, #fff 0 50%) 0 0 / 18px 18px; font-size: 64px; overflow: hidden; }
.dz-pv img { max-width: 94%; max-height: 94%; object-fit: contain; }
.dz-nm { font-size: 16px; color: #5b3a33; text-align: center; } .dz-meta { font-size: 12px; color: #a08890; text-align: center; }
.dz-del { margin-top: 6px; height: 46px; border: 2.5px solid #e88fb0; border-radius: 14px; background: #fff; font: inherit; font-weight: 900; font-size: 15px; color: #c2457a; cursor: pointer; }
.dz-del:disabled { opacity: .6; }
.dz-hint { margin: 0; font-size: 11.5px; line-height: 1.6; color: #8a6070; text-align: center; }
