/*
 * 하루 일기장 화면 꾸미기 (v2)
 * - 파란빛 그라데이션 바탕 위에 반투명 흰 판(유리 느낌)을 올리고,
 *   폴더마다 선명한 색 탭과 색 머리 막대로 구분하는 방식.
 * - 글꼴: 전부 기기 기본 고딕(윈도우=맑은 고딕, 갤럭시=삼성 기본 글꼴). 손글씨 글꼴은 성규님 요청으로 뺌.
 * - 휴대폰(~899px): 아래 메뉴 / PC(900px~): 왼쪽 메뉴+폴더 탭, 달력 2/3 + 목록 1/3
 * - 색은 모두 아래 :root 변수에서 바꾼다. --cur 는 지금 고른 폴더 색(app.js가 넣음).
 */

:root {
  --bg1: #5b7fbf;         /* 바탕 그라데이션 위쪽 */
  --bg2: #8fa8d8;         /* 가운데 */
  --bg3: #b9a6d6;         /* 아래쪽(보랏빛) */
  --glass: rgba(255, 255, 255, .86);  /* 반투명 판 */
  --glass2: rgba(255, 255, 255, .55);
  --paper: #fffdf8;       /* 일기 종이 */
  --ink: #2f2a26;
  --ink2: #8a8177;
  --line: #e8e1d6;
  --rule: #ece3d3;        /* 노트 줄 */
  --accent: #e0782f;      /* 강조(주황) */
  --danger: #d2463b;
  --cur: #e0782f;         /* 지금 폴더 색 */
  --shadow: 0 2px 6px rgba(30, 40, 80, .12), 0 10px 30px rgba(30, 40, 80, .12);
  --r: 14px;
  --hand: var(--ui);   /* 예전 손글씨 자리. 지금은 고딕과 같음 */
  --ui: -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg1: #1f2b45; --bg2: #2b3656; --bg3: #3a3152;
    --glass: rgba(34, 36, 46, .88); --glass2: rgba(34, 36, 46, .6);
    --paper: #2a2824; --ink: #eee8df; --ink2: #a59d92; --line: #3f3b35; --rule: #3a362f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg1) 0%, var(--bg2) 50%, var(--bg3) 100%) fixed;
  color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
/* 바탕에 은은한 빛 번짐 두 개 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 30vmax at 15% 20%, rgba(255, 255, 255, .25), transparent 70%),
    radial-gradient(35vmax 30vmax at 85% 80%, rgba(255, 220, 200, .25), transparent 70%);
}
body.noscroll { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }
[hidden] { display: none !important; }

/* ---------- 버튼 ---------- */
.btn { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 8px 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn.wide { width: 100%; margin-top: 8px; padding: 11px; }
.grow { flex: 1; }

/* ---------- 반투명 판 + 색 머리 막대 ---------- */
.panel {
  background: var(--glass); border-radius: var(--r); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 6px; padding: 10px 12px;
  background: var(--cur); color: #fff;
}
.ph-title { flex: 1; display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 0; }
.ph-title b { font-family: var(--hand); font-size: 19px; font-weight: 700; }
.ph-title small { font-size: 12px; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hbtn { border: 0; background: rgba(255, 255, 255, .2); color: #fff; border-radius: 10px; min-width: 38px; height: 38px; font-size: 22px; }
.hbtn.small { font-size: 13px; padding: 0 10px; }

/* ---------- 큰 틀 ---------- */
.app { min-height: 100vh; }
.main { padding: 0 12px 96px; max-width: 760px; margin: 0 auto; }

/* 휴대폰: 아래 메뉴 */
.side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
.side .brand, .side-folders { display: none; }
.nav {
  display: flex; background: var(--glass); border-top: 1px solid rgba(255, 255, 255, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav button { flex: 1; border: 0; background: none; padding: 7px 0 5px; display: flex; flex-direction: column; align-items: center; font-size: 12px; color: var(--ink2); }
.nav button .ico { font-size: 22px; line-height: 1.2; filter: grayscale(.7); opacity: .65; }
.nav button.on { color: var(--accent); font-weight: 700; }
.nav button.on .ico { filter: none; opacity: 1; }

.fab {
  position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 21;
  width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: var(--cur); color: #fff;
  font-size: 30px; line-height: 1; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

/* ---------- 상태줄 (동기화·용량) ---------- */
.statusbar {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 2px 6px; font-size: 12px; color: #fff; cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}
.statusbar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage { border: 0; background: rgba(255, 255, 255, .25); border-radius: 999px; padding: 2px 10px; font-size: 12px; color: #fff; white-space: nowrap; }
.usage.danger { background: var(--danger); }

/* ---------- 휴대폰 폴더 줄: 색 탭 ---------- */
.folderbar { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 0; scrollbar-width: none; }
.folderbar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; background: var(--c); color: #fff; border-radius: 10px 10px 0 0;
  padding: 6px 12px 8px; font-size: 13px; font-weight: 600; opacity: .7; transform: translateY(4px);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
}
.chip.on { opacity: 1; transform: none; }

/* ---------- 달력 + 오른쪽 목록 ---------- */
.cal-layout { display: flex; flex-direction: column; gap: 12px; }
.cal-card { border-top-left-radius: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; padding: 4px 6px 8px; }
.wk { text-align: center; font-size: 12px; color: var(--ink2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.wd0, .wd0 .n { color: #d6513f; } .wd6, .wd6 .n { color: #3f74c9; }
.cell {
  border: 0; border-bottom: 1px solid var(--line); background: none; min-width: 0; min-height: 64px;
  display: flex; flex-direction: column; align-items: stretch; padding: 3px 2px; text-align: left;
}
.cell .top { display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.cell .n { font-size: 13px; font-weight: 600; line-height: 1.5; padding: 0 5px; color: var(--ink); }
.cell .face { font-size: 13px; line-height: 1; }
.cell .lines { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; min-width: 0; }
.cell .ln {
  display: block; font-size: 10px; line-height: 1.4; color: var(--ink);
  background: color-mix(in srgb, var(--c) 22%, transparent); border-left: 2px solid var(--c);
  border-radius: 3px; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cell .more { font-size: 10px; color: var(--ink2); padding-left: 3px; }
.cell.other { opacity: .35; }
.cell.today .n { background: var(--cur); color: #fff; border-radius: 999px; }
.cell.sel { background: color-mix(in srgb, var(--cur) 12%, transparent); box-shadow: inset 0 0 0 2px var(--cur); border-radius: 8px; }

.side-list { padding-bottom: 8px; }
.sl-head { font-size: 16px; font-weight: 700; padding: 12px 14px 6px; }
.sl-head.sub { font-size: 14px; color: var(--ink2); border-top: 1px solid var(--line); margin-top: 8px; }
.sl-day, .sl-recent { padding: 0 10px; }
.empty { color: var(--ink2); text-align: center; padding: 14px 0; font-size: 14px; }
.empty.big { padding: 50px 0; line-height: 1.8; }

/* PC: 달력 2/3 + 목록 1/3 */
@media (min-width: 900px) {
  .cal-layout { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(280px, 1fr); align-items: start; }
  /* 칸 높이 = (화면 높이 - 머리·요일줄 등) ÷ 줄 수. 아무리 작아도 96px */
  .cal-grid.rows5 .cell { min-height: max(96px, calc((100vh - 190px) / 5)); }
  .cal-grid.rows6 .cell { min-height: max(96px, calc((100vh - 190px) / 6)); }
  .cell { padding: 5px 4px; }
  .cell .n { font-size: 15px; }
  .cell .face { font-size: 17px; }
  .cell .ln { font-size: 13px; padding: 1px 5px; }
  .wk { font-size: 13px; }
  .side-list { position: sticky; top: 12px; max-height: calc(100vh - 60px); display: flex; flex-direction: column; }
  .sl-recent { overflow-y: auto; flex: 1; }
}

/* ---------- 일기 카드 ---------- */
.card {
  width: 100%; text-align: left; display: flex; gap: 10px; align-items: stretch;
  background: var(--paper); border: 0; border-left: 5px solid var(--c); border-radius: 10px;
  padding: 9px 10px 9px 8px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(30, 40, 80, .1);
}
.card .date { flex: none; width: 40px; text-align: center; display: flex; flex-direction: column; justify-content: center; }
.card .date b { font-size: 22px; line-height: 1.1; font-weight: 700; }
.card .date span { font-size: 11px; color: var(--ink2); white-space: nowrap; }
.card .txt { flex: 1; min-width: 0; }
.card .t { font-size: 15px; font-weight: 700; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .p { color: var(--ink2); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .m { font-size: 11px; color: var(--ink2); margin-top: 3px; }
.card .fname { background: color-mix(in srgb, var(--c) 18%, transparent); border-radius: 6px; padding: 1px 6px; margin-right: 4px; }
.card .thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; background: var(--line) center / cover no-repeat; align-self: center; }

/* 한 번 누른 카드(두 번 누르면 열림) */
.card.picked { box-shadow: 0 0 0 2px var(--c), 0 2px 8px rgba(30, 40, 80, .15); }
.card, .cell { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.hint { font-size: 11px; color: var(--ink2); padding: 0 14px 4px; }

/* ---------- 목록 화면 ---------- */
.list-panel { border-top-left-radius: 0; }
.search { padding: 10px 10px 0; }
.search input { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 12px; }
.list-body { padding: 0 10px 10px; }
.month-sep { font-size: 14px; font-weight: 700; color: var(--ink2); margin: 12px 4px 6px; }

/* ---------- 폴더 화면: 겹쳐 쌓은 색 탭 ---------- */
.folder-stack { padding: 14px 12px 16px; display: flex; flex-direction: column; }
.fstack {
  position: relative; display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--c, #fff); color: #fff; border: 0; border-radius: 12px 12px 6px 6px;
  padding: 14px 16px 22px; margin-bottom: -10px; box-shadow: 0 -2px 6px rgba(0, 0, 0, .12);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .15); font-weight: 600; text-align: left;
}
.fstack.all { background: var(--glass2); color: var(--ink); text-shadow: none; border: 1px solid var(--line); }
.fstack .fi { font-size: 24px; }
.fstack .fn { flex: 1; font-size: 16px; }
.fstack .fc { font-size: 13px; background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 1px 9px; }
.fstack.all .fc { background: var(--line); }
.fedit { border: 0; background: rgba(255, 255, 255, .3); color: #fff; border-radius: 50%; width: 32px; height: 32px; }
.fstack.add { background: var(--paper); color: var(--ink2); border: 2px dashed var(--line); text-shadow: none; justify-content: center; margin-bottom: 0; padding: 14px; margin-top: 4px; }

/* ---------- 설정 ---------- */
.set-sec { padding: 14px 16px; margin: 4px 0 12px; }
.set-sec h3 { margin: 0 0 6px; font-size: 16px; }
.set-sec p { margin: 4px 0 10px; }
.set-sec .row { display: flex; gap: 8px; flex-wrap: wrap; }
.sub { color: var(--ink2); font-size: 13px; }
.warn { color: var(--danger); font-size: 14px; }
.u-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; }
.u-row span { color: var(--ink2); }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0 2px; }
.bar i { display: block; height: 100%; background: #5cb36a; border-radius: 999px; }
.bar.caution i { background: #e8a83a; }
.bar.danger i { background: var(--danger); }
.ver { text-align: center; color: #fff; opacity: .8; font-size: 12px; }

/* ---------- PC: 왼쪽 메뉴 + 색깔 폴더 탭 ---------- */
@media (min-width: 900px) {
  .side {
    top: 0; bottom: 0; right: auto; width: 230px; padding: 18px 12px; overflow-y: auto;
    background: rgba(20, 30, 60, .18); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, .25);
  }
  .side .brand { display: block; font-size: 22px; font-weight: 800; color: #fff; padding: 0 8px 14px; text-shadow: 0 1px 3px rgba(0, 0, 0, .2); white-space: nowrap; }
  .nav { flex-direction: column; gap: 2px; background: var(--glass); border: 0; border-radius: 12px; padding: 6px; }
  .nav button { flex-direction: row; gap: 10px; padding: 8px 10px; font-size: 15px; border-radius: 8px; color: var(--ink); }
  .nav button.on { background: color-mix(in srgb, var(--accent) 14%, transparent); }
  .side-folders { display: flex; flex-direction: column; margin-top: 18px; }
  .ftab {
    display: flex; align-items: center; gap: 8px; border: 0; text-align: left;
    background: var(--c, var(--glass)); color: #fff; border-radius: 10px 10px 4px 4px;
    padding: 10px 12px 16px; margin-bottom: -6px; font-weight: 600; font-size: 14px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, .14); text-shadow: 0 1px 1px rgba(0, 0, 0, .15);
    transition: transform .12s;
  }
  .ftab:hover { transform: translateX(3px); }
  .ftab.on { transform: translateX(8px); box-shadow: 0 -2px 5px rgba(0, 0, 0, .14), 0 4px 12px rgba(0, 0, 0, .2); }
  .ftab.all { background: var(--glass); color: var(--ink); text-shadow: none; margin-bottom: 6px; border-radius: 10px; padding-bottom: 10px; }
  .ftab .fi { font-size: 18px; }
  .ftab .fn { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ftab .fc { font-size: 12px; background: rgba(255, 255, 255, .3); border-radius: 999px; padding: 0 8px; }
  .ftab.all .fc { background: var(--line); }
  .ftab.add { background: transparent; color: #fff; box-shadow: none; border: 1px dashed rgba(255, 255, 255, .6); border-radius: 10px; margin-top: 12px; padding: 8px 12px; justify-content: center; }
  .main { margin-left: 230px; max-width: none; padding: 0 28px 40px; }
  .main > * { max-width: 1700px; margin-left: auto; margin-right: auto; }
  .folderbar { display: none; }
  .cal-card, .list-panel { border-top-left-radius: var(--r); }
  .fab { bottom: 28px; right: 32px; }
  .list-panel, #view-folders .panel, #view-settings { max-width: 760px; }
}

/* ---------- 일기 쓰기 창 ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; background: linear-gradient(160deg, var(--bg1), var(--bg3)); display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--c, var(--accent)); color: #fff; }
.sheet-head .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn.save { background: #fff; color: var(--c, var(--accent)); border: 0; font-weight: 700; }
.sheet-title { flex: 1; text-align: center; font-weight: 700; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.paper { max-width: 760px; margin: 0 auto; background: var(--paper); border-radius: var(--r); padding: 14px 16px 20px; box-shadow: var(--shadow); }
.ed-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ed-row input[type=date], .ed-row select { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 6px 10px; flex: 1; min-width: 140px; }
.picks { flex-direction: column; gap: 4px; }
.pick { display: flex; gap: 2px; flex-wrap: wrap; }
.pk { border: 1px solid transparent; background: none; border-radius: 10px; font-size: 22px; padding: 2px 5px; filter: grayscale(1); opacity: .4; }
.pk.on { filter: none; opacity: 1; border-color: var(--c, var(--accent)); }
.ed-title { width: 100%; border: 0; border-bottom: 2px solid var(--c, var(--accent)); background: none; font-size: 19px; font-weight: 700; padding: 8px 2px; outline: none; }
/* 줄 노트 */
.ed-body {
  width: 100%; border: 0; outline: none; resize: none; background: transparent;
  font-size: 16px; line-height: 32px; padding: 4px 2px 0; min-height: 260px;
  background-image: linear-gradient(transparent 31px, var(--rule) 31px, var(--rule) 32px);
  background-size: 100% 32px; background-attachment: local;
}
.attach { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ph { position: relative; width: 96px; height: 96px; border-radius: 10px; background: var(--line) center / cover no-repeat; cursor: zoom-in; }
.x { position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); font-size: 16px; line-height: 1; }
.audios { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.au { position: relative; background: color-mix(in srgb, var(--c, var(--accent)) 8%, var(--paper)); border-radius: 10px; padding: 8px 10px; }
.au-top { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink2); }
.au .x { position: static; width: 24px; height: 24px; }
.au audio { width: 100%; height: 40px; margin-top: 4px; }
.au-tr { font-size: 14px; color: var(--ink2); margin-top: 4px; }

.toolbar { display: flex; justify-content: space-around; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tool { border: 0; background: none; display: flex; flex-direction: column; align-items: center; font-size: 24px; padding: 2px 10px; cursor: pointer; border-radius: 10px; }
.tool span { font-size: 12px; color: var(--ink2); max-width: 90px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tool.danger span { color: var(--danger); }
.tool.live { background: var(--c, var(--accent)); }
.tool.live span { color: #fff; }

.recbar {
  position: absolute; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom));
  background: #2f2a26; color: #fff; border-radius: 16px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  max-width: 736px; margin: 0 auto;
}
.recdot { width: 12px; height: 12px; border-radius: 50%; background: #e5534b; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.rec-opt { font-size: 13px; display: flex; align-items: center; gap: 4px; }
.rec-live { flex: 1 1 100%; order: 5; font-size: 13px; opacity: .8; min-height: 1em; }
.recbar .btn { margin-left: auto; --c: #e5534b; }

/* ---------- 연·월 고르기 ---------- */
.ym-open { border: 0; background: rgba(255, 255, 255, .12); color: #fff; border-radius: 10px; padding: 2px 14px; cursor: pointer; }
.ym-open:hover { background: rgba(255, 255, 255, .25); }
.ym-box { max-width: 360px; }
.ym-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.ym-head b { font-size: 20px; }
.ym-y { border: 0; background: var(--line); border-radius: 10px; width: 44px; height: 40px; font-size: 22px; }
.ym-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ym-m { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 0 8px; font-weight: 600; display: flex; flex-direction: column; align-items: center; min-height: 54px; }
.ym-m small { font-size: 10px; color: var(--accent); font-weight: 400; }
.ym-m.now { border-color: var(--accent); }
.ym-m.on { background: var(--cur); color: #fff; border-color: var(--cur); }
.ym-m.on small { color: #fff; }

/* ---------- 폴더 창 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(20, 25, 50, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--paper); border-radius: 18px; padding: 18px; width: 100%; max-width: 420px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.modal-title { font-weight: 700; font-size: 18px; margin-bottom: 10px; }
.modal-box > input { width: 100%; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 10px 12px; }
.fm-label { font-size: 13px; color: var(--ink2); margin: 12px 0 6px; }
.swatches, .icons { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; }
.sw.on { border-color: var(--ink); }
.ic { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: var(--line); font-size: 22px; }
.ic.on { border-color: var(--accent); background: var(--paper); }
.modal-actions { display: flex; gap: 8px; margin-top: 18px; align-items: center; }

/* ---------- 잠금 화면 ---------- */
.lock { position: fixed; inset: 0; z-index: 100; background: linear-gradient(160deg, var(--bg1), var(--bg3)); display: flex; align-items: center; justify-content: center; }
.lock-box { text-align: center; padding: 16px; color: #fff; }
.lock-title { font-size: 30px; font-weight: 800; text-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.lock-sub { opacity: .9; margin-bottom: 18px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin-bottom: 26px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; }
.pin-dots i.on { background: #fff; }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 14px; justify-content: center; }
.keypad button { width: 72px; height: 72px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .18); color: #fff; font-size: 26px; }
.keypad button:empty { visibility: hidden; }

/* ---------- 사진 크게 보기 / 알림 ---------- */
.viewer { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, .92); display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer-close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 1;
  border: 0; background: rgba(255, 255, 255, .9); color: #222; border-radius: 999px; padding: 8px 14px; font-weight: 700;
}
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); z-index: 200;
  background: #2f2a26; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; max-width: calc(100% - 32px); text-align: center;
}
