/* 꼬리별 — 라이트 테마
   색 이름을 바꾸면 전체 화면이 같이 바뀐다 */
:root {
  --bg: #F5F7FA;        /* 바탕 (차가운 종이색) */
  --surface: #FFFFFF;   /* 카드·입력칸 */
  --ink: #1B2230;       /* 본문 글자 */
  --muted: #5E6878;     /* 보조 글자 */
  --line: #E1E6EE;      /* 구분선 */
  --tail: #0B7A75;      /* 혜성 꼬리 — 강조색 */
  --nucleus: #E8A317;   /* 혜성 핵 — '지금' 표시 */
  --danger: #B42318;
  --danger-bg: #FEF3F2;   /* 마감 지남 강조 바탕 */
  --danger-line: #FECDCA;

  --radius-s: 8px;
  --radius-l: 16px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
          "Malgun Gothic", system-ui, sans-serif;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --env-h: 0px;          /* 테스트 서버 노란 띠 높이 (body.has-env 일 때만) */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* display 를 정한 요소도 hidden 이면 숨김 */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  word-break: keep-all;
}
a { color: var(--tail); }
:focus-visible { outline: 2px solid var(--tail); outline-offset: 2px; }

/* ── 전체 틀 ─────────────────────────────────── */
body.has-env { --env-h: 25px; }
/* 📱 앱 안 웹 화면 (0.3.58) — 앱이 하단 메뉴를 가짐, 웹 하단 메뉴는 숨김 */
body.in-app { --nav-h: 0px; }
body.in-app .tabbar { display: none; }
.env-bar {
  position: sticky; top: 0; z-index: 12;
  height: var(--env-h);
  background: var(--nucleus);
  color: var(--ink);
  font-size: 13px;
  line-height: var(--env-h);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shell { min-height: calc(100vh - var(--env-h)); }
.main {
  width: 100%;          /* PC 격자 안에서 내용 폭만큼 줄어들지 않게 */
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px calc(var(--nav-h) + var(--safe-b) + 32px);
}

/* ── 폰: 하단 탭바 ───────────────────────────── */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 10;
}
.nav :is(a, button) {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.nav :is(a, button)[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav :is(a, button)[aria-current="page"] svg { color: var(--tail); }
.nav .nav-add span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nav .nav-add svg {
  width: 48px; height: 48px;
  padding: 12px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
}
.nav-brand { display: none; }

/* ── PC: 왼쪽 메뉴 ───────────────────────────── */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); }
  .nav {
    position: sticky;
    top: var(--env-h);
    height: calc(100vh - var(--env-h));   /* 노란 띠만큼 줄여 페이지가 밀리지 않게 */
    flex-direction: column;
    padding: 24px 12px;
    border-top: 0;
    border-right: 1px solid var(--line);
    gap: 2px;
    overflow-y: auto;                 /* 창이 낮으면 메뉴만 따로 내려 봄 (0.3.23) */
    overscroll-behavior: contain;     /* 메뉴 끝에서 본문이 같이 밀리지 않게 */
    scrollbar-width: thin;
  }
  .nav :is(a, button) {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    font-size: 15px;
  }
  .nav :is(a, button):hover { background: var(--bg); }
  .nav :is(a, button)[aria-current="page"] { background: var(--bg); }
  .nav-brand, .nav a.nav-brand {
    order: -2;
    display: block;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
    padding: 0 12px 20px;
    color: var(--ink);
    text-decoration: none;
  }
  .nav a.nav-brand:hover, .nav a.nav-brand[aria-current="page"] { background: none; color: var(--tail); }
  .nav .nav-add { order: -1; margin-bottom: 12px; background: var(--ink); color: var(--surface); }
  .nav .nav-add:hover { background: var(--ink); }
  .nav .nav-add span { position: static; width: auto; height: auto; clip: auto; }
  .nav .nav-add svg { width: 20px; height: 20px; padding: 0; background: none; }
  .nav .nav-more { margin-top: auto; }
  .nav .badge { top: 50%; left: auto; right: 12px; margin: -9px 0 0; }
  .nav [data-sub-toggle] { display: none; }   /* 세부메뉴 있는 하단 탭은 PC 에선 펼침 메뉴로 */
  .nav-group { flex: 0 0 auto; }
  .nav-group summary {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    font-size: 15px; color: var(--muted);
    cursor: pointer; list-style: none;
  }
  .nav-group summary::-webkit-details-marker { display: none; }
  .nav-group summary::after { content: "›"; margin-left: auto; font-size: 18px; line-height: 1; transition: transform .15s ease; }
  .nav-group[open] summary::after { transform: rotate(90deg); }
  .nav-group summary:hover { background: var(--bg); }
  .nav-group summary.is-current { color: var(--ink); font-weight: 600; }
  .nav-group summary.is-current svg { color: var(--tail); }
  .nav-group summary .badge { right: 34px; }
  .nav .nav-sub { padding: 7px 12px 7px 48px; font-size: 14px; }
  .nav .nav-sub[aria-current="page"] { box-shadow: inset 3px 0 0 var(--tail); }

  .main { padding: 40px 40px 60px; }
}

/* ── 폰: 하단 쪽 메뉴 (core/_tabbar.html) ─────── */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 12;   /* 시트(11) 위 — 떠 있는 + 가 시트에 잘리지 않게 */
  padding-bottom: var(--safe-b);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar-track {
  display: flex;
  height: var(--nav-h);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: pan-x;
}
.tabbar-track::-webkit-scrollbar { display: none; }
.tabbar.has-pages .tabbar-track { height: calc(var(--nav-h) - 10px); }
.tabbar-page {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  scroll-snap-align: start;
  scroll-snap-stop: always;   /* 세게 밀어도 한 쪽씩 */
}
.tabbar a {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  outline-offset: -2px;   /* 넘기는 칸 안에서 초점 테두리가 잘리지 않게 */
}
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a[aria-current="page"], .tabbar .is-active-mobile, body[data-sheet="more-sheet"] .tabbar .nav-more { color: var(--ink); font-weight: 600; }
.tabbar a[aria-current="page"] svg, .tabbar .is-active-mobile svg, body[data-sheet="more-sheet"] .tabbar .nav-more svg { color: var(--tail); }
.tabbar-dots { display: flex; justify-content: center; gap: 6px; height: 10px; margin: 0; }
.tabbar-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tabbar-dots i.is-on { background: var(--ink); }
.tabbar-add {   /* 가운데 고정, 메뉴보다 12px 위로 떠 있음 */
  position: absolute; top: -12px; left: calc(50% - 26px);
  width: 52px; height: 52px; padding: 14px; border: 0; border-radius: 50%;
  background: var(--ink); color: var(--surface); cursor: pointer;
  box-shadow: 0 0 0 4px var(--surface), 0 4px 12px rgb(27 34 48 / .25);
}
.tabbar-add svg { display: block; width: 24px; height: 24px; }
@media (max-width: 899px) { .nav { display: none; } }
@media (min-width: 900px) { .tabbar { display: none; } }

/* ── ＋ 칸 모음 (0.3.40, 부채 대신) ─────────────── */
:is(.nav-add, .tabbar-add) svg { transition: transform .2s ease; }
body.fan-open :is(.nav-add, .tabbar-add) svg { transform: rotate(45deg); }
.fan-backdrop {
  position: fixed; inset: 0; z-index: 9;       /* 메뉴(10) 바로 아래 */
  background: rgb(27 34 48 / .35);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
body.fan-open .fan-backdrop { opacity: 1; pointer-events: auto; }
.add-sheet {
  position: fixed; z-index: 11; left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));   /* 폰: 하단 탭 바로 위에서 올라옴 */
  max-height: calc(100dvh - var(--nav-h) - 40px); overflow-y: auto;
  padding: 6px 14px 14px;
  background: var(--surface); border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 28px rgb(27 34 48 / .18);
  transform: translateY(105%); opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.2, .9, .3, 1), opacity .15s ease;
}
body.fan-open .add-sheet { transform: none; opacity: 1; pointer-events: auto; }
.add-title { margin: 4px 2px 8px; font-weight: 700; font-size: 15px; }
.add-group { margin: 12px 2px 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.add-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.add-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 4px; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none; text-align: center;
  background: var(--bg);
}
.add-tile:hover, .add-tile:focus-visible { outline: 2px solid var(--tail); outline-offset: -2px; }
.fan-icon {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--surface); color: var(--tail); box-shadow: 0 2px 8px rgb(27 34 48 / .12);
}
.fan-label { font-size: 14px; font-weight: 600; line-height: 1.25; }
.fan-label small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); }
.add-tip { margin: 12px 2px 0; font-size: 12px; color: var(--muted); }
.add-tip kbd { font: inherit; padding: 0 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); }
@media (hover: none) { .add-tip { display: none; } }   /* 폰은 Ctrl+V 안내 없이 */

@media (min-width: 900px) {
  /* PC: '추가' 버튼 아래로 펼쳐지는 칸 모음 (두 줄 칸) */
  .add-sheet {
    left: 12px; right: auto; top: calc(118px + var(--env-h)); bottom: auto;
    width: 440px; max-height: calc(100vh - 140px);
    border: 1px solid var(--line); border-radius: var(--radius-l);
    box-shadow: 0 8px 24px rgb(27 34 48 / .14);
    transform: translateY(-6px);
  }
  .add-sheet .sheet-grip { display: none; }
  .add-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fan-backdrop { background: transparent; }
}

/* ── 더보기: 기능 격자 + 폰 시트 ─────────────── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 6px;
  margin-bottom: 20px;
}
.feature-grid a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 13px; color: var(--ink); text-decoration: none; text-align: center; line-height: 1.3;
}
.feature-grid small { font-size: 11px; color: var(--muted); }
.feature-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--bg);
  color: var(--tail);
}
.feature-grid a[aria-current="page"] .feature-icon { background: var(--tail); color: var(--surface); }
.more-page .feature-icon { background: var(--surface); border: 1px solid var(--line); }

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 9;
  background: rgb(27 34 48 / .35);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 11;
  left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b));   /* 탭바 바로 위 */
  max-height: calc(100vh - var(--nav-h) - var(--safe-b) - 48px);
  overflow-y: auto;
  padding: 8px 20px 24px;   /* 아래는 떠 있는 + 가 글자를 가리지 않게 */
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 24px rgb(27 34 48 / .12);
  transform: translateY(calc(100% + var(--nav-h)));
  visibility: hidden;
  transition: transform .25s cubic-bezier(.2, .8, .3, 1), visibility 0s linear .25s;
}
.sheet.is-open { transform: none; visibility: visible; transition: transform .25s cubic-bezier(.2, .8, .3, 1); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet .who { margin: 0 0 10px; font-size: 14px; }
.sheet .version { margin: 12px 0 0; }
.sheet-title { margin: 0 0 10px; font-weight: 700; font-size: 17px; }
.list a[aria-current="page"] { color: var(--tail); font-weight: 700; }
/* 더보기 2단: 격자 항목 → 세부메뉴 패널이 옆에서 들어온다 */
.sheet-panel:not([hidden]) { animation: panel-in .22s cubic-bezier(.2, .8, .3, 1); }
@keyframes panel-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.sheet-head .sheet-title { margin: 0; }
.sheet-back {
  min-height: 40px; padding: 0 10px 0 4px;
  border: 0; background: none; font: inherit; font-size: 15px; color: var(--tail); cursor: pointer;
}

@media (max-width: 899px) {
  .nav .desk-only { display: none; }   /* 폰 하단 탭은 5칸만 */
  .nav .is-active-mobile, body[data-sheet="more-sheet"] .nav .nav-more { color: var(--ink); font-weight: 600; }
  .nav .is-active-mobile svg, body[data-sheet="more-sheet"] .nav .nav-more svg { color: var(--tail); }
}
@media (min-width: 900px) {
  .sheet, .sheet-backdrop { display: none; }   /* PC 는 왼쪽 메뉴에 다 보이고, 더보기는 페이지로 */
  .more-page .feature-grid { display: none; }
}

/* ── 오늘 화면 ───────────────────────────────── */
.today-head { margin: 8px 0 28px; }
.greet { color: var(--muted); margin: 0; }
.date {
  font-size: clamp(44px, 12vw, 64px);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin: 4px 0 0;
}
.weekday { font-size: 20px; font-weight: 500; color: var(--muted); margin-left: 4px; letter-spacing: -0.01em; }
.comet { display: block; width: 100%; height: auto; margin-top: 18px; overflow: visible; }
.comet .track { stroke: var(--line); }
.comet .tail { stroke: var(--tail); }
.comet .nucleus { fill: var(--nucleus); }
.comet-caption { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

.section { margin-top: 32px; }
.section h2 { font-size: 17px; font-weight: 700; margin: 0 0 10px; letter-spacing: -0.01em; }
.empty {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-l);
  padding: 20px;
  color: var(--muted);
  font-size: 15px;
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: 14px; text-decoration: none; }
.count { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 4px; }

/* ── 할 일 ───────────────────────────────────── */
.todos {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.todo { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.todo:last-child { border-bottom: 0; }
.todo form { flex: 0 0 auto; padding-right: 10px; }
.done-btn {
  min-width: 56px; min-height: 36px;   /* 손가락으로 누르기 쉬운 크기 */
  padding: 6px 12px;
  font: inherit; font-size: 14px; font-weight: 600;
  border: 1px solid var(--tail);
  border-radius: 999px;
  background: var(--surface);
  color: var(--tail);
  cursor: pointer;
}
.done-btn:hover { background: var(--tail); color: var(--surface); }
.is-done .done-btn { border-color: var(--line); color: var(--muted); font-weight: 500; }
.todo.htmx-swapping { opacity: 0; transition: opacity .2s ease; }
.todo-body {
  flex: 1;
  min-width: 0;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  padding: 12px 8px 12px 16px;
  color: var(--ink);
  text-decoration: none;
}
.todo-title { overflow-wrap: anywhere; }
.is-done .todo-title { color: var(--muted); text-decoration: line-through; }
.due, .has-memo { font-size: 13px; color: var(--muted); }
.due-today { color: var(--tail); font-weight: 600; }
.due-overdue { color: var(--danger); font-weight: 600; }
.has-memo::before { content: "· "; }

.quick-add { margin-top: 12px; display: grid; gap: 8px; }
.quick-add input {
  width: 100%;
  padding: 11px 14px;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.quick-add-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.quick-add-row input[type=date] { width: auto; flex: 1 1 140px; padding: 8px 10px; }
.chips { display: flex; gap: 6px; }
.chips button {
  padding: 7px 12px;
  font: inherit; font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}
.chips button[aria-pressed="true"] { border-color: var(--tail); color: var(--tail); font-weight: 600; }
.btn.btn-inline { display: inline-block; width: auto; padding: 9px 18px; }
.overdue-alert {
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--danger);
  border-radius: var(--radius-l);
  background: var(--danger-bg);
}
.overdue-alert h2 { color: var(--danger); }
.overdue-alert .todos { border-color: var(--danger-line); }
.badge {
  position: absolute; top: 6px; left: 50%; margin-left: 6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.nav :is(a, button) { position: relative; }
.complete-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.complete-bar span { color: var(--muted); }

.tag {
  font-size: 12px; line-height: 1.5;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}
.tag-shared { color: var(--tail); }
.quick-more { font-size: 14px; text-decoration: none; justify-self: start; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row > .field, .field-row input { min-width: 0; }   /* 날짜·시간 칸이 좁은 폰에서 넘치지 않게 */
.field select {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.repeat { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px 2px; margin: 4px 0 18px; }
.repeat legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.repeat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.repeat-row select, .repeat-every input {
  padding: 10px 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
}
.repeat-row select { flex: 1 1 140px; }
.repeat-every { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.repeat-every input { width: 64px; }
.day-chips { display: grid; grid-template-columns: repeat(7, minmax(0, 40px)); gap: 5px; margin-bottom: 4px; }   /* 7요일 한 줄 */
.day-chips > div, .day-chips > div > div { display: contents; }   /* Django 체크박스 묶음 껍데기 무시 */
.day-chip { position: relative; }
.day-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-chip span {
  display: grid; place-items: center;
  width: 100%; aspect-ratio: 1;
  border: 1px solid var(--line); border-radius: 50%;
  font-size: 14px; color: var(--muted); cursor: pointer;
}
.day-chip input:checked + span { background: var(--tail); border-color: var(--tail); color: var(--surface); font-weight: 600; }
.day-chip input:focus-visible + span { outline: 2px solid var(--tail); outline-offset: 2px; }
.day-help { font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.tag-repeat { color: var(--tail); }
.share { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 12px 14px 2px; margin: 4px 0 18px; }
.share legend { font-size: 14px; font-weight: 600; padding: 0 4px; }
.share .help { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.field input[type=checkbox] { width: auto; margin: 0 6px 0 0; accent-color: var(--tail); }
.field label:has(input[type=checkbox]) { display: inline-flex; align-items: center; font-weight: 400; margin: 0 16px 6px 0; }

.done-list summary { cursor: pointer; font-size: 17px; font-weight: 700; margin-bottom: 10px; }

/* 추가 화면 '더 정하기' 접힘 */
.more-fields { margin: 4px 0 14px; }
.more-fields summary {
  display: flex; align-items: center; gap: 6px; min-height: 44px;
  list-style: none; cursor: pointer; font-weight: 600; color: var(--tail);
}
.more-fields summary::-webkit-details-marker { display: none; }
.more-fields summary::before { content: "▸"; }
.more-fields[open] summary::before { content: "▾"; }
.more-fields summary span { font-weight: 400; font-size: 14px; color: var(--muted); }
.more-fields[open] summary { margin-bottom: 8px; }

/* 화면 안 상단 탭 (core/_subtabs.html) — 칸을 똑같이 나눠 옆 스크롤 없음 */
.subtabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  margin: -6px 0 20px; padding: 4px;
  background: var(--line); border-radius: var(--radius-s);
}
.subtabs a {
  display: grid; place-items: center; min-height: 40px;
  border-radius: 6px; color: var(--muted); text-decoration: none; font-size: 15px;
}
.subtabs a[aria-current="page"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgb(27 34 48 / .08); }
@media (min-width: 900px) {
  .subtabs { display: none; }   /* 왼쪽 메뉴 세부메뉴와 같아서 PC 에선 숨김 (기본 규칙보다 뒤에 둬야 함) */
  .subtabs.scope-tabs, .subtabs.ai-tabs { display: grid; }   /* 일정 고치기 '이 날만/반복 전체'·AI 작업실 [작업 도우미/조사]는 PC 에서도 */
}

/* 오늘 화면 한 줄 링크 (예: 장보기 3개 남았어요 →) */
.today-link { display: block; margin-top: 10px; font-size: 15px; text-decoration: none; }

/* ── 출퇴근 (attendance) ───────────────────────── */
.work-card { padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.work-now { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.work-now a { flex: 0 0 auto; font-size: 14px; text-decoration: none; }
.work-warn { margin: 0 0 8px; font-size: 14px; color: var(--danger); }
.work-sum { margin-top: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.work-sum p { margin: 2px 0; }
.event-title.work-title { white-space: normal; overflow: visible; }   /* 종류·시각("다음 날 06:00")이 좁은 폰에서 잘리지 않고 줄바꿈 */
.work-week { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 20px 0 8px; font-size: 14px; color: var(--muted); }
.work-week h3 { margin: 0; font-size: 15px; color: var(--ink); }
.work-days > div { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }   /* 요일 체크 — 줄바꿈, 옆 스크롤 없음 */

/* ── 장보기 ──────────────────────────────────── */
.shop-add { margin: 0 0 12px; }
.shop-add .quick-add-row { flex-wrap: nowrap; }
.shop-add .quick-add-row input { flex: 1; min-width: 0; }
.shop-board > .errors { margin: -4px 0 12px; }
.shop-frequent { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 14px; }
.shop-frequent span { font-size: 13px; color: var(--muted); margin-right: 2px; }
.shop-frequent button {
  min-height: 36px; padding: 6px 12px;
  font: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.shop-frequent .shop-frequent-edit { padding: 6px 4px; font-size: 14px; color: var(--muted); }
.shop-hint { margin: -6px 0 14px; font-size: 14px; color: var(--muted); }
.shop-forget-name { flex: 1; min-width: 0; padding: 14px 16px; }
.shop-item form.shop-forget { flex: 0 0 auto; }
.shop-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden;
}
.shop-item { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.shop-item form { flex: 1; min-width: 0; }
.shop-check {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 50px; padding: 12px 8px 12px 16px;
  font: inherit; text-align: left; color: var(--ink);
  border: 0; background: none; cursor: pointer;
}
.shop-box {
  flex: 0 0 24px; height: 24px;
  display: grid; place-items: center;
  border: 2px solid var(--tail); border-radius: 50%;
  font-size: 14px; font-weight: 700; color: var(--surface);
}
.shop-name { overflow-wrap: anywhere; }
.is-bought .shop-box { background: var(--tail); }
.is-bought .shop-name { color: var(--muted); text-decoration: line-through; }
.shop-edit { flex: 0 0 auto; padding: 14px 16px; font-size: 14px; color: var(--muted); text-decoration: none; }
.btn-text { border: 0; background: none; font: inherit; font-size: 14px; color: var(--tail); cursor: pointer; padding: 6px 4px; }

.back { display: inline-block; font-size: 14px; text-decoration: none; margin-top: 4px; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 20px; }
.danger-zone { margin-top: 20px; text-align: center; }
.btn-text-danger { border: 0; background: none; color: var(--danger); font: inherit; cursor: pointer; padding: 10px; }

/* ── 할 일·일정 안내 (todos/_what.html) ───────── */
.what { list-style: none; margin: -10px 0 16px; padding: 0; font-size: 14px; color: var(--ink); }
.what b { color: var(--tail); margin-right: 4px; }
.what span { color: var(--muted); }

/* ── 일정 ───────────────────────────────────── */
.events { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.event { border-bottom: 1px solid var(--line); }
.event:last-child { border-bottom: 0; }
.event-body { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 16px; color: var(--ink); text-decoration: none; }
.event-time { flex: 0 0 auto; font-size: 14px; color: var(--muted); white-space: nowrap; }
.event-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }   /* 긴 제목은 말줄임 */
.event-title small { color: var(--muted); font-size: 13px; }
.event-body .tag { flex: 0 0 auto; white-space: nowrap; }
.event-repeat { flex: 0 0 auto; font-size: 13px; }
.event-sub { font-size: 15px; font-weight: 700; color: var(--muted); margin: 14px 0 8px; }
.event-day h2 { font-size: 15px; }
.event-day { margin-top: 20px; }
.event-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.event-actions .btn { text-decoration: none; }
.event-cats { font-size: 14px; text-decoration: none; }
.event-past { margin-top: 24px; text-align: center; }
.event-series { font-size: 14px; color: var(--muted); margin: -10px 0 14px; }
/* 0.2.72 인물 — 연결 요청은 제목이 길어 줄바꿈, 카드는 이름표·값 두 칸 */
.people-asking .event-body { flex-wrap: wrap; }
.people-asking .event-title { white-space: normal; flex-basis: 100%; }
.person-card { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 14px; }
.person-card dt { color: var(--muted); font-size: 14px; }
.person-card dd { margin: 0; overflow-wrap: anywhere; }
.event-shared { color: var(--muted); }
.cat-pick .help, .people-asking .help, .section > .help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.dot { flex: 0 0 auto; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #98A2B3); }
.dot-blue { --dot: #2E6BE6; }
.dot-orange { --dot: #E8730C; }
.dot-green { --dot: #2E9E4F; }
.dot-purple { --dot: #7A4FD6; }
.dot-pink { --dot: #D6457F; }
.dot-teal { --dot: #0B7A75; }
.dot-gray { --dot: #98A2B3; }
.cat-pick { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.cat-pick legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }   /* 줄바꿈되는 버튼 — 옆 스크롤 없음 */
.cat-chips > div, .cat-chips > div > div { display: contents; }   /* Django 라디오 묶음 껍데기 무시 */
.cat-chip { position: relative; }
.cat-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cat-chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; min-height: 36px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 14px; cursor: pointer;
}
.cat-chip input:checked + span { border-color: var(--tail); color: var(--tail); font-weight: 700; box-shadow: inset 0 0 0 1px var(--tail); }
.cat-chip input:focus-visible + span { outline: 2px solid var(--tail); outline-offset: 2px; }
.cat-manage { display: inline-block; margin-top: 8px; font-size: 13px; text-decoration: none; }
.cat-help { font-size: 14px; color: var(--muted); margin: -10px 0 14px; }

/* ── 달력 (schedule/_month.html · 오늘 화면 '이번 주') — 폰 360px 에서도 7칸이 넘치지 않게 ── */
.cal-head { display: flex; align-items: center; gap: 4px; margin-bottom: 8px; }
.cal-title { flex: 1; margin: 0; text-align: center; font-size: 18px; font-weight: 700; }
.cal-nav { flex: 0 0 44px; display: grid; place-items: center; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; color: var(--ink); text-decoration: none; }
a.cal-nav:hover { background: var(--line); }
.cal-go-today { flex: 0 0 auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; text-decoration: none; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px;
  padding: 6px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
}
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 2px; }
.cal-day {
  min-width: 0; height: 58px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 0;
  border: 2px solid transparent; border-radius: var(--radius-s);
  color: var(--ink); text-decoration: none;
}
.cal-day:hover { background: var(--bg); }
.cal-num { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 15px; line-height: 1; }
.cal-wd.wd-0, .cal-day.wd-0 .cal-num { color: var(--danger); }   /* 일요일 빨강 */
.cal-wd.wd-6, .cal-day.wd-6 .cal-num { color: #2E6BE6; }          /* 토요일 파랑 */
.cal-day.is-today .cal-num { background: var(--tail); color: var(--surface); font-weight: 700; }
.cal-day.is-picked { border-color: var(--tail); }
.cal-day.is-out { opacity: .4; }   /* 앞뒤 달 날짜 */
.cal-dots { display: flex; align-items: center; justify-content: center; gap: 2px; height: 8px; max-width: 100%; }
.cal-dots .dot { width: 6px; height: 6px; }
.cal-dots small { font-size: 10px; line-height: 1; color: var(--muted); }
.cal-check { height: 12px; font-size: 11px; line-height: 12px; }
.cal-todo-open { color: var(--tail); }
.cal-todo-overdue { color: var(--danger); }
.cal-todo-done { color: var(--muted); opacity: .5; }
.cal-todo-preview { color: var(--tail); opacity: .35; }   /* 반복 할 일 미리 보기 */
.cal-list { margin-top: 20px; }
.cal-list h2 { font-size: 16px; }
.cal-list .events, .cal-list .todos { margin-bottom: 10px; }
.cal-actions { margin-top: 12px; }
.is-preview .todo-body { color: var(--muted); }
.is-preview .todo-title { color: var(--muted); }
.preview-help { flex-basis: 100%; font-size: 12px; color: var(--muted); }
@media (min-width: 900px) {
  .cal-day { height: 76px; }
  .cal-dots { height: 10px; gap: 3px; }
  .cal-dots .dot { width: 8px; height: 8px; }
}

/* ── 시계 다이얼 (static/js/clock.js) ─────────── */
.clock-trigger {
  width: 100%; padding: 12px 14px;
  font: inherit; text-align: left; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface);
  cursor: pointer;
}
.clock-trigger.is-empty { color: var(--muted); }
dialog.clock {
  width: min(320px, calc(100vw - 32px));
  padding: 18px 18px 14px;
  border: 0; border-radius: 20px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 12px 40px rgb(27 34 48 / .25);
}
dialog.clock::backdrop { background: rgb(27 34 48 / .4); }
@media (max-width: 899px) {
  /* 키패드 위로 — 테스트 서버 노란 띠(--env-h)와 노치(안전 여백) 아래에 둔다 */
  dialog.clock.is-typing { margin-top: calc(12px + var(--env-h) + env(safe-area-inset-top, 0px)); }
}
.clock-head { margin-bottom: 10px; }
.clock-time { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 40px; font-weight: 700; letter-spacing: -0.02em; }
.clock-half { font-size: 20px; font-weight: 600; color: var(--ink); margin-right: 6px; }
.clock-part { font: inherit; color: var(--muted); background: none; border: 0; border-radius: var(--radius-s); padding: 0 6px; cursor: pointer; }
.clock-part.on { color: var(--tail); background: var(--bg); }
.clock-type {
  width: 1.7em; padding: 0 4px;
  font: inherit; text-align: center; color: var(--tail);
  border: 2px solid var(--tail); border-radius: var(--radius-s); background: var(--surface);
}
.clock-type::placeholder { color: var(--line); }
.clock-type.is-bad { border-color: var(--danger); color: var(--danger); }
.clock-hint { margin: 2px 0 10px; font-size: 12px; color: var(--muted); text-align: center; }
.clock-ampm { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.clock-ampm button {
  min-height: 44px;   /* 손가락 크기 */
  font: inherit; font-size: 16px;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: var(--surface); color: var(--muted); cursor: pointer;
}
.clock-ampm button[aria-pressed="true"] { background: var(--tail); border-color: var(--tail); color: var(--surface); font-weight: 700; }
.clock-ampm button[aria-pressed="true"]::after { content: "✓"; margin-left: 6px; }
.clock-face { display: block; width: 100%; max-width: 260px; margin: 0 auto; touch-action: none; user-select: none; cursor: pointer; }
.clock-face:focus-visible { outline: 2px solid var(--tail); outline-offset: 4px; border-radius: 50%; }
.clock-bg { fill: var(--bg); }
.clock-hand { stroke: var(--tail); stroke-width: 2; }
.clock-center, .clock-knob { fill: var(--tail); }
.clock-nums text { font-size: 15px; text-anchor: middle; dominant-baseline: central; fill: var(--ink); pointer-events: none; }
.clock-nums text.on { fill: var(--surface); font-weight: 700; }
.clock-quick { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 8px; }
.clock-quick button { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.clock-actions { display: flex; align-items: center; gap: 4px; }
.clock-actions span { flex: 1; }
.clock-actions button { font: inherit; font-size: 15px; padding: 10px 12px; border: 0; background: none; color: var(--tail); font-weight: 600; cursor: pointer; border-radius: var(--radius-s); }
.clock-actions .clock-clear { color: var(--muted); font-weight: 400; }

/* ── 목록 (더보기) ───────────────────────────── */
.list { background: var(--surface); border-radius: var(--radius-l); border: 1px solid var(--line); overflow: hidden; }
.list > * {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.list > *:last-child { border-bottom: 0; }
.list form { padding: 0; }
.list form button { width: 100%; padding: 16px 18px; border: 0; background: none; font: inherit; text-align: left; color: var(--danger); cursor: pointer; }
.version { font-size: 13px; color: var(--muted); text-align: center; margin-top: 24px; }
.list .sub { display: block; font-size: 13px; color: var(--muted); }
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 20px; }
.who { color: var(--muted); margin: -12px 0 20px; }

/* ── 권한 현황 표 ───────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.perm-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.perm-table th, .perm-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.perm-table th { font-weight: 600; color: var(--muted); }
.perm-table td.c { text-align: center; color: var(--tail); }
.tally-table th, .tally-table td { text-align: center; border: 1px solid var(--line); }   /* 특허 집계표 (0.2.58) */
.tally-table thead th, .tally-table tbody th { color: var(--ink); }
.tally-table .tally-sum th, .tally-table .tally-sum td, .tally-table td:last-child { font-weight: 600; }
.fx-table td { text-align: right; font-variant-numeric: tabular-nums; }   /* 환율 (0.2.59) */
.fx-table td.fx-best { font-weight: 700; color: var(--tail); }
.fx-table td.fx-up { color: #1a7f37; font-weight: 600; }
.fx-table td.fx-down { color: var(--muted); }
.fx-table td.fx-time { color: var(--muted); font-size: 13px; }
.fx-pref { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; }
.fx-pref label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.fx-pref input { width: 11em; max-width: 100%; }
.fx-pick { flex-basis: 100%; }
.fx-pick summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.fx-pick fieldset { border: 0; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.fx-pick legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.fx-pick fieldset label { flex-direction: row; align-items: center; gap: 4px; color: var(--ink); }
.fx-cur label { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.fx-cur select { min-width: 12em; max-width: 100%; }
.perm-table small { color: var(--muted); }

/* ── 로그인·가입 화면 ─────────────────────────── */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-box { width: min(380px, 100%); }
.auth-brand { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin: 0 0 4px; }
.auth-sub { color: var(--muted); margin: 0 0 24px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.field input, .field textarea, .roster-bar input:not([type=checkbox]) {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
}
.field .help { font-size: 13px; color: var(--muted); margin-top: 4px; }
.field .help ul { margin: 0; padding-left: 18px; }
.errors { color: var(--danger); font-size: 14px; margin: 4px 0 0; padding-left: 18px; }
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius-s);
  background: var(--ink);
  color: var(--surface);
  cursor: pointer;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }   /* 올리는 중·답을 기다리는 중 잠긴 버튼이 눌릴 것처럼 보이지 않게 */
.btn.btn-outline { background: var(--surface); color: var(--ink); border: 1px dashed var(--muted); }
.btn.btn-link { text-align: center; text-decoration: none; }
.narrow { max-width: 420px; }
.gap-top { margin-top: 20px; }
.dev-login { margin-top: 20px; text-align: center; }
.dev-login .help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.auth-foot { margin: 28px 0 0; text-align: center; font-size: 13px; }
.auth-foot a, .version a { color: var(--muted); }
/* 개인정보처리방침 */
.policy { font-size: 15px; line-height: 1.6; overflow-wrap: anywhere; }
.policy p { margin: 0 0 14px; }
.policy a { color: inherit; }
.policy-date { font-size: 13px; color: var(--muted); }
.notice {
  background: var(--surface);
  border-left: 3px solid var(--tail);
  padding: 12px 14px;
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  margin-bottom: 16px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── 구글 캘린더 연동 ─────────────────────────── */
.form-lock { border: 0; padding: 0; margin: 0; min-width: 0; }
.form-lock:disabled { opacity: .75; }
.gcal-fake, .gcal-hold { background: #FFF4D6; border: 1px solid var(--nucleus); border-radius: var(--radius-s); padding: 10px 14px; font-size: 14px; margin: 0 0 16px; }
.gcal-card > * + * { margin-top: 12px; }
.gcal-hold p { margin: 0 0 10px; }
.gcal-hold form { display: flex; flex-direction: column; gap: 8px; }
.gcal-fake-list { font-size: 13px; color: var(--muted); padding-left: 18px; }
.gcal-card p { margin: 0; }
.gcal-state { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.gcal-state.is-warn { color: var(--danger); }
.gcal-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 0; }
.gcal-info dt { color: var(--muted); }
.gcal-info dd { margin: 0; overflow-wrap: anywhere; }
.gcal-info dd a { margin-left: 6px; font-size: 14px; }
.gcal-card .help { font-size: 13px; color: var(--muted); }
.gcal-off { margin-top: 20px; }
.gcal-off summary { cursor: pointer; color: var(--danger); padding: 8px 0; }
.gcal-off-buttons { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.gcal-off-buttons .btn { text-align: center; text-decoration: none; }
.gcal-cals { border: 0; padding: 0; margin: 0 0 14px; }
.gcal-cals legend { font-weight: 600; margin-bottom: 8px; }
.gcal-cal { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.gcal-cal small { color: var(--muted); }
.gcal-status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); margin: -6px 0 12px; }
.gcal-status form { display: inline; }
.gcal-status .btn-text { font-size: 13px; padding: 2px 4px; }
.gcal-status-err { color: var(--danger); }

/* ── 알림 (웹 푸시) ─────────────────────────── */
.push-title { font-weight: 700; margin: 24px 0 8px; }
.push-row { display: flex; align-items: center; cursor: default; }
.push-row > div { flex: 1; overflow-wrap: anywhere; }
.push-row form button { width: auto; }
.visit .event-title small { display: block; overflow: hidden; text-overflow: ellipsis; }   /* 진료 기록: 둘째 줄 (병원 · 약 수 · 다음) */

/* ── 병원 기록 서류 ─────────────────────────────── */
.doc { padding: 10px 16px; }
.doc-name { overflow-wrap: anywhere; }   /* 긴 이름은 줄바꿈 */
.doc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.doc-actions small { color: var(--muted); font-size: 13px; }
.doc-more summary { cursor: pointer; list-style: none; padding: 6px 10px; color: var(--muted); }
.doc-more[open] { flex-basis: 100%; min-width: 0; }
.doc-kind { display: flex; gap: 8px; align-items: center; }
.doc-kind input { flex: 1; width: 0; min-width: 0; }
.doc-kind button { flex: none; white-space: nowrap; }
/* 병원 기록 잇기 (0.2.68) — 상태 색, 연결된 기록, 몸 그림, 연결 그림 */
.lv-ok { --lv: #3B9F5B; } .lv-mild { --lv: #E8A317; } .lv-pain { --lv: #D1453B; }
.lv-care { --lv: #4F6BD8; } .lv-healed { --lv: #0B7A75; } .lv-none { --lv: #C9D1DC; }
.lv-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--lv); margin-right: 4px; vertical-align: baseline; }
.lv-text { color: var(--lv); font-weight: 600; }
.level-key { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.link-list { list-style: none; margin: 0; padding: 0; }
.link-list li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }
.link-kind { flex: none; min-width: 84px; font-size: 13px; color: var(--muted); }
.link-list a { overflow-wrap: anywhere; }
.links { margin-bottom: 16px; }
.body-views { display: flex; justify-content: center; gap: 12px; }
.body-view { margin: 0; flex: 1; max-width: 220px; text-align: center; }
.body-view svg { width: 100%; height: auto; }
.body-view figcaption { font-size: 13px; color: var(--muted); }
/* 0.2.69 진료기록지식 몸 그림 — 흰 바탕 + 진한 윤곽선, 부위 경계는 옅은 선 */
.sil-fill { fill: #FBFCFD; }
.sil-line { fill: none; stroke: #4A5566; stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; }
.part { fill: var(--lv); fill-opacity: .85; stroke: #B8C2CF; stroke-width: .8; cursor: pointer; }
.part.lv-none { fill: #FBFCFD; fill-opacity: 1; }
.part.face { stroke: #4A5566; stroke-width: 1.1; }
a:hover > .part, a:focus > .part { fill-opacity: 1; stroke: var(--ink); stroke-width: 1.6; }
.dept-ortho { --lv: #3E7CC4; } .dept-neuro { --lv: #8E5BC2; } .dept-eye { --lv: #2AA198; } .dept-ent { --lv: #E8A317; }
.dept-dental { --lv: #9AA6B6; } .dept-internal { --lv: #D1453B; } .dept-uro { --lv: #D86FA6; } .dept-skin { --lv: #C98A4B; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); margin-bottom: 8px; }
.seg a { padding: 6px 16px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; }
.seg a[aria-current] { background: var(--tail); color: #fff; }
.body-outside { display: flex; justify-content: center; gap: 8px; margin: 4px 0 8px; }
.chip { display: inline-flex; align-items: center; gap: 2px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
.dept-key { list-style: none; padding: 0; margin: 4px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 14px; }
.dept-key small { color: var(--muted); }
/* 연결 지도 3D (0.2.69) */
.graph3d { position: relative; height: min(62vh, 560px); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: #F5F7FA; touch-action: none; }
.graph3d-wait { padding: 16px; }
.graph3d-pick { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 8px 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); overflow-wrap: anywhere; }
.graph3d-pick[hidden] { display: none; }
.graph3d-pick .btn { flex: none; }
.graph-key .dot3d { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border-top: 0; }
.d3-visit { background: #0B7A75; } .d3-admission { background: #C2410C; } .d3-pharmacy { background: #8E5BC2; } .d3-note { background: #D1453B; }
.scene-tooltip, .float-tooltip-kap { display: none; }   /* 라이브러리 이름표는 안 씀 */
.level-pick { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.lv-choice { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; margin: 0; min-height: 36px; }
.lv-choice input, .visit-pick input { width: auto; margin: 0; accent-color: var(--tail); }
.visit-pick { max-height: 40vh; overflow-y: auto; display: flex; flex-direction: column; }
.visit-pick label { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 0; min-height: 40px; }
.note { padding: 10px 16px; display: block; }
.note-head { display: flex; align-items: center; gap: 6px; }
.note-head small { color: var(--muted); }
.note-del { margin-left: auto; }
.note-memo { margin-top: 4px; }
.note-link { margin-top: 4px; font-size: 14px; }
.graph-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); margin: 8px 0 4px; -webkit-overflow-scrolling: touch; }
.graph { display: block; min-width: 100%; }
.g-row { stroke: var(--line); stroke-dasharray: 3 4; }
.g-rowname { font-size: 12px; fill: var(--muted); font-weight: 600; }
.g-date { font-size: 10px; fill: var(--muted); text-anchor: middle; }
.g-line { fill: none; stroke-width: 2; stroke: #9AA6B6; }
.g-chain { stroke: var(--tail); stroke-width: 2.5; }
.g-part { stroke: #C9A0DC; stroke-dasharray: 4 3; }
.g-node { stroke: #fff; stroke-width: 2; }
.g-visit { fill: var(--tail); }
.g-pharmacy { fill: #8E5BC2; }
.g-admission { fill: #C2410C; }   /* 입원 (0.2.82) — 진료 줄의 둥근 네모 */
.g-note { fill: var(--lv); }
.g-ring { fill: none; stroke: var(--nucleus); stroke-width: 3; }
.g-label { font-size: 11px; fill: var(--ink); text-anchor: middle; }
.graph a:hover .g-node, .graph a:focus .g-node { stroke: var(--ink); }
.graph-key { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 12px; }
.graph-key span { display: inline-block; width: 18px; height: 0; border-top: 2.5px solid #9AA6B6; }
.graph-key .k-chain { border-color: var(--tail); }
.graph-key .k-part { border-top: 2px dashed #C9A0DC; }
.graph-key .k-adm { width: 11px; height: 11px; border: 0; border-radius: 3px; background: #C2410C; }
.adm-tag { color: #C2410C; font-weight: 600; }
.adm-now { background: #FFF1E8; color: #C2410C; border-radius: 999px; padding: 2px 8px; font-size: 13px; font-weight: 600; }
.upload { margin-top: 12px; }
.upload-picks { display: flex; gap: 8px; margin-bottom: 10px; }
.upload-picks label { position: relative; text-align: center; }
.upload-picks input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload .help { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.upload .help.error { color: var(--danger); }
/* 도구함 › PDF 합치기 — 고른 파일 목록 */
.merge-list { margin: 0 0 4px; padding-left: 22px; }
.merge-list li { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.merge-list .merge-name { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.merge-list .btn { flex: none; width: auto; padding: 4px 10px; }
/* 연속 합치기 (0.2.70) — 미리 확인 표, 빠질 줄은 위에 흐리게 빨강 */
.batch-buttons { display: flex; gap: 8px; margin-bottom: 10px; }
.batch-buttons .btn { flex: 1; }
.batch-progress { margin-bottom: 10px; }
.batch-progress progress { width: 100%; height: 12px; }
.batch-count { margin: 4px 0 8px; font-size: 14px; }
.batch-table { width: 100%; }
.perm-table.batch-table th, .perm-table.batch-table td { white-space: normal; padding: 8px; overflow-wrap: anywhere; font-size: 14px; }
.batch-table th:nth-child(2), .batch-table th:nth-child(3) { width: 3em; }
.batch-table .batch-skip td { color: var(--danger); }
.claim-period .btn { grid-column: 1 / -1; }
.claim-help, #claim-docs .help { font-size: 13px; color: var(--muted); }
.claim-fmt { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.claim-fmt label { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }   /* .field 공통 규칙 덮기 */
.claim-fmt input { width: auto; margin: 0; padding: 0; accent-color: var(--tail); }
/* 인원 내보내기 부서 고르기 (0.2.51) — 깊이만큼 들여쓰기, 손가락으로 누르기 좋게 44px */
.roster-orgs summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.roster-orgs summary small { color: var(--muted); font-weight: 400; }
.roster-org-list { max-height: 50vh; overflow-y: auto; }
.roster-org { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; margin: 0; }
.roster-org input { width: auto; margin: 0; padding: 0; accent-color: var(--tail); }
.roster-org.d1 { padding-left: 16px; } .roster-org.d2 { padding-left: 32px; } .roster-org.d3 { padding-left: 48px; }
.claim-docs { list-style: none; margin: 0 0 8px; padding: 0; }
.claim-docs label { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; }
.claim-docs small { color: var(--muted); font-size: 13px; white-space: nowrap; }
.claim-visit { margin-top: 10px; font-weight: 600; }
.claim-miss { font-size: 12px; font-weight: 400; color: var(--danger); margin-left: 4px; }   /* 확인용 표시 (막지 않음) */
.is-dropping::after {   /* 파일을 끌어 오면 화면 전체 점선 테두리 + 안내 */
  content: attr(data-drop);
  position: fixed; inset: 12px; z-index: 100;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px;
  border: 3px dashed var(--tail); border-radius: var(--radius-l);
  background: rgba(245, 247, 250, .92); color: var(--tail); font-weight: 700; font-size: 18px;
  pointer-events: none;
}

/* ── 인원 명단 ───────────────────────────────── */
.roster-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.roster-bar input:not([type=checkbox]) { flex: 1 1 160px; width: auto; min-width: 0; }   /* 입력칸 모양은 .field 와 같게, 좁으면 줄바꿈 */
.roster-all { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.roster-sub { display: block; }   /* 명단 한 사람 = 2줄 */
.page-title small { font-size: 15px; color: var(--muted); font-weight: 400; }
.roster-org { overflow-x: auto; margin-top: 8px; }   /* 칸이 넘치면 표 안에서만 옆으로 */
.roster-org table { width: 100%; border-collapse: collapse; font-size: 14px; }
.roster-org th, .roster-org td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.roster-org th:first-child, .roster-org td:first-child { text-align: left; }
.card-form > .help, .work-sum .help { font-size: 13px; color: var(--muted); margin: 6px 0 12px; }
.upload-list { margin: 8px 0 0; padding-left: 18px; font-size: 14px; overflow-wrap: anywhere; }   /* 엑셀 올리기 미리보기: 한 줄 목록 */
.upload-list li { margin: 4px 0; }
.inline-form { display: inline; margin-left: 6px; }   /* 인원 템플릿 줄 끝 [지우기] (0.2.52) */

/* ── 특허 ─────────────────────────────────────── */
.sheet-chips { display: flex; flex-wrap: wrap; gap: 6px; }   /* 시트 5개 — 줄바꿈, 옆 스크롤 없음 */
.sheet-chips a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 14px; text-decoration: none; }
.sheet-chips a[aria-current="page"] { border-color: var(--tail); color: var(--tail); font-weight: 600; }
.patent-row { flex-wrap: wrap; }   /* 딱지가 많으면 다음 줄로 — 좁은 폰에서 넘치지 않게 */
.patent-row .event-title { flex-basis: 12em; }
.pick { cursor: pointer; overflow-wrap: anywhere; }   /* 빠진 특허 찾기: 체크박스 + 여러 줄 글 */
.patent-pic { margin: 8px 0; text-align: center; font-size: 13px; color: var(--muted); }   /* 대표 그림 — 폰 폭을 넘지 않게 */
.patent-pic img { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); }
.pick input { flex: 0 0 auto; width: 20px; height: 20px; margin: 0 4px 0 0; accent-color: var(--tail); }

/* ── 서버 현황 (sysinfo) ─────────────────────────── */
.sys-grid { display: grid; gap: 8px; margin-top: 16px; }
.sys-card { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); overflow-wrap: anywhere; }
/* PC 현황 보고 (0.2.50) — 끊기면 흐리게 */
.sys-stale { opacity: .55; }
.sys-when, .sys-report-when { margin: 0; }
/* 🐳 도커 컨테이너 목록 (0.2.49) — 줄마다 점·이름·상태 */
.sys-list { list-style: none; margin: 4px 0 8px; padding: 0; }
.sys-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sys-list li:last-child { border-bottom: 0; }
.sys-list small { color: var(--muted); }
.sys-card h2 { margin: 0; font-size: 14px; font-weight: 400; color: var(--muted); }
.sys-card .help { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.sys-card meter { display: block; width: 100%; }
.sys-big { margin: 2px 0; font-size: 24px; font-weight: 700; }
.sys-pcs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 16px; }
.sys-pc { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 8px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); color: var(--ink); text-decoration: none; font-size: 14px; text-align: center; overflow-wrap: anywhere; }
.sys-pc[aria-current] { border-color: var(--tail); box-shadow: inset 0 -3px 0 var(--tail); font-weight: 700; }
.sys-pc-icon { font-size: 24px; line-height: 1.2; }
.sys-dot { box-sizing: border-box; width: 10px; height: 10px; border: 2px solid var(--muted); border-radius: 50%; overflow: hidden; font-size: 0; }
.sys-dot-on { border-color: var(--tail); background: var(--tail); }
.sys-wake-state { margin: 4px 0 8px; font-size: 17px; font-weight: 700; }
.sys-wake .btn { width: 100%; }
/* 원격 접속 — 칸 버튼 두 개(🪟 는 꺼짐이면 흐림, 설정 없으면 하나만 꽉 차게), 안내 페이지 복사 줄·접기 */
.sys-remote-btns { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; margin-top: 12px; }
.sys-wake .sys-remote-btns .btn { box-sizing: border-box; padding: 11px 6px; text-align: center; text-decoration: none; font-size: 15px; }
.sys-remote-soon { background: var(--bg); color: var(--muted); cursor: default; }
.sys-remote-soon small { display: block; font-size: 12px; font-weight: 400; }
.sys-remote p { margin: 4px 0; }
.sys-remote .btn { box-sizing: border-box; }
.sys-remote-off { border-color: var(--nucleus); }
.sys-remote-off p { font-weight: 700; margin-bottom: 8px; }
.sys-remote-open .btn { width: 100%; }
.sys-copy { display: flex; align-items: center; gap: 8px; }
.sys-copy code { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: anywhere; user-select: all; }
.sys-copy-btn { flex: none; padding: 6px 12px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); cursor: pointer; }
.sys-remote-how summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.sys-remote-how ol, .sys-remote-how ul { margin: 8px 0; padding-left: 20px; line-height: 1.6; }
.sys-wake-err { margin: 0 0 8px; color: var(--danger); font-size: 14px; }
.sys-wake-log { margin: 8px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.sys-warn, .sys-bad { font-size: 14px; }
.sys-warn { color: var(--nucleus); }
.sys-bad { color: var(--danger); }

/* ── AI 작업실 ───────────────────────────────── */
.ai-status { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 14px; font-size: 15px; overflow-wrap: anywhere; }
.ai-status::before, .ai-dot { content: ""; flex: none; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, #98A2B3); }
.ai-dot { margin-right: 6px; }
.ai-on, .ai-done { --dot: #2E9E4F; }
.ai-waking, .ai-loading, .ai-queued, .ai-running { --dot: var(--nucleus); }
.ai-noworker, .ai-off, .ai-down, .ai-error { --dot: var(--danger); }
/* 입력칸 — 채팅처럼 글칸 + 아래 줄(📎 ✦ … 보내기). JS 가 있으면(.is-js) 파일 칸은 안 보이게 두고 📎 로 연다 */
.ai-compose { scroll-margin-bottom: 80px; }
.ai-pick { display: block; margin-bottom: 8px; font-size: 14px; }
.ai-pick input { max-width: 100%; }
.is-js .ai-pick { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ai-compose:not(.is-js) .ai-tool { display: none; }
.ai-limits { display: block; margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.ai-chips li { display: flex; align-items: center; gap: 2px; max-width: 100%; padding: 2px 2px 2px 12px; font-size: 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.ai-chips span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chips button { flex: none; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; border-radius: 50%; }
.ai-warn { color: var(--danger); }
.ai-up { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 0 8px; font-size: 14px; }   /* 올리는 중 (0.2.41) */
.ai-up progress { flex: 1 1 100%; height: 8px; accent-color: var(--tail); }
.ai-up span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ai-about { margin: 0 0 8px; color: var(--muted); font-size: 14px; }   /* 에이전트 (0.2.29, 첫 화면 0.2.41) */
.ai-agent-head { margin: -4px 0 8px; color: var(--muted); font-size: 14px; }
.ai-agent-warn { margin: 0 0 8px; color: var(--danger); }
.ai-sure { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-weight: 600; }
/* 📚 조사 자료 고르기 (0.2.43) — 줄마다 체크 하나, 손가락으로 누르기 좋게 44px */
.ai-papers { margin: 0 0 8px; font-size: 14px; }
.ai-papers summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; }
.ai-papers summary small { color: var(--muted); }
/* ⏰ 정기 작업 (0.2.45) */
.ai-sched-link { margin: 0 0 8px; text-align: right; }
.ai-sched-link a { display: inline-flex; align-items: center; min-height: 44px; }
.ai-sched { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; overflow-wrap: anywhere; }
.ai-sched-off { opacity: .6; }
.ai-sched-head { margin: 0 0 4px; }
.ai-sched .ai-state-row { flex-wrap: wrap; }
.ai-days { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.ai-days label { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
/* 숨은 글자 확인 대기 (0.2.44) */
.ai-hold ul { margin: 6px 0; padding-left: 18px; font-size: 13px; overflow-wrap: anywhere; }
.ai-hold .ai-state-row { flex-wrap: wrap; }
.ai-paper { display: flex; align-items: center; gap: 8px; min-height: 44px; overflow-wrap: anywhere; }
.ai-state { overflow-wrap: anywhere; }
.ai-presets { margin: 0 0 8px; }
.ai-box { padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); }
.ai-box:focus-within { border-color: var(--tail); }
.ai-box textarea { display: block; width: 100%; min-height: 44px; max-height: 40vh; padding: 8px; font: inherit; border: 0; background: none; resize: none; outline: none; field-sizing: content; }
.ai-bar { display: flex; align-items: center; gap: 4px; }
.ai-tool { width: 40px; height: 40px; font-size: 18px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; }
.ai-tool:hover, .ai-tool[aria-expanded="true"] { background: var(--bg); color: var(--tail); }
.ai-bar .btn { width: auto; margin-left: auto; padding: 10px 18px; }
.ai-presets button { padding: 7px 12px; font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.ai-text { white-space: pre-wrap; }
.ai-state { font-weight: 600; }
.ai-result {   /* 처리 중은 글자 그대로, 끝난 답은 마크다운(.ai-md). 안쪽 스크롤 없음 — 화면 전체가 스크롤 */
  margin: 0 0 12px; padding: 12px 14px;
  white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 15px; line-height: 1.6;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
}
.ai-result:empty, .ai-result:not(:empty) + .help { display: none; }
/* 마크다운 답: 제목은 작게, 넓은 표·긴 코드 줄은 그 칸만 옆으로 밀어 봄 (375px 에서 화면이 옆으로 안 밀리게) */
.ai-md { white-space: normal; }
.ai-md > :first-child { margin-top: 0; }
.ai-md > :last-child { margin-bottom: 0; }
.ai-md p, .ai-md ul, .ai-md ol, .ai-md blockquote, .ai-md table, .ai-md .ai-code { margin: 0 0 10px; }
.ai-md h1, .ai-md h2, .ai-md h3, .ai-md h4, .ai-md h5, .ai-md h6 { margin: 14px 0 6px; font-size: 16px; line-height: 1.4; }
.ai-md h1, .ai-md h2 { font-size: 17px; }
.ai-md ul, .ai-md ol { padding-left: 22px; }
.ai-md blockquote { padding-left: 12px; color: var(--muted); border-left: 3px solid var(--line); }
.ai-md hr { margin: 12px 0; border: 0; border-top: 1px solid var(--line); }
.ai-md code { padding: 1px 4px; font-size: 13px; background: var(--bg); border-radius: 4px; }
.ai-md table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.ai-md th, .ai-md td { padding: 4px 8px; border: 1px solid var(--line); overflow-wrap: normal; }
.ai-md th { background: var(--bg); }
.ai-md .al-left { text-align: left; }
.ai-md .al-center { text-align: center; }
.ai-md .al-right { text-align: right; }
.ai-host { color: var(--muted); font-size: 12px; }
.ai-code { border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--bg); }
.ai-code-bar { display: flex; align-items: center; justify-content: space-between; min-height: 30px; padding: 0 4px 0 10px; color: var(--muted); font-size: 12px; }
.ai-code-bar:has(span:empty):not(:has(button)) { display: none; }
.ai-code-bar button { padding: 4px 8px; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; border-radius: 6px; }
.ai-code-bar button:hover { background: var(--surface); color: var(--ink); }
.ai-code pre { margin: 0; padding: 8px 10px 10px; overflow-x: auto; white-space: pre; font-size: 13px; line-height: 1.5; }
.ai-code pre code { padding: 0; background: none; }
.ai-state-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 10px; }
.ai-state-row .ai-state, .ai-state-row .notice { margin: 0; }
.ai-notes { margin: 0 0 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ai-notes summary { cursor: pointer; }
.ai-notes ul { margin: 4px 0 0; padding-left: 18px; }
.ai-filebox { margin: 6px 0; white-space: normal; }   /* 결과 속 파일 = 작은 조각(받기) + 내용 접힘 */
.ai-filebox > a { display: inline-block; max-width: 100%; padding: 4px 10px; font-size: 14px; text-decoration: none; overflow-wrap: anywhere;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg); }
.ai-filebox summary { margin-top: 2px; color: var(--muted); font-size: 13px; cursor: pointer; }
/* 끝난 답 아래 도구 줄: [복사] [⋯]. PC 는 평소 흐리게 → 답에 올리거나 포커스면 또렷하게, 폰은 늘 보임 */
.ai-tools { display: flex; align-items: center; gap: 2px; margin: -4px 0 -6px -6px; }
.ai-tools button, .ai-menu summary { border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.ai-icon, .ai-menu summary { min-width: 36px; height: 36px; padding: 0 8px; font-size: 16px; line-height: 36px; text-align: center; border-radius: 8px; }
.ai-menu summary { list-style: none; font-size: 20px; }
.ai-menu summary::-webkit-details-marker { display: none; }
.ai-icon:hover, .ai-menu summary:hover, .ai-menu[open] summary { background: var(--bg); color: var(--ink); }
:root:not(.can-copy) .ai-copy { display: none; }
.ai-menu { position: relative; }
.ai-menu-list { position: absolute; left: 0; top: 100%; z-index: 5; min-width: 180px; max-width: calc(100vw - 48px); padding: 4px 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 4px 16px rgba(0, 0, 0, .12); }
.ai-menu.up .ai-menu-list { top: auto; bottom: 100%; }   /* 아래 공간이 모자라면 위로 (ai.js) */
.ai-menu-list a, .ai-menu-list button { display: block; width: 100%; padding: 10px 14px; text-align: left; font-size: 15px; color: var(--ink); text-decoration: none; }
.ai-menu-list .btn-text-danger { color: var(--danger); }
.ai-menu-list a:hover, .ai-menu-list button:hover { background: var(--bg); }
.ai-menu-list form { margin: 0; }
.ai-menu-list small { display: block; padding: 6px 14px 8px; color: var(--muted); font-size: 12px; }
@media (hover: hover) {
  .ai-tools { opacity: .35; transition: opacity .15s; }
  .ai-bot:hover .ai-tools, .ai-bot:focus-within .ai-tools, .ai-tools:has(.ai-menu[open]) { opacity: 1; }
}
.ai-filebox pre { max-height: 40vh; overflow: auto; margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
/* AI 대화 — 내 질문 오른쪽(연한 색) · AI 답 왼쪽(흰 카드). 폭 최대 92% 라 320px 에서도 글자 칸이 남음 */
.ai-new { margin: 0 0 8px; font-size: 17px; }
.ai-title { overflow-wrap: anywhere; }
.ai-rename { margin: -6px 0 12px; font-size: 14px; }
.ai-rename summary { color: var(--muted); cursor: pointer; }
.ai-rename form { display: flex; gap: 8px; margin-top: 8px; }
.ai-rename input { flex: 1; min-width: 0; }
.ai-chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.ai-turn { display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 12px; }
.ai-bubble { max-width: 92%; min-width: 0; padding: 10px 14px; border-radius: var(--radius-l); overflow-wrap: anywhere; }
.ai-me { align-self: flex-end; background: #E8EEF8; }
.ai-me .ai-attach { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.ai-bot { align-self: flex-start; width: 92%; background: var(--surface); border: 1px solid var(--line); }
.ai-thread-delete { margin: 12px 0 0; text-align: right; }

/* AI 대화: 답이 길어도 [← AI 작업실] 이 화면 위에 붙어 있게 */
.ai-back { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); padding: 8px 12px 8px 0; margin-top: 0; }

/* AI 대화 목록: 들어가지 않고 바로 지우기 (처리 중인 대화는 버튼 없음) */
.ai-thread-row { display: flex; align-items: center; }
.ai-thread-row .event-body { flex: 1; min-width: 0; }
.ai-row-delete { border: 0; background: none; color: var(--muted); font: inherit; font-size: 15px; width: 44px; height: 44px; cursor: pointer; }
.ai-row-delete:hover, .ai-row-delete:focus-visible { color: var(--danger); }
.has-env .ai-back { top: var(--env-h); }   /* 테스트 서버 노란 띠(top 0) 바로 아래에 */

/* ── 사진 (0.2.73) ── */
.photo-upload { margin-bottom: 14px; }
.photo-cal .photo-day { position: relative; height: 64px; }
.photo-day-thumb { width: 34px; height: 30px; object-fit: cover; border-radius: 6px; }
.photo-day-count { position: absolute; right: 2px; bottom: 2px; font-size: 11px; font-weight: 700; color: var(--surface);
  background: rgba(27, 34, 48, .7); border-radius: 8px; padding: 0 5px; line-height: 16px; }
@media (min-width: 768px) {
  .photo-cal .photo-day { height: 84px; }
  .photo-day-thumb { width: 56px; height: 46px; }
}
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
@media (min-width: 768px) { .photo-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.photo-tile { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-s); background: var(--line); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-shared { position: absolute; left: 4px; bottom: 4px; font-size: 11px; color: var(--surface);
  background: rgba(27, 34, 48, .7); border-radius: 6px; padding: 1px 5px; }
.photo-sub { font-size: 15px; margin: 18px 0 6px; }
.photo-linked { color: var(--tail); font-size: 12px; margin-left: 6px; }
.photo-view { margin: 0 0 12px; }
.photo-view img { display: block; width: 100%; max-height: 70vh; object-fit: contain; background: var(--ink); border-radius: var(--radius-l); }
.photo-view figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; }
.photo-map { height: 65vh; min-height: 320px; border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); }
.photo-pick-map { height: 260px; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); margin-bottom: 6px; }
.photo-latlng { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-pin img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35); display: block; }
.photo-cluster { display: grid !important; place-items: center; border-radius: 50%; background: var(--tail); color: var(--surface);
  font-weight: 700; font-size: 14px; border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.photo-pop { display: grid; grid-template-columns: repeat(3, 64px); gap: 4px; max-height: 220px; overflow-y: auto; }
.photo-pop img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; display: block; }
.photo-row { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.photo-row a { flex: 0 0 72px; }
.photo-row img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; }

/* ── 육아일기 (0.2.74) ── */
.diary-text { line-height: 1.75; margin: 8px 0; word-break: keep-all; overflow-wrap: anywhere; }
.diary-snip { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.diary-thumbs { display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.diary-thumbs img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; background: var(--line, #e4e7ec); }
.diary-thumbs small { color: var(--muted); font-size: 12px; margin-left: 2px; }   /* 📷 0.3.3 목록 사진 */
.diary-note summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.diary-list .event-title { min-width: 0; }
.photo-mark span { display: block; width: 30px; height: 30px; margin-top: 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--danger); border: 3px solid var(--surface); box-shadow: 0 2px 5px rgba(0, 0, 0, .4); }
.photo-mark span::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px;
  border-radius: 50%; background: var(--surface); }
.photo-search { display: flex; gap: 6px; margin-bottom: 6px; }
.photo-search input { flex: 1; min-width: 0; }
.photo-places { list-style: none; margin: 0 0 6px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.photo-places li { border-top: 1px solid var(--line); padding: 0; }
.photo-places li:first-child { border-top: 0; }
.photo-places li:not(:has(button)) { padding: 10px 12px; color: var(--muted); font-size: 14px; }
.photo-place { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 12px; font: inherit; color: inherit; cursor: pointer; }
.photo-place small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ── 오늘 대시보드 (0.2.75) ── */
.dash-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 10px; }
@media (min-width: 768px) { .dash-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.dash-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); color: inherit; text-decoration: none; }
.dash-tile b { font-size: 26px; line-height: 1.1; color: var(--tail); }
.dash-tile span { font-size: 13px; color: var(--muted); }
.dash-tile.is-warn b { color: var(--danger); }
.dash-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (min-width: 900px) { .dash-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.dash-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-l); color: inherit; text-decoration: none; min-width: 0; }
.dash-card.is-warn { border-color: var(--danger-line); background: var(--danger-bg); }
.dash-icon { flex: none; color: var(--tail); }
.dash-text { display: flex; flex-direction: column; min-width: 0; }
.dash-text b { font-size: 14px; }
.dash-text span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.m-person { fill: #E8A317; }
.m-event { fill: var(--tail); }
.m-photo { fill: #2E86AB; }
.m-diary { fill: #D96C9C; }
.m-visit { fill: #8E5BC2; }
.g-today { fill: var(--danger); font-weight: 700; }

/* ── PDF 편집 (0.2.76) ── */
.edit-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 8px; font-size: 14px; color: var(--muted); }
.edit-bar span { flex: 1 1 100%; }
.edit-pages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.edit-page { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-s); min-width: 0; }
.edit-page.is-pick { border-color: var(--tail); }
.edit-page.is-out { opacity: .35; }
.edit-pic { width: 100%; aspect-ratio: 3 / 4; display: grid; place-items: center; background: var(--bg); border: 0; padding: 4px;
  border-radius: 6px; cursor: pointer; font: inherit; color: var(--muted); overflow: hidden; }
.edit-pic img { max-width: 100%; max-height: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
.edit-cap { font-size: 12px; color: var(--muted); text-align: center; }
.edit-tools { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.edit-tools .btn { padding: 2px 8px; min-height: 30px; }
.edit-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.edit-inline { display: inline-flex; gap: 6px; align-items: center; margin: 6px 0; font-size: 14px; }
.edit-inline input { width: 80px; }
.edit-size { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin: 10px 0 2px; }   /* 0.3.49 용량 단계 + 목표 */
.edit-size-label { font-size: 14px; font-weight: 600; }
.edit-more { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.edit-more summary { cursor: pointer; font-weight: 600; }
.edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 8px; font-size: 14px; }
.edit-grid label { display: flex; flex-direction: column; gap: 4px; }
.edit-grid .edit-wide { grid-column: 1 / -1; }
.edit-grip { cursor: grab; touch-action: none; }
.edit-page.is-drag { opacity: .6; border-style: dashed; border-color: var(--tail); }
@media (max-width: 899px) { .edit-step { display: none; } }   /* 폰은 끌기로 (PC 는 키보드용 ←→ 도) */
.writer { position: fixed; inset: 0; z-index: 60; background: rgba(27, 34, 48, .55); display: flex; align-items: flex-start; justify-content: center;
  padding: 12px; overflow-y: auto; }
.writer[hidden] { display: none; }
.writer-box { width: min(760px, 100%); background: var(--surface); border-radius: var(--radius-l); padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.writer-head { display: flex; justify-content: space-between; align-items: center; }
.writer .cat-chip[aria-pressed="true"] { border-color: var(--tail); background: var(--tail); color: var(--surface); }
.writer-size { width: 72px; flex: none; }
.writer-stage { width: 100%; }
.writer-stage canvas { display: block; max-width: 100%; border: 1px solid var(--line); touch-action: none; cursor: crosshair; }
.writer-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.writer-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.photo-search .writer-size { flex: none; width: 72px; }
@media (max-width: 899px) { .card-form .edit-tools .edit-step { display: none; } }   /* 폰은 끌기로 — 폼 안 .btn 보다 우선 */
.edit-page { padding: 10px; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }   /* 테두리를 잡고 끌기 (0.2.76) */

/* ── 오늘 화면 꾸미기 (0.2.77) ── */
.dash-edit-link { text-align: center; margin: 18px 0 6px; font-size: 14px; color: var(--muted); }
.dash-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-s); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dash-row.is-drag { opacity: .6; border-style: dashed; border-color: var(--tail); }
.dash-grip { font-size: 18px; color: var(--muted); padding: 2px 6px; touch-action: none; }
.dash-name { flex: 1; min-width: 0; }
.dash-row:has(input[type=checkbox]:not(:checked)) .dash-name { color: var(--muted); text-decoration: line-through; }
.dash-switch { position: relative; flex: none; width: 46px; height: 28px; cursor: pointer; }
.dash-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dash-switch span { position: absolute; inset: 0; border-radius: 14px; background: var(--line); transition: background .15s; pointer-events: none; }
.dash-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s; }
.dash-switch input:checked + span { background: var(--tail); }
.dash-switch input:checked + span::after { transform: translateX(18px); }
.dash-switch input:focus-visible + span { outline: 2px solid var(--tail); outline-offset: 2px; }
.dash-edit-bar { display: flex; gap: 8px; margin: 14px 0; }

/* ── 한글 → PDF (0.2.79) ── */
.hwp-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.hwp-card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: var(--surface); }
.hwp-card.is-bad { border-color: var(--danger-line); background: var(--danger-bg); }
.hwp-card.is-bad .help { color: var(--danger); }
.hwp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.hwp-head b { overflow-wrap: anywhere; }
.hwp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hwp-pages { margin-top: 8px; }
.hwp-pages summary { cursor: pointer; color: var(--muted); }
.hwp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 8px; }
.hwp-page { margin: 0; text-align: center; }
.hwp-page img { width: 100%; height: auto; border: 1px solid var(--line); background: #fff; }
.hwp-page figcaption { font-size: .8rem; color: var(--muted); }
/* 📱 앱 받기 (0.2.84) */
.sha { word-break: break-all; font-size: 12px; }
.steps { padding-left: 20px; } .steps li { margin: 6px 0; }
/* 📱 내 기기 (0.2.85) */
.device { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; }
.device-head small { display: block; color: var(--muted); }
.device-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
/* 📍 근거 기록 (0.2.87) */
.tag-edited { background: #FFF4E5; color: #B54708; }
.notice-ok { background: #E6F4EA; color: #1E6B37; border-radius: var(--radius-s); padding: 10px 12px; }
.ev-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; }
.ev-line { font-size: 13px; word-break: break-all; }
.ev-meta { color: var(--muted); font-size: 12px; }
.evidence-period .btn { margin-right: 6px; }
/* AI 작업실 여러 개 지우기 (0.2.89) */
.ai-bulk { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface, #fff); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; margin-bottom: 8px; }
.ai-bulk[hidden] { display: none; }
.ai-bulk-count { font-weight: 600; flex: 1; }
.ai-bulk-help { margin: 0 0 6px; }
.ai-thread-row.is-picked { background: color-mix(in srgb, var(--tail) 14%, transparent); outline: 2px solid var(--tail); outline-offset: -2px; }
.ai-thread-list.is-picking .ai-thread-row { user-select: none; -webkit-user-select: none; }
.ai-thread-list.is-picking .ai-thread-row[data-busy] { opacity: .55; }
.ai-bulk .btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }

/* 사진 날짜 바꾸기 (0.2.91) — 올린 직후 확인 · 육아일기 화면 */
.photo-review { margin: 10px 0; padding: 10px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.photo-review-head { margin: 0 0 8px; font-weight: 600; }
.redate-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-bottom: 10px; }
.redate-item { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 6px; }
.redate-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.redate-item input { width: 100%; min-width: 0; }
.redate-odd { outline: 2px solid var(--danger, #d33); }

/* PDF 합치기 표지·본문 칸 (0.2.92) */
.merge-part { margin-bottom: 8px; }
.merge-part-label { display: block; font-weight: 600; margin-bottom: 4px; }
.merge-part .help { margin-top: 4px; }
.diary-pick { margin-right: 6px; }
.btn.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.diary-list .event { align-items: center; }

/* 📹 동영상 (0.2.95) — 작은 그림 위 ▶ 표시, 상세 재생 */
.is-video { position: relative; display: block; }
.is-video::after { content: "▶"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 28px; height: 28px; line-height: 28px; text-align: center; font-size: 13px; color: #fff;
  background: rgba(0, 0, 0, .55); border-radius: 50%; pointer-events: none; }
.photo-video { width: 100%; max-height: 80vh; background: #000; border-radius: 8px; display: block; }

/* 📝 메모 (0.2.97) */
.note-quick { display: grid; gap: 6px; }
.note-quick input, .note-quick textarea, .note-search input { width: 100%; }
.note-search { margin: 10px 0 6px; }
.note-tags { margin-bottom: 8px; }
.note-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0 10px; flex-wrap: wrap; }
.note-bar-right { display: flex; gap: 6px; }
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.note-card { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); min-width: 0; display: flex; flex-direction: column; }
.note-link { color: inherit; text-decoration: none; display: block; min-width: 0; flex: 1; }
.note-title { font-size: 15px; margin: 0 0 4px; overflow-wrap: anywhere; }
.note-snip { font-size: 13px; max-height: 9em; overflow: hidden; overflow-wrap: anywhere; }
.note-snip p, .note-snip ul, .note-snip ol { margin: 0 0 4px; }
.note-foot { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 12px; color: var(--muted, #667); margin-top: 6px; }
.note-time { margin-left: auto; }
.note-pick { position: absolute; top: 8px; right: 8px; }
.note-pin { float: right; margin-right: 18px; }
.note-rows { grid-template-columns: 1fr; }
.note-rows .note-snip { max-height: 3em; }
.note-full { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; overflow-wrap: anywhere; }
.note-body ul { padding-left: 1.2em; }
.task-box { border: 0; background: none; font-size: 18px; line-height: 1; padding: 0 4px 0 0; cursor: pointer; color: inherit; }
.task-box:disabled { cursor: default; }
.note-tabs { display: flex; gap: 6px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.note-preview { border: 1px dashed var(--line); border-radius: 8px; padding: 10px; min-height: 8em; }
.note-c-yellow { background: #FFF7D1; } .note-c-green { background: #E3F6E5; } .note-c-blue { background: #E2EEFF; }
.note-c-pink { background: #FDE7EF; } .note-c-purple { background: #EFE6FB; } .note-c-gray { background: #EEF0F3; }


/* 📁 자료 보관함 (0.2.98) */
.lib-crumbs { margin: 4px 0 8px; font-size: 14px; overflow-wrap: anywhere; }
.lib-up { margin-bottom: 8px; }
.lib-up progress { width: 100%; }
.lib-newfolder { display: flex; gap: 6px; margin-bottom: 8px; }
.lib-newfolder input { flex: 1; min-width: 0; }
.lib-list { list-style: none; padding: 0; margin: 0 0 10px; }
.lib-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 6px 0; }
.lib-row a { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; flex: 1; flex-wrap: wrap; }
.lib-icon { font-size: 22px; width: 40px; text-align: center; flex: 0 0 40px; }
.lib-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; flex: 0 0 40px; }
.lib-name { overflow-wrap: anywhere; min-width: 0; flex: 1; }
.lib-meta { color: var(--muted); font-size: 12px; }
.lib-sep { padding: 10px 0 4px; font-weight: 600; color: var(--muted); }
.lib-many { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lib-many select { max-width: 100%; }
.lib-title { overflow-wrap: anywhere; }
.lib-preview img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }

/* 👶 육아일기 스킨·출력 (0.2.100) */
.diary-tools { align-items: center; margin-bottom: 8px; }
.skin-form select { max-width: 100%; }
.diary-paper .section { margin-top: 10px; }
.diary-paper .diary-text { background: transparent; }
.diary-range { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.diary-range input[type=date] { min-width: 0; }

/* 💰 급여 (0.2.101) */
.pay-up-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-up-row input { flex: 1; min-width: 120px; }
.pay-years { margin: 10px 0; }
.pay-chart { width: 100%; max-width: 640px; height: auto; display: block; }
.pay-bar { fill: #9ED3CF; } .pay-line { fill: none; stroke: var(--tail); stroke-width: 2; } .pay-dot { fill: var(--tail); }
.pay-axis { font-size: 9px; fill: var(--muted); }
.pay-table td, .pay-table th { text-align: right; white-space: nowrap; }
.pay-table td:first-child, .pay-table th:first-child { text-align: left; }
.pay-split { display: grid; gap: 12px; }
@media (min-width: 900px) { .pay-split { grid-template-columns: 1fr 1fr; align-items: start; } }
.pay-orig img { width: 100%; display: block; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; }
.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pay-grid label, .pay-form > label { display: flex; flex-direction: column; font-size: 13px; gap: 3px; }
.pay-rows { display: grid; gap: 4px; margin-bottom: 6px; }
.pay-row { display: grid; grid-template-columns: 1fr 9em; gap: 4px; }
.pay-row input { min-width: 0; }
.pay-totals { margin-top: 10px; }
.pay-get { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* 📊 환율 보고서 (0.2.102) */
.fx-report-card { display: block; border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; margin: 8px 0 4px;
  background: var(--surface); color: inherit; text-decoration: none; }
.fx-movers { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.fx-spark { width: 120px; height: 32px; display: block; }
.fx-spark polyline { fill: none; stroke: var(--tail); stroke-width: 1.6; }
.fx-rep td, .fx-rep th { white-space: nowrap; }
.fx-rep .up { color: var(--danger); } .fx-rep .down { color: #1E5FB4; }
.kn-diag { font-size: 11px; max-height: 50vh; overflow: auto; background: var(--bg); padding: 8px; border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ✨ AI 결과 모음 (0.2.105) */
.ai-star-form { display: inline; }
.ai-star { color: var(--nucleus); }
.ai-col-row { flex-wrap: wrap; }
.ai-col-lib { display: flex; gap: 4px; flex-wrap: wrap; }
.ai-col-lib select { max-width: 12em; }
.ai-col-star { list-style: none; border-bottom: 1px solid var(--line); padding: 10px 0; }
.ai-col-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }

/* 🕸 연결 지도 (0.2.107) — force-graph 가 넣으려는 스타일은 CSP 가 막아서 여기에 */
.brain { position: relative; height: min(70vh, 640px); border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: #FAFBFC; touch-action: none; }
.brain-mini { height: 280px; }
.brain canvas { display: block; user-select: none; outline: none; -webkit-tap-highlight-color: transparent; }
.brain-wait { position: absolute; left: 12px; top: 8px; margin: 0; }
.brain-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); overflow-wrap: anywhere; }
.brain-pick[hidden] { display: none; }
.brain-bar { margin-bottom: 8px; }
.brain-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.brain-row input[type=search] { flex: 1; min-width: 120px; }
.brain-kind span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: 1px; background: var(--k, #888); }
.k-person { --k: #E8A317; } .k-event { --k: #2F6FDB; } .k-photo { --k: #2BA36A; } .k-diary { --k: #E06C9F; } .k-health { --k: #D9534F; }
.k-memo { --k: #0B7A75; } .k-doc { --k: #8A6DD8; } .k-tag { --k: #9AA3B2; } .k-todo { --k: #5E6878; }
.wikilink { color: var(--tail); text-decoration: none; border-bottom: 1px dashed var(--tail); }
.wiki-pick { list-style: none; margin: -4px 0 8px; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.wiki-pick[hidden] { display: none; }
.wiki-pick button { border: 0; background: none; padding: 6px 8px; width: 100%; text-align: left; font: inherit; cursor: pointer; }
.wiki-pick button:hover { background: var(--bg); }

/* 🌱 식물 (0.3.1) */
.plant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.plant-card { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); color: inherit; text-decoration: none; min-width: 0; }
.plant-card img, .plant-noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 40px; background: #EEF5EC; }
.plant-code { font-weight: 700; font-size: 13px; color: var(--tail); }
.plant-name { overflow-wrap: anywhere; }
.plant-card small { color: var(--muted); font-size: 12px; }
.plant-search { display: flex; gap: 6px; flex: 1; margin: 0; }
.plant-log-add { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.plant-log-add input[name=text] { flex: 1; min-width: 140px; }
.plant-logs { list-style: none; padding: 0; margin: 0; }
.plant-logs li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.plant-log-date { color: var(--muted); font-size: 13px; min-width: 6.5em; }
.plant-log-img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; }
.plant-log-del { margin-left: auto; }
.ai-sug { display: block; padding: 4px 0; overflow-wrap: anywhere; }
.k-plant { --k: #3E9B4F; } .k-species { --k: #A3C76D; }
.plant-bar .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.plant-bar .seg button { border: 0; background: var(--surface); padding: 6px 12px; font: inherit; cursor: pointer; }
.plant-bar .seg button.on { background: var(--tail); color: #fff; }
.plant-legend .st { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 2px 0 8px; }
.st-ok { background: #3E9B4F; } .st-watch { background: #E8A317; } .st-sick { background: #D9534F; } .st-dormant { background: #7C8AA0; } .st-sold { background: #8A6DD8; } .st-dead { background: #B9BEC7; }
.k-cross { --k: #C2410C; }

/* 🖥 PC 오늘 화면 (0.3.2) — 900px 넘으면 넓게(최대 1400px) 2~3단, PC 전용 묶음은 폰에서 숨김 */
.pc-only { display: none; }
@media (min-width: 900px) {
  .main-wide { max-width: 1400px; }
  .today-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 0 24px; align-items: start; }
  .today-part.pc-only { display: block; }
  .today-part.p-tiles, .today-part.p-cards, .today-part.p-week, .today-part.p-linkmap, .today-part.p-pc_recent { grid-column: 1 / -1; }
  .today-part.p-linkmap .brain-mini { height: 460px; }
  .today-part:not(:has(*)) { display: none; }
}
.pc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 10px; }
.pc-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.pc-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.pc-two h3 { font-size: 15px; margin: 0 0 6px; }
.pc-list { list-style: none; padding: 0; margin: 0; }
.pc-list li { padding: 5px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.pc-list small { color: var(--muted); }
.pc-list .up { color: var(--danger); } .pc-list .down { color: #1E5FB4; }
/* 💸 0.3.4 판매 */
.sales-tabs { flex-wrap: wrap; margin: 8px 0 12px; }
.sales-tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: inherit; font-size: 14px; }
.sales-tabs a[aria-current="page"] { border-color: var(--tail); color: var(--tail); font-weight: 600; }
.sale-line { display: grid; grid-template-columns: 1fr; gap: 6px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 0 0 10px; }
.sale-line label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.sale-line label.check { flex-direction: row; align-items: center; gap: 6px; }
@media (min-width: 700px) { .sale-line { grid-template-columns: 2fr 1.5fr .6fr 1fr; } }
.sale-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sale-table th, .sale-table td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sale-table th:first-child, .sale-table td:first-child { text-align: left; }
.lib-row.is-muted, .sale-table tr.is-muted { opacity: .55; }
.sale-draft textarea { width: 100%; min-height: 160px; }
/* 👶 0.3.11 누구의 병원 기록 */
.who-tag { display: inline-block; padding: 0 6px; margin-right: 2px; border-radius: 999px; background: var(--tail-soft, #e6f4f3); color: var(--tail); font-size: 12px; font-weight: 600; }
/* 💰 0.3.12 가계부 */
.budget-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.budget-sum > div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.budget-sum b { font-size: 18px; }
.budget-sum small { color: var(--muted); font-size: 12px; }
.is-minus b, td.is-minus { color: var(--danger, #b42318); }
.budget-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.budget-amount { display: flex; gap: 4px; align-items: center; }
.budget-amount input { width: 9em; }
.budget-account h3 { margin: 12px 0 4px; font-size: 16px; }
.budget-flow { list-style: none; padding: 0; margin: 0; }
.budget-flow li { display: grid; grid-template-columns: 4em 1fr auto; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.budget-flow li.in .a { color: var(--tail); }
.budget-flow li.is-muted { opacity: .55; }
.budget-flow .d { color: var(--muted); }
.inline-form { display: inline; }
/* 📊 0.3.14 가계부 분석·출력 — 수입 = 차트 1번 색(파랑), 지출 = 2번 색(주황) */
.viz-root { --viz-in: #2a78d6; --viz-out: #eb6834; --viz-grid: #e4e7ec; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .viz-root { --viz-in: #3987e5; --viz-out: #d95926; --viz-grid: #3a3a38; } }
:root[data-theme="dark"] .viz-root { --viz-in: #3987e5; --viz-out: #d95926; --viz-grid: #3a3a38; }
.budget-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.budget-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .budget-grid { grid-template-columns: 1fr 1fr; } }
.hbar { display: grid; grid-template-columns: minmax(6em, 9em) 1fr auto; gap: 8px; align-items: center; padding: 3px 0; font-size: 14px; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { width: 100%; height: 12px; }
.hbar-fill.in { fill: var(--viz-in); } .hbar-fill.out { fill: var(--viz-out); }
.hbar-val { font-variant-numeric: tabular-nums; text-align: right; } .hbar-val small { color: var(--muted); }
.vbars { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; height: 140px; margin: 8px 0; border-bottom: 1px solid var(--viz-grid); }
.vbar { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.vbar-cols { width: 100%; height: 120px; }
.vbar-col.in { fill: var(--viz-in); } .vbar-col.out { fill: var(--viz-out); }
.vbar small { font-size: 11px; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 2px 0 8px; vertical-align: middle; }
.key.in { background: var(--viz-in); } .key.out { background: var(--viz-out); }
.bal-fig { margin: 0; } .bal-fig figcaption { font-size: 14px; margin-bottom: 4px; }
.bal-fig svg { width: 100%; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.bal-line { fill: none; stroke: var(--viz-in); stroke-width: 2; } .bal-zero { stroke: var(--viz-grid); stroke-dasharray: 3 3; }
.bal-dot { fill: var(--viz-in); stroke: var(--surface, #fff); stroke-width: 2; }
.is-minus-text { color: var(--danger, #b42318); }
.budget-edit summary { cursor: pointer; list-style: none; } .budget-edit summary::-webkit-details-marker { display: none; }
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  header, nav, .no-print, .bottom-bar, .side-nav, .subtabs, .messages { display: none !important; }
  .print-only { display: block; }
  body, .budget-print { background: #fff !important; color: #000; font-size: 11px; }
  .budget-print .section { break-inside: avoid; margin: 6px 0; }
  .budget-grid { grid-template-columns: 1fr 1fr; }
  .viz-root { --viz-in: #2a78d6; --viz-out: #eb6834; }
}
/* ✏️ 0.3.16 가계부 줄마다 수정 */
.budget-flow.with-edit li { grid-template-columns: 3.5em 1fr auto auto; align-items: center; }
.flow-edit { grid-column: 4; justify-self: end; }
.flow-edit summary { list-style: none; cursor: pointer; padding: 2px 10px; font-size: 13px; }
.flow-edit summary::-webkit-details-marker { display: none; }
.flow-edit[open] { grid-column: 1 / -1; justify-self: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin: 4px 0; }
.flow-edit[open] summary { display: inline-block; margin-bottom: 6px; }
.flow-edit-form { flex-wrap: wrap; } .flow-edit-form input { width: 9em; } .flow-edit-form .flow-day { width: 4em; }
/* 💸 0.3.17 자금 연결 — 수입 파랑(1번), 지출 주황(2번), 남는 돈 청록(3번), 계좌 회색, 모자람 빨강 */
.viz-root { --viz-left: #1baf7a; --viz-short: #e34948; --viz-acc: #98a2b3; }
@media (prefers-color-scheme: dark) { :root:where(:not([data-theme="light"])) .viz-root { --viz-left: #199e70; --viz-short: #e66767; --viz-acc: #8b8f97; } }
:root[data-theme="dark"] .viz-root { --viz-left: #199e70; --viz-short: #e66767; --viz-acc: #8b8f97; }
.flow-wrap { overflow-x: auto; }
.money-flow { width: 100%; min-width: 640px; height: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.mf-link { fill: none; stroke-opacity: .32; } .mf-link:hover { stroke-opacity: .6; }
.mf-link.in { stroke: var(--viz-in); } .mf-link.out { stroke: var(--viz-out); } .mf-link.left { stroke: var(--viz-left); } .mf-link.short { stroke: var(--viz-short); }
.mf-node.in { fill: var(--viz-in); } .mf-node.out { fill: var(--viz-out); } .mf-node.left { fill: var(--viz-left); }
.mf-node.short { fill: var(--viz-short); } .mf-node.acc { fill: var(--viz-acc); }
.mf-label { font-size: 12px; fill: var(--text, #1d2939); paint-order: stroke; stroke: var(--surface, #fff); stroke-width: 3px; }
@media print { .money-flow { min-width: 0; } }
.plant-log-old { color: var(--muted); }   /* ✂️ 나누기 전 물려받은 기록 (0.3.21) */

/* 🧭 GGE Compass (0.3.24) — 꼬리별 메뉴는 그대로, 본문 자리를 페이지 창이 꽉 채움 */
.main.main-frame { max-width: none; padding: 0; }
.gge-frame { display: block; width: 100%; border: 0; height: calc(100vh - var(--env-h) - var(--nav-h) - var(--safe-b)); height: calc(100dvh - var(--env-h) - var(--nav-h) - var(--safe-b)); }
@media (min-width: 900px) {
  .gge-frame { height: calc(100vh - var(--env-h)); height: calc(100dvh - var(--env-h)); }
}

/* 🏢 AI 사무실 (0.3.30) — 왼쪽 층 · 가운데 건물 · 오른쪽 지시하기. 폰에서는 위에서 아래로 */
.office { display: grid; gap: 14px; grid-template-columns: 1fr; }
.office-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.office-head .page-title { margin: 0; }
.office-floors { display: flex; gap: 8px; overflow-x: auto; }
.office-floors button { display: grid; gap: 2px; min-width: 72px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-l);
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: center; }
.office-floors button b { font-size: 18px; }
.office-floors button small { color: var(--muted); font-size: 11px; }
.office-floors button[aria-pressed="true"] { border: 2px solid var(--nucleus); background: #FFF8EB; }
.office[data-floor="3"] .office-floor:not([data-floor="3"]),
.office[data-floor="2"] .office-floor:not([data-floor="2"]),
.office[data-floor="1"] .office-floor:not([data-floor="1"]) { display: none; }
.office-building { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; display: grid; gap: 10px; }
.office-sub { margin: 0; color: var(--muted); font-size: 12px; }
.office-floor { display: grid; grid-template-columns: 76px 1fr; gap: 10px; align-items: stretch; }
.office-floor-no { display: grid; align-content: center; justify-items: center; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius-l); background: #FAFBFC; padding: 8px 4px; text-align: center; }
.office-floor-no b { font-size: 22px; color: var(--tail); }
.office-floor-no small { color: var(--muted); font-size: 11px; }
.office-turn { font-size: 11px; font-weight: 700; color: var(--danger); }
.office-rooms { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.office-desk { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--radius-l); border: 1px solid #EBDDC8; background: #FFFBF4; color: var(--ink); text-decoration: none; }
.office-desk:hover { border-color: var(--nucleus); }
.office-team { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; }
.office-team em { font-style: normal; color: var(--danger); font-size: 12px; }
.office-person { position: relative; display: flex; gap: 10px; align-items: center; }
.office-face { width: 64px; height: 64px; flex: none; }
.office-who { display: grid; gap: 2px; min-width: 0; }
.office-who b { font-size: 13px; }
.office-line { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.office-zz { position: absolute; left: 48px; top: -2px; font-size: 11px; font-weight: 700; color: #8A94A6; letter-spacing: 1px; }
.office-dots { position: absolute; left: 44px; top: -2px; font-size: 14px; color: var(--tail); letter-spacing: 1px; animation: office-blink 1.2s infinite; }
@keyframes office-blink { 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .office-dots { animation: none; } }
.mood-work { background: #EEF8F6; border-color: #B9E0DA; }
.mood-work .office-line { color: var(--tail); font-weight: 600; }
.mood-warn { background: var(--danger-bg); border-color: var(--danger-line); }
.mood-warn .office-line { color: var(--danger); font-weight: 600; }
.mood-rest .office-face { opacity: .6; filter: grayscale(.4); }
.office-lists, .office-side { display: grid; gap: 12px; align-content: start; }
.office-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 14px; display: grid; gap: 8px; }
.office-panel h2 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; }
.office-panel-hot { border: 2px solid var(--nucleus); }
.office-count { font-size: 14px; color: var(--nucleus); }
.office-order { border: 2px solid var(--nucleus); }
.office-form { display: grid; gap: 8px; }
.office-field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.office-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-s); resize: vertical; }
.office-send { width: 100%; }
.office-job { display: grid; gap: 3px; padding: 8px 0; border-top: 1px solid var(--line); }
.office-job:first-of-type { border-top: 0; }
.office-job small { color: var(--muted); font-size: 11px; }
.office-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.office-actions form { margin: 0; }
@media (min-width: 900px) {
  .office { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "head head" "floors floors" "live side"; align-items: start; }
  .office-head { grid-area: head; }
  .office-floors { grid-area: floors; }
  .office-live-wrap { grid-area: live; min-width: 0; }
  .office-side { grid-area: side; position: sticky; top: 12px; }
}
@media (min-width: 1360px) {
  .office { grid-template-columns: 96px minmax(0, 1fr) 320px; grid-template-areas: "head head head" "floors live side"; }
  .office-floors { flex-direction: column; overflow: visible; }
}
.office-live { display: grid; gap: 12px; }
.office-lists { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.office-field select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); color: var(--ink); }

/* 👥 인원 명단 보기 전환 (2026-11-23) — 아이콘·목록·자세히 */
.viewbar { display: inline-flex; margin: 4px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; background: var(--surface); }
.viewbar[hidden] { display: none; }
.viewbar button { font: inherit; font-size: 13px; padding: 6px 14px; background: transparent; color: var(--ink); border: 0; cursor: pointer; }
.viewbar button + button { border-left: 1px solid var(--line); }
.viewbar button[aria-pressed="true"] { background: var(--tail); color: #fff; font-weight: 700; }
#roster-view .rview { display: none; }
#roster-view[data-view="list"] .rview-list, #roster-view[data-view="icon"] .rview-icon, #roster-view[data-view="detail"] .rview-detail { display: block; }
.rtiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.rtile { display: grid; justify-items: center; gap: 3px; padding: 14px 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); color: var(--ink); text-decoration: none; text-align: center; }
.rtile:hover { border-color: var(--tail); }
.rtile.off { opacity: .55; }
.rtile-face { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #E6F2F1; color: var(--tail); font-weight: 800; font-size: 18px; }
.rtile b { font-size: 14px; }
.rtile small { color: var(--muted); font-size: 11px; }
.rtable-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.rtable { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.rtable th { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600; cursor: pointer; user-select: none; position: sticky; top: 0; background: var(--surface); }
.rtable th[aria-sort] { color: var(--tail); }
.rtable th[aria-sort="ascending"]::after { content: " ▲"; }
.rtable th[aria-sort="descending"]::after { content: " ▼"; }
.rtable td { padding: 9px 10px; border-bottom: 1px solid var(--line); }
.rtable tbody tr { cursor: pointer; }
.rtable tbody tr:hover { background: #F0F7F6; }
.is-uploading, .is-uploading * { cursor: progress; }   /* 서류 올리는 중 (upload.js) */

/* 🗂 자료 보기 전환 (2026-11-23) — 아이콘(큰 미리보기)·목록·자세히 */
#lib-view .lview { display: none; }
#lib-view[data-view="icon"] .lview-icon, #lib-view[data-view="list"] .lview-list, #lib-view[data-view="detail"] .lview-detail { display: block; }
.lib-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.lib-tile { position: relative; }
.lib-tile > input[type=checkbox] { position: absolute; top: 8px; left: 8px; z-index: 3; width: 18px; height: 18px; }
.lib-tile-link { display: grid; justify-items: center; gap: 4px; padding: 10px 8px 12px; border-radius: var(--radius-l); color: var(--ink); text-decoration: none; text-align: center; }
.lib-tile-link:hover { background: #EAF4F3; }
.lib-tile-name { font-size: 13px; line-height: 1.3; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.lib-tile-meta { color: var(--muted); font-size: 11px; }
.lib-pic { width: 112px; height: 112px; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: #F0F3F7; border: 1px solid var(--line); }
.lib-pic img { width: 100%; height: 100%; object-fit: cover; }
.lib-pic-none { background: #F7F9FB; gap: 0; align-content: center; }
.lib-big-icon { font-size: 44px; line-height: 1; }
.lib-ext { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .5px; margin-top: 4px; }
/* 폴더: 뒤판 + (안 그림 1~2장 살짝 삐져나옴) + 앞판 */
.lib-folder { position: relative; width: 112px; height: 96px; margin-top: 8px; margin-bottom: 8px; }
.lib-folder-back { position: absolute; inset: 8px 0 0 0; background: #E9B949; border-radius: 6px 10px 10px 10px; }
.lib-folder-back::before { content: ""; position: absolute; top: -10px; left: 0; width: 44px; height: 14px; background: #E9B949; border-radius: 6px 6px 0 0; }
.lib-peek { position: absolute; width: 64px; height: 64px; object-fit: cover; border: 3px solid #fff; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.lib-peek-1 { left: 18px; top: 2px; transform: rotate(-6deg); }
.lib-peek-2 { left: 34px; top: 6px; transform: rotate(5deg); }
.lib-folder-front { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; background: linear-gradient(#FFD666, #F5C445); border-radius: 6px 6px 10px 10px; box-shadow: 0 -1px 0 rgba(0,0,0,.06); }
.lib-folder:not(.has-peek) .lib-folder-front { height: 70px; }
#lib-view .viewbar { margin-top: 0; }
.pdf-pw { display: grid; gap: 6px; }
.pdf-pw[hidden] { display: none; }
[data-drop-folder].drop-on { outline: 2px dashed var(--tail); outline-offset: 2px; background: #EAF4F3; border-radius: var(--radius-s); }
.lib-dragging [data-item] { cursor: grabbing; }
.lib-keys { font-size: 12px; }
.lib-keys[hidden] { display: none; }
/* 📱 자료 폰 조작 (2026-11-23) — 길게 눌러 고르기·아래 막대·끌기 그림자 */
[data-item] { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.lib-held { outline: 2px solid var(--tail); outline-offset: 2px; border-radius: var(--radius-s); }
.lib-actbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-b) + 36px); z-index: 60; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 10px 12px; background: var(--ink); color: #fff; border-radius: var(--radius-l); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.lib-actbar[hidden] { display: none; }
.lib-actbar b { margin-right: auto; font-size: 14px; }
.lib-actbar button { font: inherit; font-size: 14px; padding: 8px 12px; border-radius: var(--radius-s); border: 1px solid #ffffff40; background: transparent; color: #fff; cursor: pointer; }
.lib-actbar button[data-a="paste"] { background: var(--tail); border-color: var(--tail); font-weight: 700; }
.lib-actbar button:disabled { opacity: .45; }
@media (min-width: 900px) { .lib-actbar { left: auto; right: 24px; bottom: 24px; max-width: 520px; } }
.lib-ghost { position: fixed; left: 0; top: 0; z-index: 70; pointer-events: none; padding: 6px 10px; background: var(--tail); color: #fff; border-radius: var(--radius-s); font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.3); max-width: 60vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.lib-picking .lib-tile > input[type=checkbox] { width: 22px; height: 22px; }
.lib-keys .on-touch { display: none; }
@media (hover: none) { .lib-keys .on-touch { display: inline; } .lib-keys .on-mouse { display: none; } }

/* 👁 웹 미리보기 (2026-11-23) — 서류·결과 파일을 꼬리별 안에서 */
.preview-title { overflow-wrap: anywhere; }
.preview-actions { align-items: center; flex-wrap: wrap; }
.preview-body { display: grid; gap: 12px; }
.preview-page, .preview-image { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.preview-image { width: auto; max-width: 100%; margin: 0 auto; }
.preview-pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 14px; font-size: 13px; line-height: 1.55; max-height: none; }

/* 👶 육아일기 한 편 (2026-11-23) — 평소엔 보기, ✏️ 누르면 그 칸이 고치기로 */
.diary-block { margin-top: 18px; }
.diary-h { font-size: 16px; font-weight: 700; margin: 0; }
.diary-edit > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; padding: 4px 0 8px; }
.diary-edit > summary::-webkit-details-marker { display: none; }
.diary-pencil { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 16px; transform: scaleX(-1); }   /* 연필 반대쪽 사선 (사용자 지정) */
.diary-edit[open] .diary-pencil { background: var(--tail); border-color: var(--tail); }
.diary-edit[open] + .diary-view { display: none; }   /* 고치는 동안은 보기 감춤 */
.diary-edit textarea { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.6; }
.diary-note-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.diary-note-tools .help { width: 100%; margin: 0; }
.diary-text-tools { margin-top: 8px; }
.diary-fresh { margin-top: 8px; }
.diary-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px 10px; }
.diary-status-grid .field { margin: 0; }
.diary-status-grid .field { display: grid; gap: 4px; font-size: 13px; }
.diary-status-grid input { width: 100%; box-sizing: border-box; }
.diary-status { width: auto; min-width: 60%; }

/* 🖥 자료 File Station 처럼 (2026-11-23) — 폴더 나무 · 도구 막대 · 고른 칸 · 우클릭 메뉴 */
.lib-shell { display: grid; gap: 16px; }
.lib-tree { display: none; }
@media (min-width: 1100px) {
  .lib-shell { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
  .lib-tree { display: grid; gap: 1px; position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow: auto; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
}
.tree-row { display: block; padding: 5px 8px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tree-row:hover { background: #EAF4F3; }
.tree-row.on { background: var(--tail); color: #fff; font-weight: 700; }
.tree-row.open { font-weight: 700; }
.tree-row.d1 { padding-left: 20px; } .tree-row.d2 { padding-left: 32px; } .tree-row.d3 { padding-left: 44px; } .tree-row.d4 { padding-left: 56px; }
.tree-row.d5 { padding-left: 68px; } .tree-row.d6 { padding-left: 80px; } .tree-row.d7 { padding-left: 92px; } .tree-row.d8, .tree-row.d9 { padding-left: 104px; }
.lib-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px; margin: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); }
.lib-toolbar[hidden] { display: none; }
.lib-toolbar button { font: inherit; font-size: 13px; padding: 6px 10px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--ink); cursor: pointer; }
.lib-toolbar button:hover:not(:disabled) { background: #EAF4F3; }
.lib-toolbar button:disabled { opacity: .35; cursor: default; }
.lib-toolbar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 4px; }
.lib-selcount { margin-left: auto; color: var(--muted); font-size: 12px; padding-right: 6px; }
.lib-newfolder[hidden], .lib-many[hidden] { display: none; }
[data-item].is-sel .lib-tile-link, li.lib-row[data-item].is-sel, tr[data-item].is-sel td { background: #D6ECEA; }
[data-item].is-sel .lib-pic { outline: 2px solid var(--tail); outline-offset: 1px; }
.lib-menu { position: fixed; z-index: 80; min-width: 180px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); box-shadow: 0 8px 24px rgba(0,0,0,.18); display: grid; }
.lib-menu[hidden] { display: none; }
.lib-menu button { font: inherit; font-size: 13px; text-align: left; padding: 7px 12px; border: 0; background: transparent; color: var(--ink); border-radius: 6px; cursor: pointer; }
.lib-menu button:hover:not(:disabled) { background: #EAF4F3; }
.lib-menu button:disabled { opacity: .35; cursor: default; }
.lib-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
@media (hover: hover) and (pointer: fine) { .lib-actbar:not(.lib-pastebar) { display: none; } }   /* PC 는 도구 막대가 대신 */
/* 🖥 탐색기 공통 (2026-11-23) — 고른 칸 표시 (AI 결과·인원 명단) */
[data-explorer] .is-sel, [data-explorer] .is-sel .lib-tile-link { background: #D6ECEA; }
[data-explorer] tr.is-sel td { background: #D6ECEA; }
[data-explorer] .rtile.is-sel, [data-explorer] .lib-tile.is-sel .lib-pic { outline: 2px solid var(--tail); outline-offset: 1px; }
[data-explorer-toolbar][hidden] { display: none; }
.lib-back { margin: 0 0 6px; }   /* ← 위 폴더 (2026-11-24) */

/* 📌 메모 포스트잇 보드 (2026-11-24) — 카드 보기에서만: 종이 색·살짝 기울기·테이프·그림자·손글씨 (줄 보기는 그대로) */
.note-board:not(.note-rows) { gap: 22px 18px; padding: 14px 6px 6px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.note-board:not(.note-rows) .note-card { border: 0; border-radius: 2px 2px 14px 2px; padding: 22px 12px 10px; background: #FFF3A8; min-height: 150px;
  box-shadow: 0 1px 1px rgba(0,0,0,.08), 2px 6px 10px -4px rgba(0,0,0,.22); transform: rotate(-1.4deg); transition: transform .15s ease, box-shadow .15s ease; }
.note-board:not(.note-rows) .note-card:nth-child(2n) { transform: rotate(1.2deg); }
.note-board:not(.note-rows) .note-card:nth-child(3n) { transform: rotate(-.4deg); }
.note-board:not(.note-rows) .note-card:nth-child(5n) { transform: rotate(2deg); }
.note-board:not(.note-rows) .note-card:hover { transform: rotate(0) translateY(-2px); box-shadow: 0 2px 2px rgba(0,0,0,.08), 3px 10px 16px -6px rgba(0,0,0,.28); }
.note-board:not(.note-rows) .note-card::before { content: ""; position: absolute; top: -9px; left: 50%; width: 64px; height: 20px; margin-left: -32px;
  background: rgba(255,255,255,.55); border: 1px solid rgba(0,0,0,.05); transform: rotate(-3deg); }   /* 테이프 */
.note-board:not(.note-rows) .note-card:nth-child(2n)::before { transform: rotate(4deg); }
.note-board:not(.note-rows) .note-title, .note-board:not(.note-rows) .note-snip { font-family: "Nanum Pen Script", var(--font); color: #3A3226; }
.note-board:not(.note-rows) .note-title { font-size: 22px; line-height: 1.15; }
.note-board:not(.note-rows) .note-snip { font-size: 19px; line-height: 1.3; max-height: 8.2em; }
.note-board:not(.note-rows) .note-foot { color: #6B604E; }
.note-board:not(.note-rows) .note-c-yellow { background: #FFF3A8; } .note-board:not(.note-rows) .note-c-green { background: #D4F2C9; }
.note-board:not(.note-rows) .note-c-blue { background: #CFE6FF; } .note-board:not(.note-rows) .note-c-pink { background: #FFD6E4; }
.note-board:not(.note-rows) .note-c-purple { background: #E6D8FF; } .note-board:not(.note-rows) .note-c-gray { background: #E6E8EC; }
.note-board:not(.note-rows) .note-card.is-sel { outline: 3px solid var(--tail); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .note-board:not(.note-rows) .note-card { transition: none; } }

/* ✏️ 그림판·사진 편집 (0.3.40) — templates/library/draw.html · static/js/draw.js */
.draw-app { display: flex; flex-direction: column; gap: 8px; }
.draw-bar { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.draw-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.draw-end { margin-left: auto; display: flex; gap: 6px; }
.draw-bar .btn, .draw-opts .btn { min-height: 34px; padding: 4px 10px; }
@media (hover: hover) { .draw-cam { display: none; } }   /* 카메라 단추는 폰에서만 */
.draw-tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.draw-tabs button { border: 0; background: none; padding: 8px 12px; font: inherit; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.draw-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--tail); }
.draw-panel { display: flex; flex-direction: column; gap: 8px; }
.draw-panel[hidden] { display: none; }
.draw-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.draw-tools button { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius-s); padding: 5px 9px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink); }
.draw-tools button[aria-pressed="true"] { background: var(--tail); border-color: var(--tail); color: #fff; }
.draw-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; }
.draw-opts label { display: inline-flex; align-items: center; gap: 6px; }
.draw-opts input[type=range] { width: 110px; }
.draw-swatches { display: flex; gap: 4px; align-items: center; }
.sw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--tail); }
.sw-red { background: #E53935; } .sw-orange { background: #FB8C00; } .sw-yellow { background: #FDD835; } .sw-green { background: #43A047; }
.sw-blue { background: #1E88E5; } .sw-purple { background: #8E24AA; } .sw-black { background: #212121; } .sw-white { background: #FFFFFF; }
.draw-swatches input[type=color] { width: 30px; height: 26px; padding: 0; border: 0; background: none; }
.draw-num { width: 76px; }
.draw-hist { width: 192px; height: 48px; background: #1b2230; border-radius: 6px; }
.draw-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.draw-slider { display: grid; grid-template-columns: 82px 1fr 34px; gap: 6px; align-items: center; font-size: 13px; }
.draw-slider output { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.draw-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.draw-filter { flex: none; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 2px solid transparent; border-radius: 8px; background: none; padding: 2px; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); }
.draw-filter canvas { width: 72px; height: 54px; border-radius: 5px; background: var(--bg); }
.draw-filter[aria-pressed="true"] { border-color: var(--tail); }
.draw-stage { position: relative; height: calc(100dvh - 330px); min-height: 320px; border-radius: var(--radius-l); overflow: hidden;
  background: repeating-conic-gradient(#e9ecf1 0 25%, #f6f7f9 0 50%) 0 0 / 20px 20px; touch-action: none; }
.draw-stage.drop-on { outline: 3px dashed var(--tail); outline-offset: -6px; }
.draw-stage canvas { display: block; }
.draw-stage canvas[data-tool="pen"], .draw-stage canvas[data-tool="marker"], .draw-stage canvas[data-tool="line"], .draw-stage canvas[data-tool="arrow"],
.draw-stage canvas[data-tool="rect"], .draw-stage canvas[data-tool="ellipse"], .draw-stage canvas[data-tool="mosaic"], .draw-stage canvas[data-tool="blur"] { cursor: crosshair; }
.draw-stage canvas[data-tool="text"] { cursor: text; }
.draw-stage canvas[data-tool="eraser"], .draw-stage canvas[data-tool="pick"] { cursor: cell; }
.draw-stage canvas[data-pan] { cursor: grab; }
.draw-empty, .draw-choice { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; padding: 16px; pointer-events: none; }
.draw-empty[hidden], .draw-choice[hidden] { display: none; }
.draw-choice { pointer-events: auto; background: rgb(27 34 48 / .55); color: #fff; }
.draw-choice .btn { margin: 2px; }
.draw-text-input { position: absolute; z-index: 2; min-width: 160px; border: 1px dashed var(--tail); background: rgb(255 255 255 / .85); font-weight: 600; line-height: 1.25; padding: 2px 4px; resize: both; }
.draw-status { min-height: 1.4em; }
.draw-save { position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(420px, calc(100vw - 32px));
  background: var(--surface); box-shadow: 0 12px 40px rgb(27 34 48 / .3); display: flex; flex-direction: column; gap: 10px; }
.draw-save[hidden] { display: none; }
.draw-save label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
@media (max-width: 899px) {   /* 폰: 도구 줄은 한 줄씩 옆으로 밀어 보기, 그림 칸을 크게 */
  .draw-app { gap: 6px; }
  .draw-bar { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding-bottom: 2px; scrollbar-width: none; }
  .draw-group { flex-wrap: nowrap; flex: none; }
  .draw-bar .btn, .draw-opts .btn { min-height: 32px; padding: 3px 8px; white-space: nowrap; }
  .draw-end { margin-left: 0; position: sticky; right: 0; background: var(--bg); padding-left: 4px; }
  .draw-tools, .draw-opts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .draw-tools button, .draw-opts > * { flex: none; white-space: nowrap; }
  .draw-opts input[type=range] { width: 80px; }
  .draw-stage { height: calc(100dvh - 250px - var(--nav-h) - var(--safe-b)); min-height: 320px; }
  .draw-sliders { grid-template-columns: 1fr; max-height: 34dvh; overflow-y: auto; }
}

/* 🖥 PC 넓게 (0.3.41) — 사용자 "PC버전 여전히 남는 공간을 안 써 … 모든 기능 재검토" → "넓게 + 폼은 옆에 정보".
   1200px 넘으면 본문 최대 1600px, 바로 아래 칸들을 두 단 격자로: 제목·안내·표·달력은 한 줄 가득, 묶음(.section)·입력 폼(.card-form)은 한 단씩
   (빈자리는 뒤 묶음이 채움 → 폼 옆에 목록). 이 격자가 안 맞는 화면은 {% block main_class %} main-single{% endblock %} */
@media (min-width: 1200px) {
  .main { max-width: 1600px; padding-left: 32px; padding-right: 32px; }
  .main-wide { max-width: 1600px; }
  .main:not(.main-frame):not(.main-wide):not(.main-single) {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
    column-gap: 32px; grid-auto-flow: row dense; align-items: start; align-content: start;
  }
  .main:not(.main-frame):not(.main-wide):not(.main-single) > * { grid-column: 1 / -1; min-width: 0; }
  .main:not(.main-frame):not(.main-wide):not(.main-single) > :is(.section, .card-form, .pc-col) { grid-column: auto; }
  .main:not(.main-frame):not(.main-wide):not(.main-single) > :is(.section, .card-form, .pc-col) + :is(.section, .card-form, .pc-col) { margin-top: 0; }
  .main-single { max-width: 1100px; }
}

/* 🖱 우클릭 되는 곳 (0.3.41, 사용자 "우클릭 기능이 먹는 공간 표시" → "마우스 올리면 테두리+표시") — 탐색기 공통 칸 · 자료 보관함 */
@media (hover: hover) and (min-width: 900px) {
  [data-explorer], #lib-view { position: relative; border-radius: var(--radius-l); outline: 1.5px dashed transparent; outline-offset: 6px; transition: outline-color .15s ease; }
  [data-explorer]:hover, #lib-view:hover { outline-color: rgb(11 122 117 / .5); }
  [data-explorer]::after, #lib-view::after {
    content: "🖱 우클릭 메뉴"; position: absolute; top: -14px; right: 6px; z-index: 3; padding: 1px 9px; border-radius: 999px;
    background: var(--tail); color: #fff; font-size: 11px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .15s ease;
  }
  [data-explorer]:hover::after, #lib-view:hover::after { opacity: 1; }
}
.ex-hint { display: none; margin-left: auto; font-size: 12px; color: var(--muted); }
@media (hover: hover) and (min-width: 900px) { .ex-hint { display: inline; } }
.pc-aside { display: none; }
@media (min-width: 1200px) {
  .pc-aside { display: block; grid-column: 2 / -1 !important; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l); position: sticky; top: calc(16px + var(--env-h)); }
  .pc-aside h2 { margin: 0 0 8px; font-size: 15px; }
  .pc-aside-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .pc-aside-list a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 8px; border-radius: var(--radius-s); color: var(--ink); text-decoration: none; font-size: 14px; }
  .pc-aside-list a:hover { background: var(--bg); }
  .pc-aside-list small { color: var(--muted); flex: none; }
  .pc-aside-more { display: inline-block; margin-top: 8px; font-size: 13px; }
  /* 단순 목록은 여러 단으로 (위→아래 순서 그대로) */
  .shop-list, .main > ul.events:not(.section), .main > ul.lib-list { columns: 3 300px; column-gap: 20px; }
  .shop-list > li, .main > ul.events:not(.section) > li, .main > ul.lib-list > li { break-inside: avoid; }
}

/* 🌐 HTML 바로 보기 (0.3.42) — 격리된 창 */
.html-frame-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; }
.html-frame { display: block; width: 100%; height: calc(100dvh - 260px); min-height: 420px; border: 0; background: #fff; margin: 0 auto; transition: width .2s ease; }
.html-frame-box.is-phone { background: var(--bg); }
.html-frame-box.is-phone .html-frame { width: 390px; max-width: 100%; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.html-frame-box:fullscreen .html-frame { height: 100vh; }
.main:not(.main-frame):not(.main-wide):not(.main-single) > :is(.preview-body, .lib-preview) { grid-column: 1 / -1; }   /* 미리보기(쪽 그림·사진·HTML 창)는 한 줄 가득 (두 단 규칙보다 우선) */

/* 📑 특허 목록 위 탭 (0.3.43, 사용자 "특허 위에 탭 전체 단독 ~~", "특허 신안 의장도 따로 조회") — 시트 탭(밑줄) + 종류 칩 */
.patent-tabs { margin: 16px 0 10px; display: grid; gap: 8px; }
.patent-tab-row { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.patent-tab-row a { flex: none; padding: 9px 14px; color: var(--muted); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.patent-tab-row a[aria-current="page"] { color: var(--tail); border-bottom-color: var(--tail); }
.patent-tab-row .count { font-weight: 400; font-size: 13px; color: var(--muted); }
.tally-table td a { color: inherit; font-weight: 600; text-decoration: underline dotted; }
.tally-table td a:hover { color: var(--tail); }

/* 🔍 미리보기 확대·축소 (0.3.43) */
.zoom-bar { display: inline-flex; align-items: center; gap: 4px; }
.zoom-bar output { min-width: 3.5em; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.zoomable { overflow: auto; max-width: 100%; }
.zoomable.is-zoomed { cursor: grab; }
.zoomable.is-zoomed.is-dragging { cursor: grabbing; user-select: none; }
.zoomable > .zoom-inner { transform-origin: 0 0; }
.zoom-inner { max-width: none; margin: 0 auto; }
.zoom-inner .zoom-img { display: block; width: 100%; max-width: none; height: auto; margin: 0 auto 8px; }
.zoomable { max-height: calc(100dvh - 200px); touch-action: pan-x pan-y; }
.zoom-bar[hidden] { display: none; }

/* 📚 메모 묶음 더미 (0.3.44) — 포스트잇 여러 장이 겹친 모양, 끌어 겹칠 때 들썩 */
.note-pile { position: relative; display: block; min-height: 150px; color: inherit; text-decoration: none; background: transparent !important; }
.note-pile .pile-layer, .note-pile .pile-top { position: absolute; inset: 0; border-radius: 2px 2px 14px 2px; background: #FFF3A8; box-shadow: 0 1px 1px rgba(0,0,0,.08), 2px 6px 10px -4px rgba(0,0,0,.22); }
.note-pile.note-c-green .pile-layer, .note-pile.note-c-green .pile-top { background: #D4F2C9; }
.note-pile.note-c-blue .pile-layer, .note-pile.note-c-blue .pile-top { background: #CFE6FF; }
.note-pile.note-c-pink .pile-layer, .note-pile.note-c-pink .pile-top { background: #FFD6E4; }
.note-pile.note-c-purple .pile-layer, .note-pile.note-c-purple .pile-top { background: #E6D8FF; }
.note-pile.note-c-gray .pile-layer, .note-pile.note-c-gray .pile-top { background: #E6E8EC; }
.note-pile .pile-l2 { transform: rotate(5deg) translate(8px, 6px); filter: brightness(.93); }
.note-pile .pile-l1 { transform: rotate(-3deg) translate(-5px, 3px); filter: brightness(.97); }
.note-pile .pile-top { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 150px; padding: 18px 12px 10px; }
.note-pile .pile-top .note-title { font-family: "Nanum Pen Script", var(--font); font-size: 24px; margin: 0; color: #3A3226; }
.note-pile .pile-top .note-snip { font-family: "Nanum Pen Script", var(--font); font-size: 18px; line-height: 1.3; color: #3A3226; overflow: hidden; }
.note-pile .pile-count { position: absolute; top: 8px; right: 10px; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--tail); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.note-board .note-card.is-lifted, .note-pile.is-lifted { opacity: .45; }
.note-board .note-card.drop-stack, .note-pile.drop-stack { transform: rotate(0) scale(1.06) !important; box-shadow: 0 0 0 3px var(--tail), 4px 14px 22px -6px rgba(0,0,0,.35); }
[data-drop-out].drop-stack { outline: 2px dashed var(--tail); outline-offset: 3px; }
.note-group-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.note-rows .note-pile { min-height: 0; }
.note-rows .note-pile .pile-layer { display: none; }
.note-rows .note-pile .pile-top { min-height: 0; padding: 10px 12px; }

/* 🔎 AI 작업실 '내 조사·내 대화' (0.3.44, 사용자 "가로가 짧아") — PC 에서 한 줄 가득, 목록은 두 단 */
.main:not(.main-frame):not(.main-wide):not(.main-single) > .ai-list-section { grid-column: 1 / -1; }
@media (min-width: 1200px) {
  .ai-list-section .ai-thread-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); column-gap: 16px; align-items: start; }
}

/* 📅 병원 달력 (0.3.45) */
.hcal-nav { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.hcal-nav h2 { margin: 0 6px; font-size: 18px; }
.hcal { border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: var(--surface); }
.hcal-head, .hcal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hcal-head span { padding: 6px; text-align: center; font-size: 12px; color: var(--muted); background: var(--bg); }
.hcal-head span:first-child { color: #D9534F; } .hcal-head span:last-child { color: #3B6FD8; }
.hcal-day { min-height: 92px; padding: 4px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hcal-day:first-child { border-left: 0; }
.hcal-day.is-out { background: var(--bg); color: var(--muted); }
.hcal-day.is-today .hcal-num { background: var(--tail); color: #fff; border-radius: 999px; padding: 0 6px; }
.hcal-num { font-size: 12px; align-self: flex-start; }
.hcal-item { display: block; font-size: 12px; line-height: 1.35; padding: 1px 5px; border-radius: 5px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hcal-visit { background: #E3F1EF; } .hcal-next { background: #EEF3FF; } .hcal-admission { background: #FFF0E0; } .hcal-pharmacy { background: #F2EAFB; }
.hcal-item:hover { filter: brightness(.95); }
@media (max-width: 599px) { .hcal-day { min-height: 70px; padding: 2px; } .hcal-item { font-size: 10px; padding: 0 3px; } }

/* 📖 육아일기 책 (0.3.46) — 펼친 두 쪽(폰 한 쪽) + 넘어가는 책장 */
.book-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.book-top .page-title { margin-right: auto; }
.book { position: relative; perspective: 2400px; max-width: 1240px; margin: 8px auto 0; outline: none; }
.book-spread { display: grid; grid-template-columns: 1fr 1fr; height: calc(100dvh - 270px); min-height: 460px; padding: 14px;
  background: linear-gradient(90deg, #c9b08a, #b89a70 49.6%, #8a6d48 50%, #b89a70 50.4%, #c9b08a); border-radius: 12px;
  box-shadow: 0 18px 36px -18px rgba(60, 40, 20, .55); }
.book-page { position: relative; overflow: auto; background: #fffdf7; min-width: 0; }
.book-page[hidden] { display: none; }
.book-left { border-radius: 6px 0 0 6px; box-shadow: inset -22px 0 26px -20px rgba(0,0,0,.28); }
.book-right { border-radius: 0 6px 6px 0; box-shadow: inset 22px 0 26px -20px rgba(0,0,0,.28); }
.book-sheet { min-height: 100%; padding: 22px 26px 18px; display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.book-sheet-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; border-bottom: 1px dashed rgba(0,0,0,.15); padding-bottom: 6px; }
.book-sheet-head b { font-size: 17px; }
.book-sheet-head span { color: var(--muted); font-size: 13px; }
.book-photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.book-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.2); background: #fff; padding: 3px; }
.book-photos small { grid-column: 1 / -1; color: var(--muted); }
.book-status { border-collapse: collapse; font-size: 13px; }
.book-status th { text-align: left; color: var(--muted); font-weight: 500; padding: 1px 10px 1px 0; }
.book-text { line-height: 1.75; font-size: 15px; white-space: normal; overflow-wrap: anywhere; }
.book-sheet-foot { margin-top: auto; text-align: right; font-size: 12px; }
.book-blank { height: 100%; display: grid; place-items: center; color: #b9a98a; font-size: 14px; background: #fffdf7; }
.book-leaf { position: absolute; top: 14px; bottom: 14px; width: calc(50% - 14px); z-index: 5; transform-style: preserve-3d;
  transition: transform .85s cubic-bezier(.35, .1, .25, 1); pointer-events: none; }
.book-leaf.is-next { left: 50%; transform-origin: left center; }
.book-leaf.is-prev { left: 14px; transform-origin: right center; }
.book-leaf.is-next.go { transform: rotateY(-180deg); }
.book-leaf.is-prev.go { transform: rotateY(180deg); }
.leaf-face { position: absolute; inset: 0; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #fffdf7; }
.leaf-back { transform: rotateY(180deg); }
.leaf-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,.18), rgba(0,0,0,0) 30%, rgba(0,0,0,0) 70%, rgba(0,0,0,.12)); }
.book-leaf.is-one { left: 14px; width: calc(100% - 28px); transform-origin: left center; }
.book-leaf.is-one.is-prev { transform: rotateY(-180deg); }
.book-leaf.is-one.is-prev.go { transform: rotateY(0); }
.book-leaf.is-one.is-prev .leaf-front { transform: none; }
.book-edge { position: absolute; top: 0; bottom: 0; width: 7%; border: 0; background: transparent; cursor: pointer; z-index: 6; }
.book-edge-prev { left: 0; } .book-edge-next { right: 0; }
.book-edge:hover:not(:disabled) { background: linear-gradient(90deg, rgba(0,0,0,.06), transparent); }
.book-edge-next:hover:not(:disabled) { background: linear-gradient(270deg, rgba(0,0,0,.06), transparent); }
.book-edge:disabled { cursor: default; }
.book-bar { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.book-bar output { min-width: 11em; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); }
.book-help { text-align: center; }
@media (max-width: 899px) {
  .book-spread { grid-template-columns: 1fr; height: calc(100dvh - 300px - var(--nav-h)); min-height: 380px; padding: 10px;
    background: linear-gradient(90deg, #8a6d48, #b89a70 4%, #c9b08a); }
  .book-left { border-radius: 4px 6px 6px 4px; box-shadow: inset 14px 0 18px -14px rgba(0,0,0,.28); }
  .book-leaf, .book-leaf.is-one { top: 10px; bottom: 10px; left: 10px; width: calc(100% - 20px); }
  .book-sheet { padding: 16px 16px 12px; }
  .book-edge { width: 14%; }
}
@media (prefers-reduced-motion: reduce) { .book-leaf { transition: none; } }

/* 💱 환전소 근무표 (0.3.47) — 구글 시트 끼워 보기 */
.fx-sheet-box { border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; background: #fff; }
.fx-sheet { display: block; width: 100%; height: calc(100dvh - 240px); min-height: 480px; border: 0; }

/* 🚗 차계부 (0.3.51) */
.car-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.car-chip { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; text-decoration: none; }
.car-chip.is-on { border-color: var(--tail); color: var(--tail); font-weight: 700; box-shadow: inset 0 0 0 1px var(--tail); }
.car-chip.is-off { opacity: .6; }
.car-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.car-sum > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.car-sum small { display: block; color: var(--muted); font-size: 12px; }
.car-sum b { font-size: 17px; font-variant-numeric: tabular-nums; }
.car-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.car-table th, .car-table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.car-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.car-table tr.is-over td:first-child { color: var(--danger); font-weight: 600; }
.car-num { width: 84px; }
.car-parts { overflow-x: auto; }
.car-barcell { width: 55%; }
.car-svgbar { display: block; width: 100%; height: 10px; }
.car-rect { fill: var(--tail); }
.car-due { display: flex; align-items: center; gap: 8px; }
.car-due .event-body { flex: 1; }
.car-due.is-over .event-title { color: var(--danger); }
.car-cand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.car-cand .event-body { flex: 1 1 220px; }
.car-cand-acts { display: flex; gap: 6px; align-items: center; }

/* ✉️ 메일 (0.3.53) */
.mail-filter input[type=search] { width: 100%; margin: 4px 0 8px; }
.mail-list .is-unread .event-title { font-weight: 700; }
.mail-head { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; font-size: 14px; margin: 6px 0 10px; }
.mail-head dt { color: var(--muted); }
.mail-head dd { margin: 0; word-break: break-all; }
.mail-files { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.mail-body { width: 100%; min-height: 60vh; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.mail-guide ul { padding-left: 18px; }
.fx-ai-thumb { display: block; max-width: 100%; max-height: 360px; margin: 6px 0 4px; border: 1px solid var(--line); border-radius: var(--radius-s); }
.fx-ai-img { margin: 10px 0; }
.fx-ai-img img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-s); }

/* 🗂 업무 일정 (0.3.55) */
.pj-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; background: var(--muted); }
.pj-teal { --pj: #0B7A75; } .pj-blue { --pj: #2563EB; } .pj-purple { --pj: #7C3AED; } .pj-pink { --pj: #DB2777; }
.pj-orange { --pj: #EA580C; } .pj-green { --pj: #16A34A; } .pj-gray { --pj: #6B7280; }
.pj-dot[class*="pj-"] { background: var(--pj, var(--muted)); }
.pj-row.is-late .event-time, .pj-late { color: var(--danger); font-weight: 700; }
.is-done .event-title { opacity: .6; text-decoration: line-through; }
.pj-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pj-card { display: block; padding: 10px 12px; border: 1px solid var(--line); border-left: 5px solid var(--pj, var(--tail)); border-radius: var(--radius-s); background: var(--surface); color: var(--text); text-decoration: none; }
.pj-card small { display: block; color: var(--muted); }
.pj-sep { width: 8px; }
.pj-board { display: grid; grid-template-columns: repeat(4, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.pj-col { background: var(--bg, #f3f4f6); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; min-height: 120px; }
.pj-col.is-over { outline: 2px dashed var(--tail); }
.pj-col h2 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 6px; }
.pj-add { margin-left: auto; text-decoration: none; font-size: 18px; }
.pj-cardlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.pj-task { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px; cursor: grab; }
.pj-task.is-late { border-color: var(--danger); }
.pj-task.is-dragging { opacity: .5; }
.pj-task a { color: var(--text); text-decoration: none; display: block; }
.pj-task small { display: block; color: var(--muted); font-size: 12px; }
.pj-bar { display: block; width: 100%; height: 4px; margin-top: 4px; }
.pj-bar-bg { fill: var(--line); } .pj-bar-fg { fill: var(--tail); }
.pj-moves { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pj-move { font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); }
@media (max-width: 720px) { .pj-board { grid-template-columns: repeat(4, 78vw); } }
.pj-sub .event-title { font-size: 14px; }
.pj-checks { list-style: none; padding: 0; margin: 0 0 8px; }
.pj-checks form { display: flex; gap: 6px; align-items: center; }
.pj-check { flex: 1; text-align: left; background: none; border: 0; padding: 4px 0; font: inherit; color: var(--text); }
.pj-check.is-done { color: var(--muted); text-decoration: line-through; }
.pj-x { background: none; border: 0; color: var(--muted); }
.pj-inline { display: flex; gap: 6px; align-items: flex-start; }
.pj-inline input, .pj-inline textarea { flex: 1; }
.pj-comments { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pj-comments .is-system { opacity: .7; font-size: 13px; }
.pj-cal { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.pj-cal th { font-weight: 600; color: var(--muted); padding: 4px; }
.pj-cal td { border: 1px solid var(--line); vertical-align: top; height: 84px; padding: 2px 3px; }
.pj-cal td.is-out { opacity: .5; } .pj-cal td.is-today { outline: 2px solid var(--tail); outline-offset: -2px; }
.pj-day { color: var(--muted); text-decoration: none; font-size: 12px; }
.pj-cal-item { display: block; margin-top: 2px; padding: 1px 4px; border-left: 3px solid var(--pj, var(--tail)); background: var(--surface); color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 3px; }
.pj-cal-item.is-done { opacity: .5; text-decoration: line-through; } .pj-cal-item.is-late { color: var(--danger); }
.pj-report { white-space: pre-wrap; font: 14px/1.6 inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; }
/* 🗂 업무 일정 2차 (0.3.56) */
.pj-warn { padding: 8px 10px; border-radius: var(--radius-s); background: #fef2f2; color: var(--danger); font-size: 14px; margin: 6px 0; }
.pj-timer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--tail); border-radius: var(--radius-s); margin: 8px 0; }
.pj-timeadd input[type=date] { flex: 0 0 auto; } .pj-timeadd input[name=hours] { flex: 0 0 90px; }
.pj-inline-del { display: inline; }
.pj-gantt { display: grid; grid-template-columns: minmax(120px, 220px) 1fr; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); }
.pj-gantt-names { border-right: 1px solid var(--line); }
.pj-gantt-head { height: 28px; border-bottom: 1px solid var(--line); }
.pj-gantt-name { display: block; height: 30px; line-height: 30px; padding: 0 8px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); }
.pj-gantt-name.is-sub { padding-left: 22px; color: var(--muted); }
.pj-gantt-name.is-done { text-decoration: line-through; opacity: .6; }
.pj-gantt-scroll { overflow-x: auto; }
.pj-gantt-svg { display: block; }
.pj-g-weekend { fill: rgba(127,127,127,.08); } .pj-g-week { stroke: var(--line); } .pj-g-row { stroke: var(--line); }
.pj-g-today { stroke: var(--danger); stroke-width: 2; }
.pj-g-arrow { fill: none; stroke: var(--muted); stroke-width: 1.5; } .pj-g-arrow.is-bad { stroke: var(--danger); stroke-dasharray: 4 3; }
.pj-g-bar { fill: var(--pj, var(--tail)); opacity: .85; } .pj-g-bar.is-done { opacity: .35; }
.pj-g-bar.is-late { stroke: var(--danger); stroke-width: 2; } .pj-g-bar.is-clash { stroke: #f59e0b; stroke-width: 2; }
.pj-g-prog { fill: rgba(255,255,255,.85); }
.pj-g-label { font-size: 11px; fill: var(--text); font-weight: 600; } .pj-g-day { font-size: 9px; fill: var(--muted); } .pj-g-day.is-weekend { fill: var(--danger); }
.pj-load-wrap { overflow-x: auto; }
.pj-load td { text-align: center; } .pj-load td.is-some { background: rgba(11,122,117,.08); } .pj-load td.is-heavy { background: #fef2f2; color: var(--danger); font-weight: 600; }
@media (max-width: 720px) { .pj-gantt { grid-template-columns: 110px 1fr; } }

/* 👥 0.3.60 인원 끌어 놓기 · 네모 고르기 */
.rgroup { border: 2px dashed transparent; border-radius: var(--radius-l); padding: 2px 8px; margin: 0 -10px; }
.rgroup.drop-on { border-color: var(--tail); background: #EEF7F6; }
.rview-icon .rtile[draggable="true"] { cursor: grab; }
.rtile.is-dragging { opacity: .4; }
.rtile.ins-before { box-shadow: -4px 0 0 #E11D48; }
.rtile.ins-after { box-shadow: 4px 0 0 #E11D48; }
.ex-marquee { position: fixed; z-index: 70; border: 1px solid var(--tail); background: rgb(14 124 120 / .12); pointer-events: none; }
dialog.rmove { border: 0; border-radius: var(--radius-l); padding: 18px; width: min(420px, 92vw); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
dialog.rmove::backdrop { background: rgb(27 34 48 / .4); }
dialog.rmove h2 { margin: 0 0 10px; font-size: 17px; }
dialog.rmove select, dialog.rmove input[type=date] { width: 100%; }

/* 🖼 0.3.60 이미지 붙이기 */
.ijoin-drop { border: 2px dashed var(--line); border-radius: var(--radius-s); padding: 14px; text-align: center; color: var(--muted); font-size: 13px; }
.ijoin-drop.drop-on { border-color: var(--tail); background: #EEF7F6; }
.ijoin-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.ijoin-list li { display: flex; align-items: center; gap: 8px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); cursor: grab; }
.ijoin-list li canvas { border-radius: 4px; flex: none; }
.ijoin-list li small { flex: 1; color: var(--muted); }
.ijoin-opts { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px; margin: 10px 0; display: grid; gap: 6px; }
.ijoin-opts legend { font-weight: 700; padding: 0 4px; }
.ijoin .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.ijoin .seg label { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.ijoin .seg label:has(input:checked) { background: var(--tail); color: #fff; border-color: var(--tail); }
.ijoin .seg input { position: absolute; opacity: 0; pointer-events: none; }
.ijoin-preview { display: block; max-width: 100%; border: 1px solid var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 16px 16px; }

/* 💰 0.3.61 가계부 개편 — 요약 한 장 · 탭 · 달력 · 줄 */
.bhero { background: linear-gradient(135deg, #0E7C78, #14A39D); color: #fff; border-radius: 16px; padding: 14px 16px; margin: 8px 0 4px; display: grid; gap: 4px; }
.bhero.is-minus { background: linear-gradient(135deg, #B42318, #E11D48); }
.bhero small { opacity: .9; }
.bhero-big { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.bhero-bar { width: 100%; height: 8px; } .bhero-bar .bg { fill: rgb(255 255 255 / .3); } .bhero-bar .fg { fill: #fff; }
.bhero-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.btabs { display: flex; border-bottom: 1px solid var(--line); margin: 10px 0 6px; position: sticky; top: 0; background: var(--bg, #F5F7FA); z-index: 5; }
.btabs button { flex: 1; font: inherit; font-size: 14px; padding: 9px 0; border: 0; background: none; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.btabs button[aria-selected="true"] { color: var(--tail); border-bottom-color: var(--tail); font-weight: 700; }
.notice.is-bad { background: #FFF1F2; border-color: #FECDD3; color: #9F1239; }
.bcal { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; font-size: 11px; }
.bcal th { color: var(--muted); font-weight: 500; padding: 2px 0; }
.bcal td { background: var(--surface); border-radius: 6px; vertical-align: top; height: 46px; padding: 2px 3px; overflow: hidden; }
.bcal td b { display: block; font-size: 11.5px; } .bcal td span, .bcal td small { display: block; white-space: nowrap; }
.bcal td.is-past { opacity: .55; } .bcal td.is-warn { background: #FFF1F2; } .bcal td.is-today { outline: 2px solid var(--tail); }
.bcal td.is-empty { background: none; }
.in { color: #0E9F6E; } .out { color: #E11D48; }
.bline { list-style: none; padding: 0; margin: 0; }
.bline li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bline li.is-muted { opacity: .55; }
.bline .d { width: 3em; color: var(--muted); font-size: 12.5px; flex: none; }
.bline .n { flex: 1; min-width: 0; } .bline .n small { color: var(--muted); }
.bline .a { font-weight: 700; white-space: nowrap; }
.bspark { flex: none; } .bspark polyline { fill: none; stroke: var(--tail); stroke-width: 2; } .bspark .zero { stroke: #FECDD3; stroke-dasharray: 3 3; }
.bspark.is-bad polyline { stroke: #E11D48; }
.bdonut { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.bdonut ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: 13px; }
.bdonut small { color: var(--muted); }
.bday h3 { margin: 12px 0 2px; font-size: 14px; }
@media print { .btabs { display: none; } .bpanel[hidden], [data-bpanel][hidden] { display: block !important; } }
.ijoin .seg { border: 0; border-radius: 0; overflow: visible; background: none; padding: 0; }
