/* memo 화면 스타일. 달력 · 메모 화면은 docs/mockup_v1.html 시안(사용자와 맞춘 모양)을 그대로 옮겼다. */
:root {
  --bg: #f8fafd;
  --surface: #ffffff;
  --surface-2: #f0f4f9;
  --line: #dde3ea;
  --ink: #1f1f1f;
  --ink-2: #444746;
  --muted: #747775;
  --primary: #0b57d0;
  --primary-soft: #d3e3fd;
  --shadow: 0 1px 2px rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
  --shadow-2: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px rgba(60,64,67,.3);
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; font-size: 14px; word-break: keep-all; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

/* ── 상단 ── */
.top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 8px; width: auto; font-size: 18px; white-space: nowrap; color: var(--ink-2); }
.search { flex: 1; min-width: 0; max-width: 720px; height: 46px; border-radius: 24px; background: var(--surface-2); display: flex; align-items: center; padding: 0 18px; gap: 10px; color: var(--muted); }
.search input { border: 0; background: transparent; outline: none; flex: 1; min-width: 0; font-size: 15px; }   /* 좁으면 검색창이 줄어들어 오른쪽 보기 버튼이 잘리지 않게 */
.views { display: flex; flex: none; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; margin-left: auto; }
.views button { border: 0; background: transparent; padding: 8px 16px; color: var(--ink-2); }
.views button.on { background: var(--primary-soft); color: #041e49; font-weight: 700; }

/* ── 틀 ── */
.wrap { display: flex; height: calc(100% - 64px); }
.side { width: 140px; flex: none; padding: 8px 6px 16px 8px; overflow: auto; transition: width .18s, padding .18s; }
.side-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); font-size: 20px; flex: none; }
.side-btn:hover { background: var(--surface-2); }
body.side-min .side { width: 60px; padding: 8px 6px; overflow: hidden; }
body.side-min .side h4 { display: none; }
body.side-min .cal { justify-content: center; padding: 7px 0; }
body.side-min .cal .nm { display: none; }
body.side-min .box { width: 20px; height: 20px; }
body.side-min .kinds { flex-direction: column; align-items: center; padding: 10px 0 0; margin-top: 8px; border-top: 1px solid var(--line); }
body.side-min .fab { width: 48px; padding: 0; justify-content: center; }
body.side-min .fab span { display: none; }
.fab { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 14px 0 12px; border: 0; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: 16px; white-space: nowrap; }
.fab b { font-size: 24px; color: var(--primary); font-weight: 400; line-height: 1; }
.side h4 { margin: 12px 4px 4px; font-size: 13px; color: var(--ink-2); }
.cal { display: flex; align-items: center; gap: 8px; padding: 5px 4px; font-size: 13px; white-space: nowrap; overflow: hidden; border-radius: 8px; cursor: pointer; }
.cal:hover { background: var(--surface-2); }
.box { width: 18px; height: 18px; border-radius: 3px; border: 2px solid var(--c); background: var(--c); display: grid; place-items: center; color: #fff; font-size: 12px; flex: none; }
.cal.off .box { background: transparent; }
.cal.off .box::after { content: ""; }
.cal .box::after { content: "✓"; }
.kinds { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 4px; }
.side .chip { padding: 4px 9px; font-size: 12.5px; }
.cal .nm { overflow: hidden; text-overflow: ellipsis; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 10px; font-size: 13px; color: var(--ink-2); }
.chip.on { background: var(--primary-soft); border-color: transparent; color: #041e49; font-weight: 700; }
.main { flex: 1; min-width: 0; background: var(--surface); border-radius: 24px 0 0 0; overflow: auto; position: relative; }
.pane { display: none; padding: 20px 28px 40px; }
.pane.on { display: block; }
.pane-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.pane-head h2 { margin: 0; font-size: 22px; font-weight: 400; }
.pane-head .nav { display: flex; gap: 4px; }
.pane-head .nav button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; font-size: 18px; color: var(--ink-2); }
.pane-head .nav button:hover { background: var(--surface-2); }
.pane-head .today { border: 1px solid var(--line); background: transparent; border-radius: 18px; padding: 7px 16px; }
.note { font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* ── 메모 보기 (Keep 형) ── */
.group-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 18px 4px 10px; letter-spacing: .02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
/* 메모 달별 묶음: 월 달력과 같은 계절색 (머리줄 아래 연한 선 + 왼쪽 연한 세로 줄), 머리줄은 스크롤해도 위에 붙음 */
.card.memo { background: color-mix(in srgb, var(--c) 9%, #fff); }   /* 메모(종일) 카드는 캘린더 색을 아주 연하게 깐 바탕, 일정은 흰 바탕 */
/* 선택한 카드 = 살짝 위로 떠오른 입체감 (두 번 클릭 · Enter 로 열기) */
.card.sel, .card.sel:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 12px 26px rgba(60,64,67,.24), 0 3px 8px rgba(60,64,67,.16); }
/* 메모 탭: 머리줄(메모 · 카드 높이)은 고정, 아래 카드 목록만 스크롤 */
#p-memo.on { display: flex; flex-direction: column; height: 100%; padding: 20px 0 0 28px; }
#p-memo .pane-head { flex: none; padding-right: 28px; }
#memoList { flex: 1; min-width: 0; min-height: 0; overflow: auto; padding: 0 28px 40px 0; scrollbar-width: thin; }   /* 위 여백 0: 붙는 달 머리줄 위로 카드가 비치지 않게 */
.mgrp { position: relative; padding-left: 18px; margin-bottom: 26px; }
.mgrp::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 0; width: 2px; border-radius: 2px; background: var(--mc); opacity: .4; }
.mg-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 8px; margin: 0 0 12px; padding: 6px 0 6px; background: var(--surface); border-bottom: 2px solid color-mix(in srgb, var(--mc) 40%, transparent); }
.mg-head b { font-size: 17px; color: color-mix(in srgb, var(--mc) 78%, #000); }
.mg-head span { font-size: 12.5px; color: var(--muted); }
.mg-head .cnt { margin-left: auto; }
.cards[data-h="1"] .card { height: 140px; }
.cards[data-h="2"] .card { height: 220px; }
.cards[data-h="3"] .card { height: 330px; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 12px; background: var(--surface); cursor: pointer; transition: box-shadow .15s, transform .15s; position: relative; }
.card:hover { box-shadow: var(--shadow); }
.card::before { content: ""; position: absolute; left: 16px; right: 16px; top: 0; height: 3px; border-radius: 0 0 3px 3px; background: var(--c); }
.card .meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.tag { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); }
.tag.일정 { background: #e8f0fe; color: #174ea6; }
/* 메모 카드의 종류 태그 = 바로 크게 보기 버튼 (누르기 쉽게 조금 크게, 올리면 진하게) */
.card .open-tag { padding: 3px 9px; cursor: pointer; transition: filter .12s, box-shadow .12s; }
.card .open-tag:hover { filter: brightness(.93); box-shadow: 0 1px 3px rgba(60,64,67,.25); }
.tag.메모 { background: #fef7e0; color: #8a5300; }
.card h3 { margin: 0 0 6px; font-size: 16px; }
.card .body { color: var(--ink-2); line-height: 1.6; flex: 1; min-height: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 22px), transparent); mask-image: linear-gradient(#000 calc(100% - 22px), transparent); }
.card h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hsel { display: flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; color: var(--ink-2); }
.hsel button { width: 32px; height: 30px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; color: var(--ink-2); }
.hsel button.on { background: var(--primary-soft); border-color: transparent; color: #041e49; font-weight: 700; }
.body ul, .body ol, .doc ul, .doc ol { margin: 4px 0; padding-left: 22px; }
.body p, .doc p { margin: 0 0 6px; }
.doc a, .body a { color: var(--primary); }

/* ── 달력 보기 ── */
#p-month.on { display: flex; flex-direction: column; height: 100%; padding: 16px 16px 16px 6px; }
#p-month .pane-head { padding-left: 14px; }
/* 월 · 주 머리: 제목은 가운데, 바로 오른쪽에 위 · 아래(이전 · 다음 달 / 주) 버튼 */
.mhead { display: grid; grid-template-columns: 1fr auto 1fr; }
.mhead .today { justify-self: start; }
.mtitle { position: relative; }
.mtitle h2 { font-weight: 700; }
#weekTitle { font-size: 19px; }   /* 주 제목은 날짜 범위라 길어서 월 제목(22px)보다 작게 */
/* 제목 칸 폭 고정(가장 긴 제목 기준) + 글자는 오른쪽 정렬 → 제목 길이가 바뀌어도 위 · 아래 버튼이 같은 자리,
   글자 끝은 늘 버튼 바로 옆 (빠르게 연달아 누르기) */
.mtitle h2 { text-align: right; white-space: nowrap; }
#monthTitle { min-width: 150px; }   /* '2026년 12월' */
#weekTitle { min-width: 290px; }    /* '2026년 12월 28일 – 1월 3일' */
.mtitle h2, .mtitle .mnav button { color: color-mix(in srgb, var(--mc, #444) 78%, #000); }   /* 왼쪽 달 이름 글자와 같은 색 */
.mnav svg path { stroke-width: 3; }   /* 제목과 같이 굵게 */
.mnav { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; display: flex; flex-direction: column; width: max-content; }   /* 위 · 아래 버튼을 세로로 쌓음 */
.mnav button { width: 26px; height: 17px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; padding: 0; }
.mnav button:hover { background: var(--surface-2); }
.mnav button:first-child svg { transform: translateY(3px); }   /* 위 화살표를 아래 화살표 쪽으로 3px */
.mright { justify-self: end; display: flex; align-items: center; min-width: 0; max-width: 100%; padding-left: 44px; }   /* 왼쪽 44px = 위 · 아래 버튼 자리 */
.mright .note { margin-left: 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calwrap { display: flex; gap: 0; flex: 1; min-height: 0; position: relative; overflow: hidden; }   /* 주 넘김 애니메이션(18px 밀림)이 밖으로 삐져나와 바깥 스크롤바가 잠깐 생기지 않게 */
.month { flex: 1; min-width: 0; display: grid; grid-template-columns: 16px repeat(7, minmax(0, 1fr)); grid-template-rows: 28px repeat(5, 1fr); }
.month .dow { font-size: 11px; color: var(--muted); text-align: center; padding-top: 8px; border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
.month .dow.d0, .day.d0 { border-left: 1px solid var(--line); }
/* 요일 머리 (월 · 주 공통): 굵게, 일요일 빨강 · 토요일 파랑 */
.month .dow, .wday .dw { font-weight: 700; }
.month .dow.sun, .wday.sun .dw, .wday.sun.today .dw { color: #d93025; }   /* 오늘이어도 요일 색 (오늘은 날짜 동그라미로 표시) */
.month .dow.sat, .wday.sat .dw, .wday.sat.today .dw { color: #1a73e8; }
/* 좁은 화면: 제목 옆 요일 범위 선택 (일-목 | 월-금 | 화-토) */
.colsel { display: flex; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-left: 12px; }   /* 오른쪽 끝 (안내 문구가 숨는 좁은 화면에선 아래 media 에서 auto) */
.colsel[hidden] { display: none; }
.colsel button { border: 0; background: transparent; padding: 5px 12px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.colsel button + button { border-left: 1px solid var(--line); }
.colsel button:hover { background: var(--surface-2); }
.colsel button.on { background: var(--primary-soft); color: #041e49; font-weight: 700; }
.colsel button[data-step] { padding: 5px 10px; font-size: 15px; line-height: 1; }
.colsel button:disabled { color: #c4c7c5; background: transparent; cursor: default; }
/* 달 구분 줄: 주마다 그 주에 날짜가 더 많은 달의 색 */
.wk { position: relative; }
.wk::before { content: ""; position: absolute; left: 6px; width: 2px; top: 0; bottom: 0; background: var(--mc); opacity: .4; }   /* 달 경계선과 같은 연한 색 (달 이름 글자는 진하게 유지) */
.wk.first::before { top: 34px; border-radius: 2px 2px 0 0; }
.wk.last::before { bottom: 6px; border-radius: 0 0 2px 2px; }
.wk .ml { position: absolute; top: 6px; left: 1px; font-size: 11px; font-weight: 700; color: color-mix(in srgb, var(--mc) 78%, #000);   /* 글자는 조금 어둡게 (3월 노랑도 읽히게) */ writing-mode: vertical-rl; line-height: 1; }
.wk .ml b { text-combine-upright: all; font-weight: 700; }
.day { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 4px 2px; overflow: hidden; }

/* ── 주 달력 ── */
#p-week.on { display: flex; flex-direction: column; height: 100%; padding: 16px 16px 16px 6px; }
#p-week .pane-head { padding-left: 14px; }
.week { flex: 1; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.wrow { display: grid; grid-template-columns: 52px repeat(var(--wn, 7), minmax(0, 1fr)); }   /* --wn = 보이는 요일 수 (좁은 화면) */
.whead { border-bottom: 1px solid var(--line); }
.whead, .wallday { padding-right: var(--sbw, 0px); }   /* 아래 시간표 스크롤바 폭만큼 비워 세로선 맞춤 */
.wday { text-align: center; padding: 6px 0 8px; border-left: 1px solid var(--line); }
.wday .dw { font-size: 11px; color: var(--muted); }
.wday .dn { font-size: 22px; width: 40px; height: 40px; line-height: 40px; border-radius: 50%; margin: 2px auto 0; color: var(--ink-2); }
.wday.today .dw { color: var(--primary); font-weight: 700; }
.wday.today .dn { background: var(--primary); color: #fff; font-weight: 700; }
.wallday { border-bottom: 1px solid var(--line); min-height: 30px; }
.wallday .lbl { font-size: 11px; color: var(--muted); text-align: right; padding: 6px 8px 0 0; }
.wallday .cell { border-left: 1px solid var(--line); padding: 3px 3px 1px; min-width: 0; }
.wbody { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.wgrid { position: relative; height: calc(24 * var(--hh)); }
.wgrid .wrow { height: 100%; }
.whours { position: relative; }
.whours span { position: absolute; right: 8px; font-size: 11px; color: var(--muted); transform: translateY(-7px); }
.wcol { position: relative; border-left: 1px solid var(--line);
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hh) - 1px), #e9edf2 calc(var(--hh) - 1px) var(--hh)); }
.wcol.today { background-color: #f8fbff; }
/* 주 시간 블록: 캘린더 색을 연하게 깔고 왼쪽 굵은 띠 + 글자는 같은 색 계열 진하게 */
.wev { position: absolute; border-radius: 6px; background: color-mix(in srgb, var(--c) 20%, #fff); color: color-mix(in srgb, var(--c) 55%, #000); padding: 3px 6px 3px 8px; font-size: 12px; line-height: 1.35; overflow: hidden; cursor: pointer; border: 1px solid #fff; box-shadow: inset 3px 0 0 var(--c); }
.wev b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wev:hover { filter: brightness(.95); }
.wev.sel { z-index: 2; box-shadow: inset 3px 0 0 var(--c), 0 0 0 2px #fff, 0 0 0 4px var(--primary), 0 4px 10px rgba(11,87,208,.35); }
.wev.sel.pop { animation: selPop .28s ease-out; }
.wcol.has-sel { background-color: #eef4fe; }
.nowline { position: absolute; left: 0; right: 0; height: 2px; background: #ea4335; z-index: 3; pointer-events: none; }
.nowline::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ea4335; }

/* ── 드래그로 옮기기 ── */
.ev[draggable="true"] { cursor: grab; }
.ev.dragging { opacity: .35; outline: 2px dashed #9aa0a6; outline-offset: -2px; }
#insLine { position: fixed; height: 4px; border-radius: 2px; background: var(--primary); box-shadow: 0 0 0 2px #fff; pointer-events: none; z-index: 40; display: none; }
#insLine::before, #insLine::after { content: ""; position: absolute; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px #fff; }
#insLine::before { left: -6px; }
#insLine::after { right: -6px; }
#insLine span { position: absolute; right: 10px; top: -20px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 9px; white-space: nowrap; }
.day.drop-on, .wallday .cell.drop-on, .wcol.drop-on { background: #e8f0fe !important; outline: 2px dashed var(--primary); outline-offset: -3px; }
.wev { touch-action: none; user-select: none; cursor: grab; }
.wev.dragging-w { opacity: .9; z-index: 5; cursor: grabbing; box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.wev .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; cursor: ns-resize; }
.wev .rz::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: var(--c); opacity: 0; }
.wev:hover .rz::after { opacity: 1; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #303134; color: #e8eaed; border-radius: 8px; padding: 10px 10px 10px 16px;
  display: flex; align-items: center; gap: 14px; font-size: 13.5px; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: .18s; z-index: 30; }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { border: 0; background: transparent; color: #8ab4f8; font-weight: 700; padding: 6px 8px; border-radius: 6px; }
.toast button:hover { background: rgba(138,180,248,.12); }
.toast .tsep { width: 1px; height: 16px; background: #5f6368; margin: 0 -8px; }
.toast #tOk { color: #e8eaed; }
.month.slide-up { animation: slideUp .16s ease-out; }
.month.slide-down { animation: slideDown .16s ease-out; }
@keyframes slideUp { from { transform: translateY(18px); opacity: .55; } to { transform: none; opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-18px); opacity: .55; } to { transform: none; opacity: 1; } }
.day .n.m1 { width: auto; display: table; padding: 0 8px; border-radius: 12px; font-weight: 700; color: var(--ink); }
.day .n { font-size: 12px; text-align: center; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; margin: 0 auto 2px; color: var(--ink-2); }
.day.other .n { color: #b0b4b9; }
/* 날짜 숫자: 일요일 빨강 · 토요일 파랑 (다른 달 날짜는 연하게, 오늘은 파란 동그라미 그대로) */
.day.sun .n { color: #d93025; }
.day.sat .n { color: #1a73e8; }
.day.other.sun .n { color: #f0a9a3; }
.day.other.sat .n { color: #a6c8f5; }
.day.today .n { background: var(--primary); color: #fff; font-weight: 700; }
.ev { display: flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 6px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.ev.allday { background: var(--c); color: #fff; }
.ev.timed .dot { width: 7px; height: 7px; }
.ev:hover { filter: brightness(.95); background-color: var(--surface-2); }
.ev.allday:hover { background: var(--c); }
/* 선택한 일정: 흰 틈 + 파란 굵은 테두리 + 그림자, 시간 일정도 캘린더 색으로 채움, 그 날짜 칸은 연한 파랑 */
.ev.sel { position: relative; z-index: 1; font-weight: 700; transform: scale(1.03);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary), 0 4px 10px rgba(11,87,208,.35); }
.ev.timed.sel { background: #fff; color: var(--ink); }   /* 시간 일정은 선택해도 점 + 글자 모양 유지 (종일 막대와 구분) */
.ev.sel.pop { animation: selPop .28s ease-out; }
@keyframes selPop { 0% { transform: scale(1); } 55% { transform: scale(1.08); } 100% { transform: scale(1.03); } }
/* 달 경계선: 왼쪽 달 줄 색이 바뀌는 줄 위에 한 줄로 (새 달 색을 연하게) */
.day.mline { box-shadow: inset 0 2px 0 var(--bc); }
.day.has-sel { background: #e8f0fe; }
.day.has-sel:hover { background: #e1ebfd; }
.day { overflow: visible; }
.day .ev { max-width: 100%; }
.detail { width: 0; flex: none; overflow: hidden; transition: width .2s; border-left: 1px solid var(--line); background: var(--surface); }
.detail.open { width: var(--pw, 440px); }
.detail .in { width: var(--pw, 440px); padding: 18px 22px; height: 100%; overflow: auto; scrollbar-width: thin; }
.detail .bar { display: flex; justify-content: flex-end; align-items: center; gap: 4px; margin-bottom: 6px; }
.detail .pw { display: flex; align-items: center; gap: 4px; margin-right: auto; font-size: 12px; color: var(--muted); }
.detail .pw button { width: 26px; height: 24px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; font-size: 12px; color: var(--ink-2); padding: 0; }
.detail .pw button.on { background: var(--primary-soft); border-color: transparent; color: #041e49; font-weight: 700; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); font-size: 16px; }
.icon-btn:hover { background: var(--surface-2); }
.detail h3 { margin: 0 0 8px; font-size: 22px; font-weight: 400; display: flex; gap: 10px; align-items: flex-start; }
.detail h3 .dot { width: 14px; height: 14px; border-radius: 4px; margin-top: 8px; }
.detail .when { color: var(--ink-2); margin: 0 0 4px 24px; }
.detail .calname { color: var(--muted); font-size: 13px; margin: 0 0 16px 24px; }
.doc { line-height: 1.7; color: var(--ink); font-size: 14.5px; }
.detail .p-title { width: 100%; border: 0; border-bottom: 1px solid var(--line); font-size: 20px; padding: 4px 2px 6px; outline: none; margin-bottom: 10px; }
.detail .p-title:focus { border-bottom-color: var(--primary); }
.p-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.p-meta .pick { padding: 5px 9px; font-size: 13px; }
.p-meta .pick[hidden] { display: none; }
.detail .ptools { border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; padding: 4px 6px; }
.detail .p-doc { border: 1px solid var(--line); border-radius: 0 0 8px 8px; padding: 12px 14px; min-height: 280px; outline: none; }
.detail .p-doc:focus { border-color: var(--primary); }
.p-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; position: sticky; bottom: 0; background: var(--surface); padding: 8px 0; }
.p-actions .mode-hint { margin-right: auto; }
.p-actions .save { padding: 9px 22px; }
#pRead { cursor: text; }
.detail .doc { border-top: 1px solid var(--line); padding-top: 14px; }

/* ── 편집 (본문 중심) ── */
.editor { position: fixed; inset: 0; background: var(--bg); display: none; z-index: 20; }
.editor.open { display: flex; flex-direction: column; }
.ed-card { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; }
/* 새로 만들기(+): 화면 위에 뜨는 모달 (뒤는 어둡게, 바깥 클릭 · Esc 로 닫기) */
.editor.modal { background: rgba(32,33,36,.45); align-items: center; justify-content: center; padding: 24px; }
.editor.modal .ed-card { flex: none; width: min(820px, 100%); height: min(720px, 100%);   /* 620 은 짧고 화면 끝까지는 길어서 중간 */ background: var(--bg); border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.28); overflow: hidden; animation: modalIn .16s ease-out; }
.editor.modal .ed-meta, .editor.modal .ed-body { padding-left: 20px; }
.editor.modal .ed-top .title { font-size: 20px; min-width: 0; }
/* 좁은 화면(왼쪽 메뉴가 숨는 900px 이하)용 떠 있는 + 버튼 */
.fab-float { display: none; position: fixed; right: 20px; bottom: 20px; z-index: 15; width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--surface); color: var(--primary); font-size: 30px; line-height: 1; box-shadow: 0 2px 6px rgba(60,64,67,.3), 0 6px 16px rgba(60,64,67,.18); }
.fab-float:hover { background: #f1f5fd; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.ed-top, .ed-meta, .ed-body { width: 100%; max-width: 1180px; margin: 0 auto; }
.ed-top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 20px; }
.ed-top .title { flex: 1; max-width: 900px; border: 0; border-bottom: 1px solid transparent; background: transparent; font-size: 24px; padding: 6px 4px; outline: none; }
.ed-top .title:focus { border-bottom-color: var(--primary); }
.save { border: 0; background: var(--primary); color: #fff; border-radius: 20px; padding: 10px 26px; font-weight: 700; }
.ed-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 20px 12px 68px; align-items: center; }
.pick { display: inline-flex; align-items: center; gap: 8px; border: 0; background: var(--surface-2); border-radius: 8px; padding: 7px 12px; color: var(--ink); }
.pick select, .pick input { border: 0; background: transparent; outline: none; }
.pick .dot { width: 11px; height: 11px; }
.more { border: 0; background: transparent; color: var(--primary); padding: 7px 8px; }
.ed-body { flex: 1; display: flex; gap: 20px; padding: 0 20px 20px 68px; min-height: 0; }
.paper { flex: 1; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; }
.tools { display: flex; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--line); align-items: center; }
.tools button { border: 0; background: transparent; width: 34px; height: 32px; border-radius: 6px; color: var(--ink-2); font-size: 14px; }
.tools button:hover { background: var(--surface-2); }
.tools .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.tools .hint { margin-left: auto; font-size: 12px; color: var(--muted); }
.paper .doc { flex: 1; overflow: auto; padding: 22px 28px; outline: none; font-size: 15px; }
.editor.read .ed-edit, .editor.edit .ed-read { display: none !important; }
.ed-top .rtitle { flex: 1; font-size: 26px; margin: 0; padding: 6px 4px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-read.meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--ink-2); }
.ed-read.meta-line .dot { width: 11px; height: 11px; }
.ed-read.meta-line .sep { color: var(--line); }
.btn-line { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 9px 20px; color: var(--ink-2); font-weight: 600; }
.btn-line.primary { border-color: var(--primary); color: var(--primary); }
.btn-line:hover { background: var(--surface-2); }
.editor.read .paper .doc { cursor: text; }
.editor.read .paper { box-shadow: none; border: 1px solid var(--line); }
.mode-hint { font-size: 12px; color: var(--muted); }
.extra { width: 280px; flex: none; display: none; }
.extra.open { display: block; }
.extra .grp { background: var(--surface); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.extra label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.extra input { width: 100%; border: 0; background: var(--surface-2); border-radius: 6px; padding: 7px 10px; margin-bottom: 8px; }


@media (max-width: 1280px) {
  /* 닫힌 상태도 겹친 자리(absolute)에 둠 → 열고 닫는 동안 달력 폭이 변하지 않아 깜빡이지 않음 */
  .detail { position: absolute; right: 0; top: 0; bottom: 0; z-index: 6; border-left: 0; }
  .detail.open { width: min(var(--pw, 440px), 70%); border-radius: 12px 0 0 12px; box-shadow: -8px 0 24px rgba(60,64,67,.2); }
  .detail .in { width: 100%; }
  .pane-head .note { display: none; }
  .colsel { margin-left: auto; }
}
@media (max-width: 900px) {
  .side { display: none; }
  .main { border-radius: 0; }
  .pane { padding: 16px; }
  #p-memo.on { padding: 16px 0 0 16px; }
  #p-memo .pane-head, #memoList { padding-right: 16px; }
  .detail.open { position: fixed; inset: 64px 0 0 0; width: auto; z-index: 10; }
  .detail .in { width: auto; }
  .ed-meta, .ed-body { padding-left: 16px; padding-right: 16px; }
  .extra.open { display: none; }
}
@media (max-width: 900px) {
  .fab-float { display: block; }
}
@media (max-width: 600px) {
  .editor.modal { padding: 12px; }
  .editor.modal .ed-top { padding: 0 12px; gap: 8px; }
  .editor.modal .ed-meta, .editor.modal .ed-body { padding-left: 12px; padding-right: 12px; }
  .editor.modal .save { padding: 10px 18px; }
  .editor.modal .btn-line { padding: 9px 14px; }
  .tools .hint { display: none; }
  #weekTitle .yr { display: none; }   /* 주 제목 '11월 16일 – 18일' */
  #weekTitle { font-size: 17px; min-width: 190px; }   /* 연도 숨김: '12월 28일 – 1월 3일' */
  .views button { padding: 8px 14px; }
  .search { padding: 0 14px; }
}

/* 로그인 */
/* 화면 정중앙에 고정. 브라우저 확장(웨일 등)이 body 에 요소를 끼워 넣어도 밀리지 않게 body 칸 배치에 기대지 않는다 */
.login-body { min-height: 100vh; }
.login-box { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 40px 44px; width: min(380px, 90vw); text-align: center; }
.login-box h1 { margin: 0 0 6px; font-size: 26px; }
.login-sub, .login-note { color: var(--muted); font-size: 13px; }
.login-error { background: #fce8e6; color: #b3261e; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.google-btn { display: block; margin: 22px 0 10px; padding: 12px; border-radius: 22px; background: var(--primary); color: #fff; text-decoration: none; font-weight: 700; }

/* 공개 문서 (개인정보처리방침 · 서비스 약관) */
.doc-box { max-width: 760px; margin: 40px auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 28px 36px; line-height: 1.7; }
.doc-box h1 { margin: 0 0 4px; font-size: 24px; }
.doc-box h2 { font-size: 17px; margin: 24px 0 6px; }
.doc-date, .doc-foot { color: var(--muted); font-size: 13px; }
.doc-foot { margin-top: 32px; border-top: 1px solid var(--line); padding-top: 12px; }


/* ── 실제 화면 추가분 ── */
/* 불러오는 중: 화면 맨 위 얇은 막대 (구글에서 필요한 범위만 읽는 동안) */
#loading { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: var(--primary); z-index: 50; opacity: 0; transition: width .4s ease, opacity .3s; }
#loading.on { width: 70%; opacity: 1; }
/* 실시간 연결 상태 점 (상단 오른쪽). 끊기면 회색 */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa0a6; flex: none; }
.live-dot.on { background: #34a853; }
.toast.err #tUndo, .toast.err .tsep { display: none; }
/* 읽기 전용 캘린더(생일 · 공휴일 등)의 일정은 끌 수 없음 */
.ev.ro, .wev.ro { cursor: pointer; }
/* M 탭 [오늘] 로 간 카드: 잠깐 파란 테두리로 반짝 */
.card.flash { animation: cardFlash 1.8s ease-out; }
@keyframes cardFlash { 0%, 35% { box-shadow: 0 0 0 3px var(--primary), 0 6px 16px rgba(11,87,208,.25); } 100% { box-shadow: 0 0 0 0 rgba(11,87,208,0); } }
.memo-more { text-align: center; padding: 16px 0 8px; color: var(--muted); font-size: 13px; }
.memo-more button { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 6px 16px; color: var(--ink-2); }
.empty-note { color: var(--muted); padding: 8px 4px; }
