/* 소리노트 — 스타일
   디자인 계획
   - 소재: 좋은 문구(노트 종이)와 필드 레코더(단단한 회색 몸체, 빨간 REC 램프)
   - 레이아웃: 종이가 주인공. 크롬은 조용한 회색, 펜 도구는 왼쪽 세로 레일(펜 없는 손이 닿는 곳),
     녹음기는 아래 왼쪽 '데크'. 세로 모드·폰에서는 레일이 아래 가로 막대가 됨.
   - 색: 잉크 파랑(강조), 녹음 빨강(상태 전용), 종이는 라이트/다크 모두 밝게(잉크 가독성 유지)
   - 글꼴: Pretendard Variable 한 가족. 제목은 굵게·좁게, 숫자는 tabular */
:root {
  --bg: #e9ebe6;
  --surface: #f6f7f3;
  --surface-2: #ffffff;
  --fg: #1d2126;
  --muted: #666c75;
  --line: #d2d5cd;
  --line-strong: #b8bcb3;
  --accent: #3458a3;
  --accent-soft: #e2e8f5;
  --on-accent: #ffffff;
  --rec: #d8321f;
  --rec-soft: #fbe5e1;
  --ok: #2f8f5b;
  --warn: #c7731f;
  --paper: #fcfcf9;
  --paper-line: #d6dae8;
  --paper-margin: #e7a9a9;
  --paper-grid: #e1e3dd;
  --paper-label: #8b909a;
  --paper-ink: #1c2230;
  --select: #3458a3;
  --shadow-1: 0 1px 2px rgba(22, 26, 32, .07), 0 2px 8px -2px rgba(22, 26, 32, .08);
  --shadow-2: 0 2px 6px rgba(22, 26, 32, .08), 0 14px 32px -14px rgba(22, 26, 32, .3);
  --shadow-paper: 0 1px 1px rgba(22, 26, 32, .06), 0 8px 22px -10px rgba(22, 26, 32, .28);
  --radius: 10px;
  --radius-s: 7px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --fs-0: 12px; --fs-1: 13.5px; --fs-2: 15px; --fs-3: 17px; --fs-4: 20px; --fs-5: 26px;
  --rail-w: 60px;
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --deck-h: 64px;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1c20; --surface: #23262b; --surface-2: #2b2f35; --fg: #e5e6e2; --muted: #9ba1a9;
    --line: #353a42; --line-strong: #4a505a; --accent: #8fb0ec; --accent-soft: #2b3750; --on-accent: #0f1420;
    --rec: #ef4b36; --rec-soft: #4a2420; --ok: #5cc48a; --warn: #e29a4b;
    --paper: #ebeae4; --paper-line: #c7cbd9; --paper-margin: #d99c9c; --paper-grid: #d3d5cf; --paper-label: #7d828c; --paper-ink: #1c2230;
    --select: #3458a3;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px -2px rgba(0, 0, 0, .3);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 32px -14px rgba(0, 0, 0, .6);
    --shadow-paper: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 26px -10px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1c20; --surface: #23262b; --surface-2: #2b2f35; --fg: #e5e6e2; --muted: #9ba1a9;
  --line: #353a42; --line-strong: #4a505a; --accent: #8fb0ec; --accent-soft: #2b3750; --on-accent: #0f1420;
  --rec: #ef4b36; --rec-soft: #4a2420; --ok: #5cc48a; --warn: #e29a4b;
  --paper: #ebeae4; --paper-line: #c7cbd9; --paper-margin: #d99c9c; --paper-grid: #d3d5cf; --paper-label: #7d828c; --paper-ink: #1c2230;
  --select: #3458a3;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px -2px rgba(0, 0, 0, .3);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 32px -14px rgba(0, 0, 0, .6);
  --shadow-paper: 0 1px 1px rgba(0, 0, 0, .3), 0 10px 26px -10px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--fs-2);
  line-height: 1.45; overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
  font-feature-settings: "tnum" 0;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [contenteditable]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 22px; height: 22px; flex: none; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden, [hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- 공통 컨트롤 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line); color: var(--fg); font-weight: 500;
  white-space: nowrap; transition: background .12s, border-color .12s, transform .08s;
}
.btn:hover { border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-danger { background: var(--rec); border-color: var(--rec); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: var(--fs-1); }
.ibtn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--radius-s);
  color: var(--fg); transition: background .12s;
}
.ibtn:hover { background: var(--surface-2); }
.ibtn.is-on { background: var(--accent-soft); color: var(--accent); }
.ibtn:disabled { opacity: .4; }
.input, .select, textarea.input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface-2); color: var(--fg);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 999px; font-size: var(--fs-1); font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg); white-space: nowrap;
}
.chip.is-on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.chip-type { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: none; display: inline-block; }
.toggle { position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--line-strong); transition: background .15s; flex: none; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s; }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- 토스트 / 대화상자 / 메뉴 ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: var(--fs-1); font-weight: 500; z-index: 100;
  box-shadow: var(--shadow-2); transition: opacity .18s, transform .18s; max-width: min(90vw, 560px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.is-error { background: var(--rec); color: #fff; }
.dlg-overlay { position: fixed; inset: 0; background: rgba(12, 14, 18, .45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: max(16px, var(--safe-l)) max(16px, var(--safe-r)); }
.dlg { width: min(100%, 440px); max-height: 90vh; overflow: auto; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-2); padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 14px; }
.dlg-wide { width: min(100%, 640px); }
.dlg-title { margin: 0; font-size: var(--fs-4); font-weight: 700; letter-spacing: -.01em; }
.dlg-msg { margin: 0; color: var(--muted); white-space: pre-line; }
.dlg-body { display: flex; flex-direction: column; gap: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.pick-item { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 10px; border-radius: var(--radius-s); text-align: left; }
.pick-item:hover { background: var(--surface-2); }
.pick-item.is-current { background: var(--accent-soft); color: var(--accent); }
.pick-label { flex: 1; }
.pick-hint { color: var(--muted); font-size: var(--fs-1); }
.menu { position: fixed; z-index: 80; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-2); padding: 6px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; border-radius: var(--radius-s); text-align: left; white-space: nowrap; }
.menu-item:hover { background: var(--surface-2); }
.menu-item.is-danger { color: var(--rec); }
.menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.menu-backdrop { position: fixed; inset: 0; z-index: 79; }

/* ---------- 앱 뼈대 ---------- */
#app { height: 100%; display: flex; flex-direction: column; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- 라이브러리 ---------- */
#library { background: var(--bg); }
.lib-body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: calc(12px + var(--safe-t)) 10px 12px max(10px, var(--safe-l)); gap: 6px; overflow: auto; transition: width .18s, padding .18s;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--paper-ink); position: relative; flex: none; }
.brand-mark::before { content: ""; position: absolute; left: 7px; right: 7px; top: 9px; height: 2px; background: #fff; border-radius: 2px; box-shadow: 0 5px 0 #fff, 0 10px 0 #fff; }
.brand-mark::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--rec); }
.brand-name { font-weight: 800; letter-spacing: -.02em; font-size: var(--fs-3); }
.nav-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: var(--radius-s); text-align: left; width: 100%; color: var(--fg); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item .nav-count { margin-left: auto; color: var(--muted); font-size: var(--fs-0); font-variant-numeric: tabular-nums; }
.nav-item .ic { width: 20px; height: 20px; }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px; color: var(--muted); font-size: var(--fs-0); font-weight: 600; }
.nav-head .ibtn { width: 32px; height: 32px; }
.nav-head .ibtn .ic { width: 18px; height: 18px; }
.sidebar-foot { margin-top: auto; padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lib-top {
  display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) max(16px, var(--safe-r)) 10px max(16px, var(--safe-l)); flex-wrap: wrap;
}
.lib-title { font-size: var(--fs-5); font-weight: 800; letter-spacing: -.025em; margin: 0 8px 0 0; line-height: 1.2; }
.lib-count { color: var(--muted); font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.search { position: relative; flex: 1 1 220px; min-width: 160px; max-width: 420px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.search input { padding-left: 40px; border-radius: 999px; }
.lib-tools { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.btn-new { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 600; }
.btn-new:hover { border-color: var(--fg); }
.lib-scroll { flex: 1; overflow: auto; padding: 4px max(16px, var(--safe-r)) calc(32px + var(--safe-b)) max(16px, var(--safe-l)); }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(184px, 1fr)); gap: 18px 16px; }
.note-card { display: flex; flex-direction: column; gap: 8px; text-align: left; border-radius: var(--radius); padding: 0; position: relative; }
.note-card:focus-visible { outline-offset: 6px; }
.thumb {
  aspect-ratio: 800 / 1131; width: 100%; max-width: 100%; border-radius: 4px; background: var(--paper); box-shadow: var(--shadow-paper); overflow: hidden; position: relative;
  border: 1px solid rgba(0, 0, 0, .06);
}
.thumb img { width: 100%; height: 100%; object-fit: contain; object-position: top center; display: block; }
.thumb .thumb-empty { position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, transparent 0 27px, var(--paper-line) 27px 28px); }
.note-card.is-pinned .thumb::before { content: ""; position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; background: var(--accent); border-radius: 50%; z-index: 1; }
.note-card .color-bar { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; }
.thumb-badges { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; background: rgba(28, 34, 48, .82); color: #fff; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.badge .ic { width: 13px; height: 13px; }
.badge.is-summary { background: var(--accent); color: var(--on-accent); }
.card-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 2px; }
.card-title { font-weight: 600; font-size: var(--fs-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { color: var(--muted); font-size: var(--fs-0); display: flex; gap: 6px; align-items: center; min-width: 0; }
.card-sub span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-more { position: absolute; z-index: 2; right: -6px; top: -6px; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); opacity: 0; transition: opacity .12s; }
.note-card:hover .card-more, .note-card:focus-within .card-more, .is-touch .card-more { opacity: 1; }
.note-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.note-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: left; position: relative; }
.note-row:hover { background: var(--surface); }
.note-row .thumb { width: 36px; aspect-ratio: 800 / 1131; border-radius: 2px; }
.note-row .card-more { position: static; opacity: 1; box-shadow: none; background: transparent; }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-main .card-title { -webkit-line-clamp: 1; }
.empty { padding: 64px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty strong { color: var(--fg); font-size: var(--fs-3); }
mark.hit { background: #ffe26a; color: #1c2230; padding: 0 1px; border-radius: 2px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-0); color: var(--muted); }
.tag::before { content: "#"; opacity: .6; }

/* 세로/폰: 사이드바 서랍 */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(12, 14, 18, .4); z-index: 60; }
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 61; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-2); }
  .sidebar.is-open { transform: none; }
  .lib-top .btn-new span { display: none; }
  .lib-top .btn-new { padding: 0 12px; }
}
@media (min-width: 901px) {
  .drawer-backdrop, #btn-drawer { display: none !important; }
  .sidebar.is-collapsed { width: 0; padding-left: 0; padding-right: 0; overflow: hidden; border: 0; }
}

/* ---------- 편집기 ---------- */
#editor { background: var(--bg); }
.ed-top {
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) max(8px, var(--safe-r)) 0 max(8px, var(--safe-l)); display: flex; align-items: center; gap: 4px;
  background: var(--surface); border-bottom: 1px solid var(--line); flex: none;
}
.ed-title-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 4px; }
.ed-title {
  font-weight: 700; font-size: var(--fs-3); letter-spacing: -.01em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; padding: 2px 4px; margin: 0 -4px;
  min-height: 28px; outline-offset: 0;
}
.ed-title:focus { white-space: normal; background: var(--surface-2); text-overflow: clip; }
.ed-sub { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: var(--fs-0); min-width: 0; }
.ed-sub .chip { height: 22px; padding: 0 8px; font-size: 11px; }
.ed-sub .ed-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.ed-saved { color: var(--muted); font-size: 11px; white-space: nowrap; }
.ed-saved.is-saving { color: var(--warn); }
.ed-tabs { display: flex; gap: 2px; background: var(--bg); padding: 3px; border-radius: 999px; }
.ed-tab { min-height: 36px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: var(--fs-1); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.ed-tab.is-on { background: var(--surface-2); color: var(--fg); box-shadow: var(--shadow-1); }
.ed-tab .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.ed-body { flex: 1; min-height: 0; display: flex; position: relative; }
.ed-pane { position: absolute; inset: 0; display: flex; }

/* 도구 레일 */
.rail {
  width: var(--rail-w); flex: none; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 0 calc(8px + var(--safe-b)) var(--safe-l); overflow: auto; z-index: 5;
}
.rail .ibtn { width: 48px; height: 48px; border-radius: 12px; position: relative; }
.rail .ibtn .ic { width: 24px; height: 24px; }
.rail .ibtn.is-on { background: var(--fg); color: var(--bg); }
.rail .ibtn.is-on .pen-dot { background: var(--bg); }
.rail .sep { width: 28px; height: 1px; background: var(--line); margin: 6px 0; flex: none; }
.pen-dot { position: absolute; right: 8px; bottom: 8px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--surface); }
.rail .grow { flex: 1; }
.rail .ibtn.is-rec { color: var(--rec); }
.rail .ibtn.is-rec.is-on { background: var(--rec); color: #fff; }

/* 캔버스 영역 */
.canvas-wrap { flex: 1; min-width: 0; position: relative; display: flex; flex-direction: column; }
.canvas-area { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.viewport { flex: 1; position: relative; overflow: hidden; touch-action: none; background: var(--bg); cursor: crosshair; user-select: none; -webkit-user-select: none; }
.viewport.tool-text { cursor: text; }
.viewport.tool-lasso, .viewport.tool-playback { cursor: default; }
.viewport.tool-eraser { cursor: cell; }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 800px; will-change: transform; }
.page { position: absolute; left: 0; color-scheme: light; background: var(--paper); box-shadow: var(--shadow-paper); border-radius: 2px; overflow: visible; }
.page canvas.ink { position: absolute; left: 0; top: 0; display: block; }
.page .texts { position: absolute; inset: 0; pointer-events: none; }
.page .page-num { position: absolute; right: 14px; bottom: 10px; font-size: 12px; color: var(--paper-label); font-variant-numeric: tabular-nums; pointer-events: none; }
.live-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.sel-box { position: absolute; border: 1.5px dashed var(--select); border-radius: 3px; pointer-events: none; }
.sel-handle { position: absolute; right: -9px; bottom: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--select); border: 2px solid #fff; }

/* 텍스트 상자 */
.tbox { position: absolute; min-width: 120px; pointer-events: auto; color: var(--paper-ink); font-size: 20px; line-height: 1.45; }
[data-format="pc"] .tbox { font-size: 17px; }
[data-format="mobile"] .tbox { font-size: 15px; }
.tbox .tbox-body { padding: 6px 8px; border: 1.5px dashed transparent; border-radius: 4px; min-height: 36px; outline: none; word-break: break-word; }
.tbox .tbox-body:focus, .tbox.is-focus .tbox-body { border-color: rgba(52, 88, 163, .55); background: rgba(255, 255, 255, .35); }
.tbox-body h3 { margin: 0 0 .25em; font-size: 1.32em; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.tbox-body h4 { margin: .85em 0 .3em; padding-bottom: .2em; font-size: .78em; font-weight: 700; letter-spacing: .01em; color: #3458a3; border-bottom: 1.5px solid rgba(52, 88, 163, .28); }
.tbox-body h3 + h4, .tbox-body > h4:first-child { margin-top: .3em; }
.tbox-body p { margin: 0 0 .2em; }
.tbox-body p.meta { color: #6c7380; font-size: .8em; font-variant-numeric: tabular-nums; }
.tbox-body ul, .tbox-body ol { margin: 0 0 .2em; padding-left: 1.25em; }
.tbox-body li { min-height: 1.45em; }
.tbox-body ul.checklist { list-style: none; padding-left: 0; }
.tbox-body ul.checklist ul.checklist { padding-left: 1.3em; }
.tbox-body ul.checklist li { display: block; padding-left: 1.45em; text-indent: -1.45em; }
.tbox-body ul.checklist li > * { text-indent: 0; }
.tbox-body input[type=checkbox] { width: 1em; height: 1em; margin: 0 .45em 0 0; vertical-align: -.12em; accent-color: #3458a3; cursor: pointer; pointer-events: auto; }
.tbox-body td > input[type=checkbox] { margin: 0; }
.tbox-body ul.checklist li:has(> input:checked) { color: #8a909a; text-decoration: line-through; text-decoration-color: rgba(28, 34, 48, .45); }
.tbox-body .who { color: #6c7380; font-size: .85em; }
.tbox-body mark { background: #fff36b; color: #1c2230; padding: 0 2px; border-radius: 2px; }
.tbox-body b, .tbox-body strong { font-weight: 700; }
.tbox-body hr { border: 0; border-top: 1.5px solid #c9cedb; margin: .6em 0; }
.tbox-body table.tt { width: 100%; border-collapse: collapse; margin: .15em 0 .3em; font-size: .86em; table-layout: fixed; }
.tbox-body table.tt th, .tbox-body table.tt td { border: 1px solid #c9cedb; padding: .3em .45em; vertical-align: top; text-align: left; word-break: break-word; min-width: 2em; }
.tbox-body table.tt th { background: rgba(52, 88, 163, .08); font-weight: 600; color: #2b3550; }
.tbox-body table.tt td:has(> input[type=checkbox]:only-child) { text-align: center; width: 3.2em; }
.tbox-body table.tt th:last-child:is(:nth-child(3), :nth-child(4)) { width: auto; }
.tbox-body table.kv th { width: 30%; font-size: .95em; }
.tbox-body table.cal { table-layout: fixed; }
.tbox-body table.cal th { text-align: center; font-size: .9em; }
.tbox-body table.cal th:first-child, .tbox-body table.cal td:first-child .dn { color: #c43a2b; }
.tbox-body table.cal th:last-child, .tbox-body table.cal td:last-child .dn { color: #3458a3; }
.tbox-body table.cal td { height: 4.2em; font-size: .9em; }
[data-format="mobile"] .tbox-body table.cal td { height: 3.4em; }
.tbox-body table.cal .today { display: inline-flex; align-items: center; justify-content: center; min-width: 1.6em; height: 1.6em; border-radius: 50%; background: #3458a3; color: #fff !important; }
.tbox-body .write-area { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(1.6em - 1px), #d6dae8 calc(1.6em - 1px), #d6dae8 1.6em); line-height: 1.6em; margin: .1em 0 .3em; }
.tbox-body:empty::before { content: "입력하세요"; color: var(--paper-label); }
.tbox-grip { position: absolute; left: -26px; top: 2px; width: 24px; height: 30px; display: none; align-items: center; justify-content: center; color: var(--select); cursor: move; touch-action: none; border-radius: 4px; background: rgba(255, 255, 255, .7); }
.tbox-del { position: absolute; right: -14px; top: -14px; width: 28px; height: 28px; display: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--select); color: #fff; }
.tbox-del .ic { width: 16px; height: 16px; }
.tbox.is-focus .tbox-grip, .tbox.is-focus .tbox-del { display: flex; }
.tbox-resize { position: absolute; right: -8px; bottom: 0; width: 14px; height: 100%; cursor: ew-resize; touch-action: none; display: none; }
.tbox.is-focus .tbox-resize { display: block; }
.viewport.tool-text .page .texts { pointer-events: none; }
.viewport.tool-text .tbox { pointer-events: auto; }
.viewport:not(.tool-text):not(.tool-playback) .tbox { pointer-events: none; }
.viewport.tool-playback .tbox { pointer-events: auto; cursor: pointer; }
.viewport.tool-playback .tbox .tbox-body { pointer-events: none; }
.tbox.is-future { opacity: .3; }
.tbox.is-current .tbox-body { background: rgba(52, 88, 163, .14); border-color: transparent; }

/* 떠 있는 하위 도구 (색/굵기, 텍스트 서식) */
.subbar {
  position: absolute; left: 12px; top: 10px; z-index: 6; display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: 12px;
  background: var(--surface); box-shadow: var(--shadow-2); border: 1px solid var(--line); flex-wrap: wrap; max-width: calc(100% - 24px);
}
.subbar .color { width: 36px; height: 36px; border-radius: 50%; border: 3px solid transparent; display: inline-flex; align-items: center; justify-content: center; }
.subbar .color span { width: 24px; height: 24px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .14), 0 0 0 1px rgba(255, 255, 255, .08); }
.subbar .color.is-hl span { width: 26px; height: 16px; border-radius: 5px; transform: rotate(-12deg); }
.subbar .color-custom { position: relative; cursor: pointer; }
.subbar .color-custom span { background: conic-gradient(#ff5757, #ffd84a, #57f287, #3fd0ff, #8a7bff, #ff6fb5, #ff5757); }
.subbar .color-custom input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.subbar .color.is-on { border-color: var(--accent); background: var(--accent-soft); }
.subbar .width { width: 40px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; }
.subbar .width.is-on { background: var(--accent-soft); }
.subbar .width i { display: block; background: var(--fg); border-radius: 999px; width: 18px; }
.subbar .vsep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.subbar .ibtn { width: 40px; height: 36px; }
.subbar .ibtn .ic { width: 20px; height: 20px; }

.subbar .seg { display: flex; background: var(--bg); border-radius: 8px; padding: 2px; }
.subbar .seg button { min-height: 32px; padding: 0 10px; border-radius: 6px; font-size: var(--fs-1); font-weight: 500; color: var(--muted); }
.subbar .seg button.is-on { background: var(--surface-2); color: var(--fg); box-shadow: var(--shadow-1); }

/* 페이지 내비 */
.page-nav { position: absolute; right: 12px; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow-2); border: 1px solid var(--line); }
.page-nav .ibtn { width: 40px; height: 40px; border-radius: 50%; }
.page-nav .ibtn .ic { width: 20px; height: 20px; }
.page-nav .pn-label { padding: 0 8px; font-size: var(--fs-1); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.zoom-label { position: absolute; left: 12px; bottom: 12px; z-index: 6; font-size: 11px; color: var(--muted); background: var(--surface); padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line); font-variant-numeric: tabular-nums; }

/* 녹음 데크 */
.deck {
  flex: none; background: var(--surface); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
  padding: 8px max(12px, var(--safe-r)) calc(8px + var(--safe-b)) 12px; min-height: var(--deck-h); position: relative;
}
.deck.is-recording { background: linear-gradient(90deg, var(--rec-soft), var(--surface) 60%); }
.deck-transport { display: flex; align-items: center; gap: 6px; }
.deck-btn { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-strong); background: var(--surface-2); color: var(--fg); }
.deck-btn .ic { width: 24px; height: 24px; }
.deck-btn:disabled { opacity: .35; }
.deck-btn.rec { border-color: var(--rec); color: var(--rec); width: 56px; height: 56px; }
.deck-btn.rec .ic { width: 28px; height: 28px; }
.deck.is-recording .deck-btn.rec { background: var(--rec); color: #fff; animation: recpulse 1.6s ease-in-out infinite; }
.deck.is-paused .deck-btn.rec { background: var(--rec); color: #fff; animation: none; opacity: .75; }
@keyframes recpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(216, 50, 31, .45); } 50% { box-shadow: 0 0 0 10px rgba(216, 50, 31, 0); } }
.deck-btn.stop { border-color: var(--fg); }
.deck-btn.sum { border-color: var(--accent); color: var(--accent); }
.deck-btn.sum.is-busy { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.deck-status { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.deck-time { font-size: var(--fs-4); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: .01em; line-height: 1.1; }
.deck.is-recording .deck-time { color: var(--rec); }
.deck-label { font-size: var(--fs-0); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deck-label.is-rec { color: var(--rec); font-weight: 600; }
.deck-label.is-rec::before { content: "●"; margin-right: 4px; animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.deck-wave { flex: 1; height: 44px; min-width: 60px; }
.deck-wave canvas { width: 100%; height: 100%; display: block; }
.deck-recs { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.deck-recs .btn-sm { gap: 6px; }
.deck-caption { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 8px); background: rgba(28, 34, 48, .85); color: #fff; padding: 8px 12px; border-radius: 8px; font-size: var(--fs-1); max-height: 84px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; backdrop-filter: blur(4px); }
.deck-caption .interim { opacity: .6; }

/* 녹음 목록 패널 (데크 위 팝오버) */
.rec-panel { position: absolute; left: 12px; bottom: 12px; z-index: 7; width: min(440px, calc(100% - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-2); padding: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 60%; overflow: auto; }
.rec-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: var(--radius-s); }
.rec-item.is-active { background: var(--accent-soft); }
.rec-item .ibtn { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.rec-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rec-name { font-weight: 600; font-size: var(--fs-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-meta { font-size: var(--fs-0); color: var(--muted); font-variant-numeric: tabular-nums; }
.rec-seek { width: 100%; accent-color: var(--accent); height: 28px; margin: 0; }
.rec-actions { display: flex; gap: 2px; }
.rec-actions .ibtn { width: 36px; height: 36px; border: 0; }
.rec-actions .ibtn .ic { width: 18px; height: 18px; }
.player-bar { display: flex; align-items: center; gap: 8px; }

/* 받아쓰기 / 요약 패널 */
.doc-pane { flex: 1; min-width: 0; overflow: auto; padding: 20px max(16px, var(--safe-r)) calc(40px + var(--safe-b)) max(16px, var(--safe-l)); }
.doc { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.doc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.doc-head h2 { margin: 0; font-size: var(--fs-4); font-weight: 800; letter-spacing: -.02em; }
.doc-head .meta { color: var(--muted); font-size: var(--fs-0); }
.doc-head .spacer { flex: 1; }
.sum-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; }
.sum-card h3 { margin: 0; font-size: var(--fs-1); font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sum-card h3 .ic { width: 16px; height: 16px; }
.sum-card.is-headline { border-color: transparent; background: var(--accent-soft); }
.sum-card.is-headline ol { margin: 0; padding-left: 22px; font-size: var(--fs-3); font-weight: 600; line-height: 1.5; display: flex; flex-direction: column; gap: 6px; }
.sum-card ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.sum-topic { display: flex; flex-direction: column; gap: 4px; padding: 6px 0; border-top: 1px solid var(--line); }
.sum-topic:first-of-type { border-top: 0; }
.sum-topic strong { font-size: var(--fs-2); }
.todo { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.todo input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.todo .todo-text { flex: 1; min-width: 0; }
.todo.is-done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo .todo-meta { font-size: var(--fs-0); color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.kw-row { display: flex; flex-wrap: wrap; gap: 6px; }
.kw { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-1); }
.kw .ic { width: 15px; height: 15px; color: var(--muted); }
.kw.is-tagged { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.sum-edit [contenteditable] { outline: 1px dashed var(--line-strong); outline-offset: 2px; border-radius: 3px; }
.progress { display: flex; flex-direction: column; gap: 10px; padding: 24px; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); }
.progress-steps { display: flex; gap: 8px; flex-wrap: wrap; }
.pstep { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: var(--fs-1); font-weight: 500; }
.pstep.is-on { background: var(--accent-soft); color: var(--accent); }
.pstep.is-done { color: var(--ok); }
.pstep .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .9s linear infinite; }
.tr-list { display: flex; flex-direction: column; }
.tr-line { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 8px 6px; border-radius: 8px; text-align: left; align-items: start; }
.tr-line:hover { background: var(--surface); }
.tr-line.is-current { background: var(--accent-soft); }
.tr-line .ts { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 600; font-size: var(--fs-1); padding-top: 2px; }
.tr-line .spk { font-weight: 700; margin-right: 6px; }
.tr-line .txt { line-height: 1.55; }
.tr-line mark.hit { background: #ffe26a; }
.note-box { padding: 14px 16px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--line-strong); color: var(--muted); font-size: var(--fs-1); line-height: 1.5; }
.err-box { padding: 14px 16px; border-radius: 10px; background: var(--rec-soft); color: var(--fg); border: 1px solid var(--rec); display: flex; flex-direction: column; gap: 8px; }
.pill-ex { background: var(--warn); color: #fff; }

/* 설정 */
.settings { display: flex; flex-direction: column; gap: 18px; }
.set-group { display: flex; flex-direction: column; gap: 10px; }
.set-group h3 { margin: 0; font-size: var(--fs-1); color: var(--muted); font-weight: 700; }
.set-row { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.set-row .set-label { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-row .set-hint { color: var(--muted); font-size: var(--fs-0); }
.set-row .input, .set-row .select { max-width: 320px; }
.key-row { display: flex; gap: 8px; align-items: center; }
.key-row .input { flex: 1; }
.set-status { font-size: var(--fs-0); color: var(--muted); }
.set-status.is-ok { color: var(--ok); }
.set-status.is-err { color: var(--rec); }

/* ---------- 세로 / 작은 화면 ---------- */
@media (max-width: 760px), (orientation: portrait) and (max-width: 1000px) {
  .ed-tabs .ed-tab { padding: 0 10px; }
  .ed-pane.is-note { flex-direction: column; }
  .rail { width: auto; height: 60px; flex-direction: row; order: 2; border-right: 0; border-top: 1px solid var(--line); padding: 6px max(8px, var(--safe-r)) 6px max(8px, var(--safe-l)); justify-content: flex-start; overflow-x: auto; overflow-y: hidden; }
  .rail .sep { width: 1px; height: 28px; margin: 0 4px; }
  .rail .grow { display: none; }
  .canvas-wrap { order: 1; }
  .deck { order: 3; padding-bottom: calc(8px + var(--safe-b)); }
  .rail { padding-bottom: 6px; }
  .ed-title-wrap .ed-sub .ed-date { display: none; }
}
@media (max-width: 560px) {
  :root { --fs-2: 14px; --fs-3: 16px; }
  .ed-tabs .ed-tab { padding: 0 8px; font-size: 12px; }
  .ed-tabs .ed-tab .tab-text { display: none; }
  .ed-tabs .ed-tab .ic { width: 18px; height: 18px; }
  .deck { flex-wrap: wrap; }
  .deck-wave { order: 5; flex-basis: 100%; height: 28px; }
  .deck-recs .btn-sm span { display: none; }
  .lib-title { font-size: 22px; }
  .note-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 12px; }
  .subbar { left: 6px; right: 6px; top: 6px; max-width: none; }
  .page-nav .pn-label { display: none; }
  .deck-btn { width: 44px; height: 44px; }
  .deck-btn.rec { width: 50px; height: 50px; }
  .ed-top .ibtn[aria-label="실행 취소"], .ed-top .ibtn[aria-label="다시 실행"] { display: none; }
  .ed-title-wrap { min-width: 90px; }
}

/* 글자색 작은 버튼 */
.subbar .color.color-sm { width: 30px; height: 36px; }
.subbar .color.color-sm span { width: 18px; height: 18px; }
.sum-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* ---------- 템플릿 갤러리 ---------- */
.gallery { position: fixed; inset: 0; z-index: 85; background: var(--bg); display: flex; flex-direction: column; }
.g-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: calc(10px + var(--safe-t)) max(16px, var(--safe-r)) 10px max(16px, var(--safe-l));
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.g-title { margin: 0; font-size: var(--fs-4); font-weight: 800; letter-spacing: -.02em; margin-right: auto; }
.g-seg { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--bg); }
.g-seg-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: var(--fs-1); color: var(--muted); }
.g-seg-btn.is-on { background: var(--surface-2); color: var(--fg); box-shadow: var(--shadow-1); }
.g-seg-btn:disabled { opacity: .35; }
.g-fmt-ic { display: inline-block; border: 1.75px solid currentColor; border-radius: 2px; flex: none; }
.g-fmt-ic.fmt-tab { width: 13px; height: 17px; }
.g-fmt-ic.fmt-pc { width: 20px; height: 13px; }
.g-fmt-ic.fmt-mobile { width: 9px; height: 17px; border-radius: 3px; }
.g-body { flex: 1; overflow: auto; padding: 14px max(16px, var(--safe-r)) calc(40px + var(--safe-b)) max(16px, var(--safe-l)); display: flex; flex-direction: column; gap: 16px; }
.g-cats { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.g-cats .chip { height: 36px; padding: 0 14px; }
.g-grid { display: flex; flex-wrap: wrap; gap: 26px 22px; align-items: flex-start; }
.g-card { display: flex; flex-direction: column; gap: 6px; text-align: left; border-radius: 6px; padding: 0; max-width: 100%; }
.g-card:hover .gthumb { box-shadow: 0 0 0 2px var(--accent), var(--shadow-paper); }
.g-card:focus-visible { outline-offset: 4px; }
.gthumb { position: relative; overflow: hidden; border-radius: 3px; background: var(--paper); box-shadow: var(--shadow-paper); border: 1px solid rgba(0, 0, 0, .06); transition: box-shadow .12s; max-width: 100%; }
.gpage { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; }
.gpage canvas { position: absolute; left: 0; top: 0; }
.g-name { font-weight: 700; font-size: var(--fs-2); line-height: 1.3; padding: 2px 2px 0; }
.g-desc { color: var(--muted); font-size: var(--fs-0); line-height: 1.4; padding: 0 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 560px) {
  .g-head { gap: 8px; }
  .g-seg { width: 100%; order: 3; }
  .g-seg-btn { flex: 1; justify-content: center; padding: 0 8px; }
  .g-grid { gap: 20px 14px; justify-content: space-between; }
}

/* 요약: 공시 확인 표시, 할 일 캘린더 버튼 */
.sum-card.is-flag { border-color: color-mix(in srgb, var(--warn) 55%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); }
.sum-card.is-flag h3 { color: var(--warn); }
.flag-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.flag-row:first-of-type { border-top: 0; }
.flag-item { font-weight: 700; flex: 1 1 60%; min-width: 0; }
.flag-reason { color: var(--muted); font-size: var(--fs-1); flex-basis: 100%; order: 3; }
.flag-chip { background: var(--warn); color: #fff; border-color: transparent; height: 26px; }
.todo-cal { width: 40px; height: 40px; color: var(--muted); flex: none; margin-top: -6px; }
.todo-cal:hover { color: var(--accent); }
/* 사이드바 동기화 상태 */
.sync-chip { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px; border-radius: var(--radius-s); font-size: var(--fs-0); color: var(--muted); text-align: left; width: 100%; }
.sync-chip:hover { background: var(--surface-2); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: none; }
.sync-chip[data-state="ok"] .sync-dot, .sync-chip[data-state="idle"] .sync-dot { background: var(--ok); }
.sync-chip[data-state="syncing"] .sync-dot { background: var(--accent); animation: blink 1s steps(1) infinite; }
.sync-chip[data-state="error"] .sync-dot, .sync-chip[data-state="auth"] .sync-dot { background: var(--rec); }
.sync-chip[data-state="error"], .sync-chip[data-state="auth"] { color: var(--rec); }
.sync-chip[data-state="offline"] .sync-dot { background: var(--warn); }

/* ---------- 오늘 패널 ---------- */
.today { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; margin-bottom: 22px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.today-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.today-date { font-size: var(--fs-4); font-weight: 800; letter-spacing: -.02em; }
.today-sub { color: var(--muted); font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.today-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.tact { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); text-align: left; }
.tact:hover { border-color: var(--line-strong); }
.tact .ic { width: 24px; height: 24px; color: var(--accent); flex: none; }
.tact span { display: flex; flex-direction: column; min-width: 0; }
.tact b { font-weight: 700; font-size: var(--fs-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tact small { color: var(--muted); font-size: var(--fs-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tact-meet .ic { color: var(--rec); }
.tact.is-now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: var(--accent-soft); }
.tact-meet.is-now { border-color: var(--rec); box-shadow: 0 0 0 1px var(--rec) inset; background: var(--rec-soft); }
.today-todos { display: flex; flex-direction: column; }
.today-todos > .btn { align-self: flex-start; margin-top: 4px; }
/* 할 일 줄 */
.todo-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; border-top: 1px solid var(--line); }
.todo-row:first-child { border-top: 0; }
.todo-row input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.todo-text { font-weight: 500; line-height: 1.4; }
.todo-row.is-done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: var(--fs-0); }
.todo-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.due-badge { font-weight: 600; font-variant-numeric: tabular-nums; }
.due-badge.is-over { color: var(--rec); }
.due-badge.is-today { color: var(--warn); }
.due-badge.is-soon { color: var(--accent); }
.todo-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 16px; }
.group-title { margin: 14px 2px 8px; font-size: var(--fs-1); font-weight: 700; color: var(--muted); }
.group-title.is-over { color: var(--rec); }
.view-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.view-bar .spacer { flex: 1; }
.seg-inline { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg-inline button { min-height: 34px; padding: 0 12px; border-radius: 7px; font-size: var(--fs-1); font-weight: 600; color: var(--muted); }
.seg-inline button.is-on { background: var(--surface-2); color: var(--fg); box-shadow: var(--shadow-1); }
/* 구글 문서함 */
.doc-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.doc-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.doc-acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.lk-type { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; color: #fff; background: #5c6370; flex: none; }
.t-doc .lk-type, .lk-type.t-doc { background: #3c6fd8; }
.t-sheet .lk-type, .lk-type.t-sheet { background: #1f8a4c; }
.t-slide .lk-type, .lk-type.t-slide { background: #d08a12; }
/* 편집기: 구글 파일 줄 */
.link-bar { display: flex; gap: 6px; align-items: center; padding: 6px max(10px, var(--safe-r)) 6px max(10px, var(--safe-l)); background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; flex: none; }
.link-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px 0 4px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-2); flex: none; max-width: 260px; }
.link-chip .lk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-1); font-weight: 500; }
.link-add { width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); flex: none; }
.link-add .ic { width: 18px; height: 18px; }
.preview-dlg { width: min(100%, 1000px); height: min(88vh, 900px); }
.preview-frame { flex: 1; width: 100%; min-height: 300px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.tbox-body img { max-width: 100%; height: auto; border-radius: 4px; display: block; }
@media (max-width: 560px) {
  .today { padding: 14px; }
  .today-actions { grid-template-columns: 1fr 1fr; }
  .tact { min-height: 56px; padding: 8px 10px; gap: 8px; }
  .tact small { display: none; }
  .doc-row { grid-template-columns: auto 1fr; }
  .doc-acts { grid-column: 1 / -1; justify-content: flex-start; }
}

/* 새 버전 알림 */
.update-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; border-radius: 12px; background: var(--fg); color: var(--bg); box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); font-size: 14px; max-width: calc(100vw - 32px); }

.g-fmt-hint { margin: 0; width: 100%; order: 4; text-align: right; font-size: var(--fs-0, 12.5px); color: var(--muted); }
@media (max-width: 720px) { .g-fmt-hint { text-align: center; } }

/* 캘린더 일정 넣기 */
.g-cal { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: var(--fs-1); font-weight: 600; order: 5; }
.g-cal .ic { width: 16px; height: 16px; }
.g-cal.is-on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.g-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; vertical-align: 2px; }
.g-badge .ic { width: 11px; height: 11px; }
.tbox-body .cal-src { font-size: .72em; font-weight: 500; color: var(--paper-label); margin-left: 6px; }
.tbox-body .cal-tag { margin: .5em 0 .1em; font-size: .86em; color: var(--paper-label); }
.tbox-body .cal-tag b { color: var(--accent); }
.tbox-body .cal-ev { display: block; font-size: .62em; line-height: 1.25; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 노트 옆 캘린더 일정 패널 */
.ed-cal-btn.is-on { background: var(--accent-soft); color: var(--accent); }
.cal-panel { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; padding: 12px 12px calc(12px + var(--safe-b)) 14px; gap: 10px; z-index: 8; }
.cal-panel[hidden] { display: none; }
.cal-head { display: flex; align-items: center; gap: 8px; }
.cal-head strong { font-size: var(--fs-2); }
.cal-seg { display: flex; }
.cal-seg button { flex: 1; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-list { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 4px; margin: 0 -4px; padding: 0 4px 8px; }
.cal-all { align-self: stretch; justify-content: center; margin-bottom: 6px; }
.cal-group { display: flex; align-items: baseline; gap: 6px; margin: 10px 2px 2px; }
.cal-gtag { font-weight: 700; color: var(--accent); font-size: var(--fs-1); }
.cal-gcount { color: var(--muted); font-size: var(--fs-0); }
.cal-row { display: flex; align-items: center; gap: 6px; padding: 6px 4px 6px 10px; border-radius: 10px; background: var(--bg); }
.cal-row.is-added { opacity: .62; }
.cal-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cal-when { font-size: var(--fs-0); color: var(--muted); }
.cal-title { font-size: var(--fs-1); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.cal-title::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ev, var(--accent)); margin-right: 6px; vertical-align: 1px; }
.cal-loc { font-size: var(--fs-0); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-add { flex: none; width: 36px; height: 36px; color: var(--accent); }
.cal-row.is-added .cal-add { color: var(--ok); }
@media (max-width: 860px) {
  .cal-panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: min(58%, 520px); border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: var(--shadow-2); z-index: 20; }
}

.cal-group { align-items: center; padding-right: 2px; }
.cal-group.is-today .cal-gtag { color: var(--rec); }
.cal-today, .tbox-body .cal-today { display: inline-block; padding: 0 6px; border-radius: 999px; background: var(--rec-soft); color: var(--rec); font-size: 11px; font-weight: 700; line-height: 1.6; }
.cal-day-add { width: 32px; height: 32px; color: var(--accent); }
.cal-chip { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; line-height: 1.6; }
.tbox-body table.week-plan td { vertical-align: top; }
.tbox-body table.week-plan ul.checklist { margin: 0; }
.cal-group .spacer { flex: 1; }

/* 일정 고르기 창 */
.evpick { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.evpick-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.evpick-bar .spacer { flex: 1; }
.evpick-count { font-size: var(--fs-1); color: var(--muted); font-variant-numeric: tabular-nums; }
.evpick-list { max-height: min(52vh, 460px); overflow: auto; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 12px; padding: 6px; }
.evpick-day { display: flex; align-items: center; gap: 8px; padding: 8px 8px 4px; font-size: var(--fs-1); cursor: pointer; }
.evpick-day.is-today b { color: var(--rec); }
.evpick-n { color: var(--muted); font-size: var(--fs-0); }
.evpick-row { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px 4px 22px; border-radius: 8px; cursor: pointer; }
.evpick-row:hover { background: var(--bg); }
.evpick input[type=checkbox] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.evpick-time { font-size: var(--fs-0); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 3.2em; }
.evpick-row .cal-chip { margin-left: 0; }
.evpick-title { font-size: var(--fs-1); min-width: 0; overflow-wrap: anywhere; }

/* AI펜 일정 카드 */
.viewport.tool-ai { cursor: crosshair; }
.dlg.dlg-wide { width: min(100%, 560px); }
.ai-crop { width: 100%; max-height: 32vh; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.ai-read { font-size: 14px; }
.ev-list { display: flex; flex-direction: column; gap: 12px; }
.ev-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ev-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ev-line .input { flex: 1 1 140px; min-width: 0; width: auto; }
.ev-line .select { flex: 0 0 auto; width: auto; min-width: 96px; }
.ev-line input[type=date], .ev-line input[type=time] { flex: 0 0 auto; width: auto; }
.ev-use { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 14px; }
.ev-use input { width: 20px; height: 20px; }
.ev-warn { margin: 0; color: #b4541a; font-size: 13px; }
.link-chip.t-event .lk-type { background: #e7efdf; color: #2f6b2a; }
@media (max-width: 640px) { .dlg.dlg-wide { width: 100%; padding: 16px 14px 14px; } .ev-line input[type=text] { flex-basis: 100%; } }
/* 도구 막대 닫기 버튼: 항상 오른쪽 끝 */
.subbar .sub-close { margin-left: auto; flex: none; width: 40px; height: 40px; color: var(--muted); }
.subbar .sub-close:hover { color: var(--ink, inherit); background: var(--surface-2, rgba(0,0,0,.05)); }
/* 팬·확대 중에는 글상자 반응을 잠시 끔(끌 때 걸림 방지) */
.viewport.is-gesturing .texts { pointer-events: none; }


/* AI펜: 제미나이에게 물어보기 (오른쪽 대화창 — 모바일은 아래 시트, .cal-panel 레이아웃 재사용) */
.ask-panel { width: 360px; }
.ask-panel .cal-head strong { display: inline-flex; align-items: center; gap: 6px; }
.ask-panel .cal-head strong svg { width: 18px; height: 18px; color: var(--accent); }
.ask-body { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 2px; }
.ask-img { width: 100%; max-height: 180px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.ask-read { display: flex; gap: 8px; align-items: baseline; font-size: 14px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2, rgba(0,0,0,.04)); white-space: pre-wrap; }
.ask-label { flex: none; font-size: 12px; color: var(--muted); }
.ask-msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.55; overflow-wrap: anywhere; }
.ask-msg p { margin: 0 0 4px; } .ask-msg p:last-child { margin-bottom: 0; } .ask-msg ul { margin: 2px 0 4px; padding-left: 18px; }
.ask-msg.is-user { align-self: flex-end; background: var(--accent); color: var(--on-accent, #fff); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.ask-msg.is-model { align-self: flex-start; background: var(--surface-2, rgba(0,0,0,.05)); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ask-msg.is-loading, .ask-read.is-loading { color: var(--muted); }
.ask-acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.ask-err { display: flex; gap: 8px; align-items: center; color: #b4541a; font-size: 13px; flex-wrap: wrap; }
.ask-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ask-chips .chip { min-height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.ask-compose { display: flex; gap: 8px; align-items: flex-end; }
.ask-compose .ask-input { flex: 1; min-height: 44px; max-height: 120px; resize: none; }
.ask-compose .btn { flex: none; min-height: 44px; }
.subbar .ask-btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) { .ask-panel { height: min(70%, 600px); } }
.today-head .today-fold { margin-left: auto; min-height: 32px; }

/* =====================================================================
   노션 스타일 스킨 (2026-11-05)
   - 바탕: 본문 흰색, 사이드바·작업대는 따뜻한 회백색(#F7F7F5), 글자 #37352F
   - 테두리 대신 아주 옅은 선(9%)과 회색 호버 바탕, 둥근 모서리 6px
   - 강조는 노션 파랑(#2383E2) 한 가지, 태그는 노션 태그 팔레트(옅은 바탕+진한 글자)
   - 페이지 제목은 크고 굵게 + 앞에 이모지 아이콘
   - 터치 기기는 누르기 쉽게 높이를 키움(@media (pointer: coarse))
   ===================================================================== */
:root {
  --bg: #ffffff; --surface: #f7f7f5; --surface-2: #ffffff;
  --fg: #37352f; --muted: #787774; --faint: #9b9a97;
  --line: rgba(55, 53, 47, .09); --line-strong: rgba(55, 53, 47, .16);
  --hover: rgba(55, 53, 47, .06); --press: rgba(55, 53, 47, .1);
  --accent: #2383e2; --accent-soft: rgba(35, 131, 226, .1); --on-accent: #ffffff;
  --rec: #e03e3e; --rec-soft: #fbe4e4; --ok: #448361; --warn: #d9730d;
  --work: #f7f7f5; --callout: #f7f6f3;
  --shadow-1: 0 0 0 1px rgba(15, 15, 15, .05), 0 1px 2px rgba(15, 15, 15, .08);
  --shadow-2: 0 0 0 1px rgba(15, 15, 15, .05), 0 3px 6px rgba(15, 15, 15, .1), 0 9px 24px rgba(15, 15, 15, .2);
  --shadow-card: 0 0 0 1px rgba(15, 15, 15, .07), 0 2px 4px rgba(15, 15, 15, .06);
  --shadow-card-hover: 0 0 0 1px rgba(15, 15, 15, .1), 0 4px 12px rgba(15, 15, 15, .1);
  --shadow-paper: 0 0 0 1px rgba(15, 15, 15, .06), 0 2px 8px rgba(15, 15, 15, .06);
  --radius: 8px; --radius-s: 6px;
  --fs-0: 12px; --fs-1: 13.5px; --fs-2: 15px; --fs-3: 16px; --fs-4: 19px; --fs-5: 34px;
  --t-gray-bg: #e9e9e7; --t-gray: #32302c; --t-brown-bg: #eee0da; --t-brown: #442a1e; --t-orange-bg: #fadec9; --t-orange: #49290e;
  --t-yellow-bg: #fdecc8; --t-yellow: #402c1b; --t-green-bg: #dbeddb; --t-green: #1c3829; --t-blue-bg: #d3e5ef; --t-blue: #183347;
  --t-purple-bg: #e8deee; --t-purple: #412454; --t-pink-bg: #f5e0e9; --t-pink: #4c2337; --t-red-bg: #ffe2dd; --t-red: #5d1715;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --surface: #202020; --surface-2: #252525;
    --fg: rgba(255, 255, 255, .86); --muted: rgba(255, 255, 255, .5); --faint: rgba(255, 255, 255, .34);
    --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .14);
    --hover: rgba(255, 255, 255, .055); --press: rgba(255, 255, 255, .09);
    --accent: #529cca; --accent-soft: rgba(82, 156, 202, .16); --on-accent: #ffffff;
    --rec: #ff6b5f; --rec-soft: rgba(255, 107, 95, .16);
    --work: #141414; --callout: #252525;
    --shadow-1: 0 0 0 1px rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-2: 0 0 0 1px rgba(255, 255, 255, .08), 0 3px 6px rgba(0, 0, 0, .3), 0 9px 24px rgba(0, 0, 0, .5);
    --shadow-card: 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 4px rgba(0, 0, 0, .3);
    --shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .4);
    --shadow-paper: 0 0 0 1px rgba(255, 255, 255, .05), 0 4px 14px rgba(0, 0, 0, .5);
    --t-gray-bg: #373737; --t-gray: rgba(255,255,255,.85); --t-brown-bg: #4a3228; --t-brown: #f1e3dc; --t-orange-bg: #5c3b23; --t-orange: #fbe3d0;
    --t-yellow-bg: #564328; --t-yellow: #fbefd5; --t-green-bg: #243d30; --t-green: #dcf0e0; --t-blue-bg: #143a4e; --t-blue: #d6ebf7;
    --t-purple-bg: #3c2d49; --t-purple: #efe3f7; --t-pink-bg: #4e2c3c; --t-pink: #f8e1ec; --t-red-bg: #522e2a; --t-red: #ffe3de;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --surface: #202020; --surface-2: #252525;
  --fg: rgba(255, 255, 255, .86); --muted: rgba(255, 255, 255, .5); --faint: rgba(255, 255, 255, .34);
  --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .14);
  --hover: rgba(255, 255, 255, .055); --press: rgba(255, 255, 255, .09);
  --accent: #529cca; --accent-soft: rgba(82, 156, 202, .16); --on-accent: #ffffff;
  --rec: #ff6b5f; --rec-soft: rgba(255, 107, 95, .16);
  --work: #141414; --callout: #252525;
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-2: 0 0 0 1px rgba(255, 255, 255, .08), 0 3px 6px rgba(0, 0, 0, .3), 0 9px 24px rgba(0, 0, 0, .5);
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, .07), 0 2px 4px rgba(0, 0, 0, .3);
  --shadow-card-hover: 0 0 0 1px rgba(255, 255, 255, .12), 0 6px 14px rgba(0, 0, 0, .4);
  --shadow-paper: 0 0 0 1px rgba(255, 255, 255, .05), 0 4px 14px rgba(0, 0, 0, .5);
  --t-gray-bg: #373737; --t-gray: rgba(255,255,255,.85); --t-brown-bg: #4a3228; --t-brown: #f1e3dc; --t-orange-bg: #5c3b23; --t-orange: #fbe3d0;
  --t-yellow-bg: #564328; --t-yellow: #fbefd5; --t-green-bg: #243d30; --t-green: #dcf0e0; --t-blue-bg: #143a4e; --t-blue: #d6ebf7;
  --t-purple-bg: #3c2d49; --t-purple: #efe3f7; --t-pink-bg: #4e2c3c; --t-pink: #f8e1ec; --t-red-bg: #522e2a; --t-red: #ffe3de;
}
body { font-size: 15px; letter-spacing: -.003em; -webkit-font-smoothing: antialiased; }
button:focus-visible, [tabindex]:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(35, 131, 226, .45); }

/* 태그(노션 팔레트) */
.pill { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 3px; font-size: 12px; font-weight: 500; line-height: 1; white-space: nowrap; border: 0; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.pill-gray { background: var(--t-gray-bg); color: var(--t-gray); } .pill-brown { background: var(--t-brown-bg); color: var(--t-brown); }
.pill-orange { background: var(--t-orange-bg); color: var(--t-orange); } .pill-yellow { background: var(--t-yellow-bg); color: var(--t-yellow); }
.pill-green { background: var(--t-green-bg); color: var(--t-green); } .pill-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.pill-purple { background: var(--t-purple-bg); color: var(--t-purple); } .pill-pink { background: var(--t-pink-bg); color: var(--t-pink); }
.pill-red { background: var(--t-red-bg); color: var(--t-red); }

/* 버튼·입력 */
.btn { min-height: 34px; padding: 0 12px; border-radius: var(--radius-s); background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: none; font-weight: 500; font-size: 14px; color: var(--fg); transition: background .1s; }
.btn:hover { background: var(--hover); border-color: var(--line-strong); }
.btn:active { transform: none; background: var(--press); }
.btn-primary, .btn-new { background: var(--accent); border-color: transparent; color: #fff; }
.btn-primary:hover, .btn-new:hover { background: #0077d4; border-color: transparent; }
.btn-danger { background: var(--rec); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover); color: var(--fg); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.ibtn { width: 36px; height: 36px; border-radius: var(--radius-s); color: var(--muted); }
.ibtn:hover { background: var(--hover); color: var(--fg); }
.ibtn.is-on { background: var(--accent-soft); color: var(--accent); }
.input, .select, textarea.input { min-height: 36px; padding: 6px 10px; border-radius: var(--radius-s); border: 1px solid var(--line-strong); background: var(--surface-2); box-shadow: none; font-size: 14.5px; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip { height: 28px; padding: 0 10px; border-radius: 999px; background: transparent; border: 1px solid var(--line-strong); font-weight: 500; color: var(--fg); }
.chip:hover { background: var(--hover); }
.chip.is-on { background: var(--fg); color: var(--bg); border-color: transparent; }
.chip.chip-type.pill { height: 22px; padding: 0 7px; border-radius: 3px; border: 0; font-size: 12px; }
.toggle { width: 34px; height: 20px; background: rgba(135, 131, 120, .3); }
.toggle::after { top: 2px; left: 2px; width: 16px; height: 16px; box-shadow: 0 1px 2px rgba(15, 15, 15, .2); }
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"]::after { transform: translateX(14px); }

/* 토스트·대화상자·메뉴 (노션 팝오버) */
#toast { border-radius: 8px; background: #2f2f2f; color: #fff; font-weight: 500; box-shadow: var(--shadow-2); }
.dlg-overlay { background: rgba(15, 15, 15, .4); }
.dlg { background: var(--surface-2); border-radius: 12px; box-shadow: var(--shadow-2); padding: 22px 24px 18px; gap: 14px; }
.dlg-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.dlg-msg { color: var(--muted); font-size: 14px; line-height: 1.55; }
.pick-item { min-height: 36px; padding: 0 8px; border-radius: var(--radius-s); font-size: 14.5px; }
.pick-item:hover { background: var(--hover); }
.pick-item.is-current { background: var(--accent-soft); color: var(--fg); }
.pick-item.is-current .pick-label::after { content: "✓"; margin-left: 8px; color: var(--accent); font-weight: 600; }
.menu { background: var(--surface-2); border: 0; border-radius: 10px; box-shadow: var(--shadow-2); padding: 6px; min-width: 220px; }
.menu-item { min-height: 32px; padding: 0 8px; border-radius: var(--radius-s); font-size: 14px; gap: 10px; }
.menu-item .ic { width: 18px; height: 18px; color: var(--muted); }
.menu-item:hover { background: var(--hover); }
.menu-sep { background: var(--line); margin: 6px 4px; }

/* 라이브러리: 사이드바 */
#library { background: var(--bg); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: calc(10px + var(--safe-t)) 8px 10px max(8px, var(--safe-l)); gap: 1px; }
.brand { gap: 8px; padding: 6px 8px 12px; border-radius: var(--radius-s); }
.brand-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--fg); }
.brand-mark::before { left: 6px; right: 6px; top: 7px; height: 1.6px; box-shadow: 0 4px 0 var(--bg), 0 8px 0 var(--bg); background: var(--bg); }
.brand-mark::after { right: 4px; bottom: 4px; width: 6px; height: 6px; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.nav-item { min-height: 30px; padding: 0 8px; gap: 8px; border-radius: var(--radius-s); color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-item .ic { width: 18px; height: 18px; color: var(--faint); }
.nav-item:hover { background: var(--hover); color: var(--fg); }
.nav-item.is-on { background: var(--press); color: var(--fg); font-weight: 600; }
.nav-item.is-on .ic { color: var(--fg); }
.nav-item .nav-count { color: var(--faint); font-size: 12px; }
.nav-head { padding: 16px 8px 4px; color: var(--faint); font-size: 12px; font-weight: 600; }
.nav-head .ibtn { width: 24px; height: 24px; opacity: .8; }
.nav-head .ibtn .ic { width: 16px; height: 16px; }
.sidebar-foot { gap: 1px; border-top: 1px solid var(--line); padding-top: 8px; }
.sync-chip { border-radius: var(--radius-s); }

/* 라이브러리: 페이지 머리 */
.lib-top { padding: calc(18px + var(--safe-t)) max(24px, var(--safe-r)) 8px max(24px, var(--safe-l)); gap: 10px; }
.lib-title { font-size: var(--fs-5); font-weight: 700; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 10px; }
.lib-title::before { content: attr(data-icon); font-size: .9em; line-height: 1; }
.lib-title:not([data-icon])::before { content: "📒"; }
.lib-count { color: var(--faint); font-size: 14px; align-self: flex-end; padding-bottom: 6px; }
.search input { border-radius: var(--radius-s); background: var(--hover); border-color: transparent; min-height: 34px; padding-left: 36px; }
.search input:focus { background: var(--surface-2); border-color: var(--line-strong); }
.search .ic { left: 10px; width: 18px; height: 18px; color: var(--faint); }
.lib-tools .ibtn { color: var(--muted); }
.lib-scroll { padding: 8px max(24px, var(--safe-r)) calc(40px + var(--safe-b)) max(24px, var(--safe-l)); }

/* 오늘: 노션 콜아웃 */
.today { background: var(--callout); border: 0; border-radius: 8px; padding: 16px 18px; gap: 12px; margin-bottom: 26px; }
.today-head { align-items: center; }
.today-date { font-size: 16px; font-weight: 600; }
.today-date::before { content: "☀️"; margin-right: 8px; }
.today-sub { color: var(--muted); font-size: 13.5px; }
.today-actions { gap: 8px; }
.tact { min-height: 54px; padding: 8px 12px; gap: 10px; border-radius: 8px; background: var(--surface-2); border: 0; box-shadow: var(--shadow-card); transition: box-shadow .12s, transform .12s; }
.tact:hover { border: 0; box-shadow: var(--shadow-card-hover); }
.tact .ic { color: var(--muted); width: 20px; height: 20px; }
.tact b { font-weight: 600; font-size: 14px; }
.tact small { color: var(--faint); font-size: 12px; }
.tact.is-now, .tact-meet.is-now { background: var(--surface-2); border: 0; box-shadow: 0 0 0 1.5px var(--accent), var(--shadow-card); }
.tact.is-now .ic { color: var(--accent); }
.todo-row { border-color: var(--line); }

/* 노트 카드: 노션 갤러리 */
.note-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.note-card { background: var(--surface-2); border-radius: 8px; box-shadow: var(--shadow-card); overflow: hidden; gap: 0; transition: box-shadow .14s; }
.note-card:hover { box-shadow: var(--shadow-card-hover); }
.note-card .thumb { border-radius: 0; box-shadow: none; border: 0; border-bottom: 1px solid var(--line); aspect-ratio: 4 / 3; background: var(--work); }
.note-card .thumb img { object-fit: cover; object-position: top center; padding: 10px 10px 0; border-radius: 0; }
.note-card .thumb img { background: transparent; }
.card-meta { padding: 10px 12px 12px; gap: 6px; }
.card-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: flex-start; gap: 6px; -webkit-line-clamp: unset; }
.card-title .pg-ic { flex: none; font-size: 15px; line-height: 1.3; }
.card-title .pg-tt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-props { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; min-width: 0; }
.card-time { color: var(--faint); font-size: 12px; margin-left: 2px; }
.card-sub { color: var(--faint); font-size: 12.5px; }
.card-more { top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 6px; background: var(--surface-2); box-shadow: var(--shadow-1); }
.thumb-badges { left: 8px; bottom: 8px; }
.badge { height: 20px; border-radius: 3px; background: rgba(15, 15, 15, .62); font-weight: 500; }
.badge.is-summary { background: var(--accent); }
.note-card.is-pinned .thumb::before { top: auto; bottom: 8px; right: 8px; width: auto; height: auto; background: none; content: "⭐"; font-size: 13px; border-radius: 0; }
.note-list { border-top: 1px solid var(--line); }
.note-row { border-bottom: 1px solid var(--line); min-height: 44px; border-radius: 0; }
.note-row:hover { background: var(--hover); }
.note-row .thumb { box-shadow: var(--shadow-1); }
.empty strong { font-weight: 600; }
.tag { border: 0; background: var(--t-gray-bg); color: var(--t-gray); border-radius: 3px; height: 22px; }

/* 편집기 머리 */
#editor { background: var(--bg); }
.ed-top { background: var(--bg); border-bottom: 1px solid var(--line); }
.ed-title { font-weight: 600; font-size: 16px; }
.ed-title:focus { background: var(--hover); }
.ed-sub { color: var(--faint); }
.ed-tabs { background: transparent; padding: 0; gap: 4px; border-radius: 0; }
.ed-tab { min-height: 32px; padding: 0 10px; border-radius: var(--radius-s); color: var(--muted); font-weight: 500; font-size: 14px; position: relative; }
.ed-tab:hover { background: var(--hover); color: var(--fg); }
.ed-tab.is-on { background: transparent; color: var(--fg); box-shadow: none; font-weight: 600; }
.ed-tab.is-on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -11px; height: 2px; border-radius: 1px; background: var(--fg); }

/* 도구 레일·작업대·종이 */
.rail { background: var(--bg); border-right: 1px solid var(--line); gap: 4px; }
.rail .ibtn { width: 42px; height: 42px; border-radius: 8px; color: var(--muted); }
.rail .ibtn .ic { width: 22px; height: 22px; }
.rail .ibtn:hover { background: var(--hover); color: var(--fg); }
.rail .ibtn.is-on { background: var(--accent-soft); color: var(--accent); }
.rail .ibtn.is-on .pen-dot { background: currentColor; }
.pen-dot { border-color: var(--bg); }
.viewport { background: var(--work); }
.page { box-shadow: var(--shadow-paper); border-radius: 3px; }
.subbar { background: var(--surface-2); border: 0; border-radius: 10px; box-shadow: var(--shadow-2); padding: 5px; gap: 2px; }
.subbar .ibtn { width: 34px; height: 34px; }
.subbar .vsep { background: var(--line-strong); }
.subbar .ask-btn { background: var(--accent); color: #fff; border: 0; }
.page-nav { background: var(--surface-2); border: 0; box-shadow: var(--shadow-2); border-radius: 10px; }
.zoom-label { background: var(--surface-2); border: 0; box-shadow: var(--shadow-1); border-radius: 6px; color: var(--muted); }
.deck { background: var(--bg); border-top: 1px solid var(--line); }
.deck-btn { box-shadow: none; }
.link-bar { background: var(--bg); border-bottom: 1px solid var(--line); }
.link-chip { border-radius: var(--radius-s); background: var(--hover); border: 0; }

/* 문서(받아쓰기·요약) */
.doc-pane { background: var(--bg); }
.doc-head h2 { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.sum-card { background: transparent; border: 0; border-radius: 0; padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
.sum-card h3 { font-size: 17px; font-weight: 600; }
.sum-card.is-headline { background: var(--callout); border: 0; border-radius: 8px; padding: 16px 18px; }
.sum-card.is-flag { background: var(--t-yellow-bg); border: 0; border-radius: 8px; padding: 16px 18px; }
.note-box { background: var(--callout); border: 0; border-radius: 8px; color: var(--muted); }
.err-box { border-radius: 8px; }
.tr-line:hover { background: var(--hover); }

/* 설정 */
.set-group { gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.set-group:last-child { border-bottom: 0; }
.set-group h3 { font-size: 15px; color: var(--fg); font-weight: 600; }
.set-status { border-radius: 8px; background: var(--callout); border: 0; font-size: 13.5px; }

/* 템플릿 고르기 */
.g-card:hover .gthumb { box-shadow: 0 0 0 2px var(--accent), var(--shadow-paper); }
.gthumb { border: 0; box-shadow: var(--shadow-card); border-radius: 6px; }
.g-seg-btn.is-on { background: var(--surface-2); box-shadow: var(--shadow-1); }

/* 오른쪽 패널(캘린더·제미나이) */
.cal-panel { background: var(--bg); border-left: 1px solid var(--line); }
.cal-head strong { font-size: 15px; font-weight: 600; }
.ask-read { background: var(--callout); border-radius: 6px; }
.ask-msg.is-user { background: var(--accent); }
.ask-msg.is-model { background: var(--surface-2); border: 0; box-shadow: var(--shadow-card); }
.ask-chips .chip { border-radius: 6px; height: 30px; }

/* 터치 기기: 누르기 쉽게 */
@media (pointer: coarse) {
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; }
  .ibtn { width: 42px; height: 42px; }
  .nav-item { min-height: 40px; font-size: 15px; }
  .menu-item { min-height: 42px; font-size: 15px; }
  .pick-item { min-height: 44px; }
  .input, .select { min-height: 42px; }
  .toggle { width: 42px; height: 26px; }
  .toggle::after { width: 22px; height: 22px; }
  .toggle[aria-checked="true"]::after { transform: translateX(16px); }
  .rail .ibtn { width: 46px; height: 46px; }
  .card-more { opacity: 1; }
}
@media (max-width: 560px) {
  .lib-top { padding: calc(10px + var(--safe-t)) 14px 6px; }
  .lib-scroll { padding: 6px 14px calc(32px + var(--safe-b)); }
  .lib-title { font-size: 26px; }
  .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .today { padding: 14px; }
  .ed-tab.is-on::after { bottom: -9px; }
}
/* 칩 모양 버튼에도 태그 색이 이기도록 */
.pill.pill-gray { background: var(--t-gray-bg); color: var(--t-gray); } .pill.pill-brown { background: var(--t-brown-bg); color: var(--t-brown); }
.pill.pill-orange { background: var(--t-orange-bg); color: var(--t-orange); } .pill.pill-yellow { background: var(--t-yellow-bg); color: var(--t-yellow); }
.pill.pill-green { background: var(--t-green-bg); color: var(--t-green); } .pill.pill-blue { background: var(--t-blue-bg); color: var(--t-blue); }
.pill.pill-purple { background: var(--t-purple-bg); color: var(--t-purple); } .pill.pill-pink { background: var(--t-pink-bg); color: var(--t-pink); }
.pill.pill-red { background: var(--t-red-bg); color: var(--t-red); }
@media (pointer: coarse) { .note-card .card-more { width: 30px; height: 30px; background: rgba(255, 255, 255, .85); box-shadow: var(--shadow-1); } }

/* 이름: FINK */
.brand-name { font-weight: 800; letter-spacing: .04em; font-size: 14.5px; }
.brand-mark { background: #191919; }
.brand-mark::before { background: #fff; box-shadow: 0 4px 0 #fff, 0 8px 0 #fff; }
.brand-mark::after { background: #eb4d3d; box-shadow: 0 0 0 2px #191919; right: -2px; top: -2px; bottom: auto; width: 8px; height: 8px; }

/* 첨부 파일 패널 */
.attach-panel { width: 440px; }
.attach-panel .cal-head strong { display: inline-flex; align-items: center; gap: 6px; }
.attach-panel .cal-head strong svg { width: 18px; height: 18px; color: var(--muted); }
.ed-attach-btn.is-on { background: var(--accent-soft); color: var(--accent); }
.av-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px 12px; color: var(--muted); font-size: 14px; }
.av-empty strong { color: var(--fg); font-size: 15px; font-weight: 600; }
.av-empty-ic { font-size: 34px; }
.av-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; flex: none; scrollbar-width: thin; }
.av-file { display: inline-flex; align-items: center; gap: 6px; max-width: 200px; min-height: 32px; padding: 0 10px; border-radius: 6px; background: var(--hover); font-size: 13.5px; flex: none; }
.av-file.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.av-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-ic { flex: none; font-size: 16px; }
.av-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: none; }
.av-acts .spacer { flex: 1; }
.av-acts .btn svg { width: 16px; height: 16px; }
.av-view { flex: 1; min-height: 0; overflow: auto; border-radius: 8px; background: var(--work); padding: 10px; -webkit-overflow-scrolling: touch; }
.av-pdf { display: flex; flex-direction: column; gap: 10px; }
.av-page { position: relative; width: 100%; background: #fff; box-shadow: var(--shadow-paper); border-radius: 2px; overflow: hidden; }
.av-canvas { width: 100%; height: auto; display: block; }
.av-pn { position: absolute; right: 6px; bottom: 6px; font-size: 11px; color: #787774; background: rgba(255,255,255,.85); padding: 1px 6px; border-radius: 4px; }
.av-img { width: 100%; height: auto; display: block; background: #fff; border-radius: 4px; box-shadow: var(--shadow-paper); }
.av-doc { background: #fff; color: #37352f; padding: 22px 20px; border-radius: 4px; box-shadow: var(--shadow-paper); font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.av-doc h1, .av-doc h2, .av-doc h3 { line-height: 1.3; margin: 1em 0 .4em; }
.av-doc table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.av-doc td, .av-doc th { border: 1px solid #e3e2e0; padding: 4px 6px; vertical-align: top; }
.av-doc img { max-width: 100%; height: auto; }
.av-tabs { display: flex; gap: 6px; overflow-x: auto; flex: none; margin-bottom: 8px; }
.av-sheet { background: #fff; border-radius: 4px; box-shadow: var(--shadow-paper); overflow: auto; }
.av-sheet table { border-collapse: collapse; font-size: 12.5px; color: #37352f; }
.av-sheet td, .av-sheet th { border: 1px solid #e9e9e7; padding: 3px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.av-sheet tr:first-child td { background: #f7f7f5; font-weight: 600; position: sticky; top: 0; }
.ask-doc { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; background: var(--callout); }
.ask-doc .av-ic { font-size: 22px; }
.ask-doc > div { display: flex; flex-direction: column; min-width: 0; }
.ask-doc strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 860px) { .attach-panel, .ask-panel { width: auto; } .attach-panel { height: min(78%, 720px); } }

/* 캘린더(월간) — 노션 캘린더 느낌 */
.mc-bar { display: flex; align-items: center; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.mc-bar .spacer { flex: 1; }
.mc-title { font-size: 18px; font-weight: 600; margin-right: 6px; font-variant-numeric: tabular-nums; }
.mc-callout { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--callout); margin-bottom: 12px; font-size: 14px; color: var(--muted); flex-wrap: wrap; }
.mc-callout > span:nth-child(2) { flex: 1; min-width: 200px; }
.mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.mc-wd { padding: 6px 8px; font-size: 12px; color: var(--faint); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: right; }
.mc-wd.is-sun, .mc-cell.is-sun .mc-num { color: #e03e3e; } .mc-wd.is-sat, .mc-cell.is-sat .mc-num { color: #2383e2; }
.mc-cell { min-height: 112px; padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; text-align: left; align-items: stretch; position: relative; background: var(--bg); transition: background .1s; }
.mc-cell:hover { background: var(--hover); }
.mc-cell.is-out { background: var(--surface); } .mc-cell.is-out .mc-num { opacity: .45; }
.mc-cell.is-sel { box-shadow: inset 0 0 0 2px var(--accent); }
.mc-num { align-self: flex-end; font-size: 13px; min-width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-variant-numeric: tabular-nums; }
.mc-cell.is-today .mc-num { background: #eb4d3d; color: #fff !important; font-weight: 600; }
.mc-ev { display: flex; gap: 4px; align-items: baseline; font-size: 12px; line-height: 1.35; padding: 1px 5px; border-radius: 3px; overflow: hidden; white-space: nowrap; }
.mc-ev i { font-style: normal; opacity: .7; font-variant-numeric: tabular-nums; flex: none; }
.mc-ev b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.mc-ev:not(.is-all) { background: transparent !important; color: var(--fg) !important; padding-left: 12px; position: relative; }
.mc-ev:not(.is-all)::before { content: ""; position: absolute; left: 4px; top: 50%; width: 5px; height: 5px; border-radius: 50%; transform: translateY(-50%); background: currentColor; opacity: .55; }
.mc-more { font-size: 11.5px; color: var(--muted); padding-left: 5px; }
.mc-notes { font-size: 11.5px; color: var(--muted); padding-left: 4px; margin-top: auto; }
.mc-dots { display: none; gap: 3px; justify-content: center; margin-top: 2px; }
.mc-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.mc-day { margin-top: 18px; display: flex; flex-direction: column; gap: 2px; max-width: 760px; }
.mc-day-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.mc-day-head strong { font-size: 16px; font-weight: 600; }
.mc-row { display: grid; grid-template-columns: 96px auto 1fr auto; gap: 8px; align-items: center; min-height: 38px; padding: 4px 8px; border-radius: 6px; color: var(--fg); text-decoration: none; text-align: left; font-size: 14.5px; }
.mc-row:hover { background: var(--hover); }
.mc-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.mc-rt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-loc { color: var(--faint); font-size: 12.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-day > .btn { align-self: flex-start; margin-top: 8px; }
@media (max-width: 640px) {
  .mc-cell { min-height: 54px; padding: 3px 2px; align-items: center; }
  .mc-num { align-self: center; font-size: 13px; }
  .mc-ev, .mc-more, .mc-notes { display: none; }
  .mc-dots { display: flex; }
  .mc-row { grid-template-columns: 72px auto 1fr; }
  .mc-loc { display: none; }
}
.mc-dots i { background: currentColor !important; opacity: .75; }
@media (max-width: 640px) { .mc-row { grid-template-columns: 88px auto 1fr; } .mc-time { font-size: 12px; } .mc-note .pill { display: none; } }

/* 노트 아이콘·표지 */
.ed-icon { width: 36px; height: 36px; flex: none; font-size: 22px; line-height: 1; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; }
.ed-icon:hover { background: var(--hover); }
.ip { display: flex; flex-direction: column; gap: 10px; }
.ip-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.ip-emo { font-size: 22px; height: 40px; border-radius: 6px; }
.ip-emo:hover { background: var(--hover); }
.ip-emo.is-on { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.ip > .btn-ghost { align-self: flex-start; }
.ip-covers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ip-cover { height: 44px; border-radius: 6px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.ip-cover.is-none { background: var(--surface); }
.ip-cover.is-on { box-shadow: 0 0 0 2px var(--accent); }
.thumb.has-cover { display: flex; align-items: flex-end; padding: 14px; }
.thumb.has-cover .cover-ic { font-size: 40px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,.12)); }
.note-row .thumb.has-cover { padding: 0; align-items: center; justify-content: center; }
.note-row .thumb.has-cover .cover-ic { font-size: 18px; }
@media (max-width: 560px) { .ed-icon { display: none; } .ip-grid { grid-template-columns: repeat(6, 1fr); } }
