/* 플래너의 모습.
 *
 * 세 가지 약속으로 그린다.
 * 1. 인쇄된 것과 내가 쓴 것을 가른다. 줄·이름·날짜 같은 틀은 먹색(--print)이고,
 *    내가 적은 글은 만년필 잉크색(--ink)이다.
 * 2. 빨강은 달력의 빨간 날과 도장에만 쓴다.
 * 3. 책은 책처럼. 한 번에 펼침면 하나, 옆의 색인, 오늘을 가리키는 가름끈.
 *
 * 크기는 모두 책 너비에 맞춰 늘고 준다. 1u = 펼친 책 너비의 1%.
 */

/* ───────── 글꼴: Paperlogy를 굵기별로 한 집안으로 묶는다 ─────────
   이 컴퓨터에 깔려 있으면 그것을 쓰고, 없으면 플래너에 실린 파일(fonts/, SIL OFL 1.1)을 받는다. */
@font-face { font-family: "Paperlogy"; font-weight: 300; font-display: swap; src: local("Paperlogy 3 Light"), local("Paperlogy-3Light"), url("Paperlogy-3Light.woff2") format("woff2"); }
@font-face { font-family: "Paperlogy"; font-weight: 400; font-display: swap; src: local("Paperlogy 4 Regular"), local("Paperlogy-4Regular"), url("Paperlogy-4Regular.woff2") format("woff2"); }
@font-face { font-family: "Paperlogy"; font-weight: 500; font-display: swap; src: local("Paperlogy 5 Medium"), local("Paperlogy-5Medium"), url("Paperlogy-5Medium.woff2") format("woff2"); }
@font-face { font-family: "Paperlogy"; font-weight: 600; font-display: swap; src: local("Paperlogy 6 SemiBold"), local("Paperlogy-6SemiBold"), url("Paperlogy-6SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Paperlogy"; font-weight: 700; font-display: swap; src: local("Paperlogy 7 Bold"), local("Paperlogy-7Bold"), url("Paperlogy-7Bold.woff2") format("woff2"); }
@font-face { font-family: "Paperlogy"; font-weight: 800; font-display: swap; src: local("Paperlogy 8 ExtraBold"), local("Paperlogy-8ExtraBold"), url("Paperlogy-8ExtraBold.woff2") format("woff2"); }

:root {
  --paper: #fbf9f2;
  --paper-dim: #f1eee3;
  --paper-edge: #e6e2d4;
  --print: #2b302c;
  --print-soft: #747c72;
  --print-faint: #a8afa5;
  --rule: #d9dcd1;
  --rule-strong: #8c9489;
  /* 내가 쓴 글의 색. 2026-11-26 최종 시안에 맞춰 남색(#1b2e5c)에서 거의 검정으로 바꿨다. */
  --ink: #292826;
  --ink-soft: #2928268c;
  --ink-wash: #29282612;
  --stamp: #c8382c;
  --sat: #2a5caa;
  --note: #fff3b0;
  --desk: #48443f;
  --desk-deep: #34312e;
  --cover: #594c40;
  --modal-overlay: #211d18a0;
  --font: "Paperlogy", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--print);
  background: var(--desk);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.defs { position: absolute; }

/* ───────── 책상 ───────── */
.desk {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 84px 34px 44px;
  overflow: auto;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .5 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"),
    radial-gradient(120% 95% at 50% 8%, #5c554c 0%, var(--desk) 52%, var(--desk-deep) 100%);
}

/* ───────── 책 ───────── */
.book {
  /* 가로로 눕힌 작은 태블릿(1133×744)에서도 펼침면이 들어가게 960px까지 줄어든다 */
  /* 높이가 넉넉하면 책의 비율은 1.42(너비:높이)다. 넓지만 낮은 화면(1366×768 노트북의 브라우저 안은 650px쯤)에서는
   * 그 비율을 지키려다 최소 너비 960px에 걸려 글자는 작아지고 책은 화면 아래로 넘쳤다. 그런 화면에서는 책을 1.75까지
   * 납작하게 펴서(너비 1100px까지) 글자를 키우고 높이를 화면에 맞춘다. 2026-11-17. */
  --h-max: calc(100vh - 70px);
  --w: max(960px, min(100vw - 160px, max(var(--h-max) * 1.42, min(1100px, var(--h-max) * 1.75))));
  position: relative;
  width: var(--w);
  height: min(var(--w) / 1.42, max(var(--h-max), var(--w) / 1.75));
  flex: none;
  container-type: size;

  /* 안쪽에서 쓰는 자: 1u = 책 너비의 1% */
  --u: 1cqw;
  --fs-xs: calc(var(--u) * 0.76);
  --fs-s: calc(var(--u) * 0.88);
  --fs-m: calc(var(--u) * 1.02);
  --fs-l: calc(var(--u) * 1.3);
  --fs-xl: calc(var(--u) * 2);
  --fs-xxl: calc(var(--u) * 4.5);
  --row: calc(var(--u) * 2.25);
  --hair: max(1px, calc(var(--u) * 0.07));
}

.spread {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  font-size: var(--fs-m);
  line-height: 1.45;
  background: var(--paper);
  border-radius: calc(var(--u) * 0.45);
  box-shadow:
    0 0 0 1px #00000016,
    calc(var(--u) * 0.22) calc(var(--u) * 0.22) 0 -1px var(--paper-dim),
    calc(var(--u) * 0.22) calc(var(--u) * 0.22) 0 0 #0000001f,
    calc(var(--u) * 0.44) calc(var(--u) * 0.44) 0 -1px var(--paper-edge),
    calc(var(--u) * 0.44) calc(var(--u) * 0.44) 0 0 #00000024,
    0 calc(var(--u) * 0.28) 0 calc(var(--u) * 0.42) var(--cover),
    calc(var(--u) * 0.6) calc(var(--u) * 1.8) calc(var(--u) * 3.6) #0000005c;
  view-transition-name: spread;
}

/* 종이의 결 */
.spread::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: multiply;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .42  0 0 0 0 .33  0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 가운데 접힌 자리 */
.spread::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: calc(var(--u) * 6);
  transform: translateX(-50%);
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #00000006 30%,
    #0000001a 49.4%,
    #00000026 50%,
    #ffffff70 50.6%,
    #00000008 66%,
    transparent 100%
  );
}

.page {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 1.3);
  padding: calc(var(--u) * 2.9) calc(var(--u) * 3.3) calc(var(--u) * 1.9);
}
.page.left { padding-right: calc(var(--u) * 3.7); }
.page.right { padding-left: calc(var(--u) * 3.7); }

/* ───────── 색인 ───────── */
.tabs {
  position: absolute;
  z-index: 0;
  left: calc(100% + var(--u) * 1.1);
  top: calc(var(--u) * 3);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: clamp(70px, calc(var(--u) * 5.7), 80px);
  padding: 4px 0;
  background: var(--paper-dim);
  border-radius: 6px;
  box-shadow: 0 4px 14px #0003;
  font-size: clamp(12px, var(--fs-m), 15px);
}
.tab {
  display: grid;
  place-items: center start;
  min-height: 36px;
  white-space: nowrap;
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: 1.22;
  text-decoration: none;
  cursor: pointer;
  color: var(--print);
  background: transparent;
  border: 0;
  border-inline-start: 3px solid transparent;
  padding: 0 6px 0 9px;
}
.tab:hover { background: var(--paper); }
.tab[aria-current="page"], .tab[aria-expanded="true"] {
  background: var(--paper);
  border-inline-start-color: var(--cover);
  color: var(--print);
  font-weight: 700;
}
.tabs-gap { border-top: var(--hair) solid var(--rule); margin: calc(var(--u) * 0.6) 0 calc(var(--u) * 0.18); }
.tab[href="/notes"] { border-top: var(--hair) solid var(--rule); }
.tab-today { font-weight: 700; }
.tabs .tab-today-phone { display: none; }
/* 휴대폰의 올라오는 색인(`ui::tabs`)의 부품: 넓은 화면에서는 보이지 않거나 없는 것처럼 둔다 */
.index-state, .index-grip, .tab-more { display: none; }
.index-primary, .index-secondary { display: contents; }
@media (min-width: 700px) {
  .tabs > .tab-today {
    position: absolute;
    inset: calc(100% + .45em) 0 auto;
    border-radius: 6px;
    background: #ead8b8;
    box-shadow: 0 4px 14px #0003;
  }
  .tabs > .tab-today:hover { background: var(--paper); }
}

/* ───────── 쪽 머리 ───────── */
.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: calc(var(--u) * 1.4);
  min-height: calc(var(--u) * 5.3);
  padding-bottom: calc(var(--u) * 0.85);
  border-bottom: calc(var(--u) * 0.17) solid var(--print);
}
.head-plain { align-items: flex-end; }
/* 최종 시안: 쪽 머리의 굵은 줄과 본문 사이를 조금 띄운다(7~12px) */
.page .head { margin-block-end: clamp(7px, calc(var(--u) * 0.85), 12px); }

.date { display: flex; align-items: flex-end; gap: calc(var(--u) * 1); }
.date-num {
  font-size: var(--fs-xxl);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}
.date-side { display: flex; flex-direction: column; gap: calc(var(--u) * 0.25); }
.date-wd { font-size: var(--fs-l); font-weight: 700; line-height: 1.1; }
.date-meta { font-size: var(--fs-s); color: var(--print-soft); line-height: 1.1; display: flex; gap: calc(var(--u) * 0.7); }
.date.red .date-num, .date.red .date-wd, .holiday-name { color: var(--stamp); }
.date.blue .date-num, .date.blue .date-wd { color: var(--sat); }
.today-note { color: var(--ink); font-weight: 600; }

/* 날짜 머리의 작은 글: 음력·공휴일·기념일을 "·"로 이어 한 줄로(최종 시안). 음력은 흐리게, 공휴일은 빨강, 기념일은 내가 적은 글이라 잉크색. */
.date-notes { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 calc(var(--u) * 0.35); min-width: 0; line-height: 1.2; color: var(--ink); }
.date-note + .date-note::before { content: "·"; margin-inline-end: calc(var(--u) * 0.35); color: var(--print-soft); }
.date-note[data-kind="lunar"] { white-space: nowrap; color: var(--print-soft); }
.date-note[data-kind="holiday"] { color: var(--stamp); }
.date-side > .date-notes { font-size: var(--fs-s); font-weight: 650; color: var(--print); }
.date-side > .date-notes .date-note[data-kind="lunar"] { font-weight: 500; }
.date-side > .date-notes .date-note[data-kind="holiday"] { color: var(--stamp); }
.date-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 calc(var(--u) * 0.36); }
.date-line .date-wd { white-space: nowrap; }
/* 요일 옆의 가운데 점은 없앴다: 요일과 "11월 · 47주차" 사이가 멀어 보였다(사용자 지적, 2026-11-26) */
.date-line .date-meta::before { content: none; }

.title { margin: 0; font-size: var(--fs-xl); font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.title small { font-size: var(--fs-m); font-weight: 500; color: var(--print-soft); margin-left: calc(var(--u) * 0.8); letter-spacing: 0; }

.turner { display: flex; align-items: center; gap: calc(var(--u) * 1.1); font-size: var(--fs-s); white-space: nowrap; }
.turner a { color: var(--print-soft); text-decoration: none; font-weight: 500; padding: calc(var(--u) * 0.2) 0; }
.turner a:hover { color: var(--print); }
/* 왼쪽 면에 넣어 둔 넘기기 줄: 넓은 화면에서는 오른쪽 면의 것이 보이므로 감추고, 한 면씩 보는 좁은 화면에서만 첫 화면 오른쪽 위에 둔다. */
.turner-first { display: none; }
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  .turner-first { display: block; position: absolute; z-index: 4; top: calc(var(--u) * 1.1); right: calc(var(--u) * 3.3); }
}
/* "오늘"은 이전·다음과 달리 한눈에 단추로 보이게: 잉크색 알약 */
.turner .turner-today { padding: calc(var(--u) * 0.18) calc(var(--u) * 0.85); border: 1.5px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--paper); font-weight: 700; }
.turner .turner-today:hover { background: var(--print); border-color: var(--print); color: var(--paper); text-decoration: none; }

/* ───────── 이름표와 묶음 ───────── */
.label { margin: 0; font-size: var(--fs-s); font-weight: 600; color: var(--print); letter-spacing: 0.01em; line-height: 1.2; }
.block { display: flex; flex-direction: column; min-height: 0; }
.block > .label, .label-row { padding-bottom: calc(var(--u) * 0.42); border-bottom: var(--hair) solid var(--rule-strong); }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: calc(var(--u) * 1); }
.label-note { font-size: var(--fs-xs); color: var(--print-soft); }
.grow { flex: 1; }
.grow > form[data-autosave] { flex: 1; min-height: 0; display: flex; }
.grow > form[data-autosave] > textarea { flex: 1; height: auto; }

.folio {
  margin-top: auto;
  min-height: calc(var(--u) * 1.2);
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  color: var(--print-faint);
  letter-spacing: 0.04em;
}
.page.right .folio { justify-content: flex-end; }
.folio a { color: inherit; text-decoration: none; }
.folio a:hover { color: var(--print); }

/* ───────── 내가 쓰는 칸 ───────── */
.ink {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  outline: none;
}
.ink::placeholder { color: var(--print-faint); font-weight: 400; opacity: 1; }
input.ink:focus-visible, textarea.ink:focus-visible { background-color: var(--ink-wash); }

/* 한 줄짜리 글이지만 칸이 좁으면 줄을 바꿔 가며 늘어나는 칸 */
textarea.ink.fit {
  display: block;
  width: 100%;
  resize: none;
  overflow: hidden;
  field-sizing: content;
  line-height: 1.4;
  padding: calc(var(--u) * 0.42) 0;
}

/* 한글은 낱말 사이에서 줄을 바꾼다("성과기술\n서"처럼 낱말 가운데가 꺾이지 않게). 빈칸 없이 긴 글만 가운데에서 꺾는다 */
textarea.ink, .line, .line-title, .ev-title, .mini-title, .task-project, .pick-name, .entry, .ledger-row { word-break: keep-all; overflow-wrap: anywhere; }

textarea.lines {
  display: block;
  width: 100%;
  margin: 0;
  min-height: 0;
  /* 칸보다 길게 적으면 칸 안에서 내려 본다(가리지 않는다) */
  overflow-y: auto;
  resize: none;
  padding: 0 calc(var(--u) * 0.4);
  line-height: var(--row);
  background-image: linear-gradient(to bottom, transparent calc(var(--row) - var(--hair)), var(--rule) calc(var(--row) - var(--hair)));
  background-size: 100% var(--row);
  background-attachment: local;
  /* 넘치면 내려 볼 수 있다는 것이 보이게 가는 막대를 둔다. 막대가 글자를 덮지 않게 오른쪽을 조금 비운다. */
  scrollbar-width: thin;
  scrollbar-color: var(--rule-strong) transparent;
  padding-right: calc(var(--u) * 0.4 + 10px);
}
/* 적는 만큼 늘어나는 줄 칸(오늘의 주요업무): 세 줄에서 시작해 여덟 줄까지 늘고, 그 뒤로는 칸 안에서 내려 본다 */
textarea.lines[data-grow] { field-sizing: content; min-height: calc(var(--row) * 3); max-height: calc(var(--row) * 8); overflow-y: auto; }

button, select, input { font-family: inherit; }
button { cursor: pointer; }
:focus-visible { outline: calc(var(--u) * 0.14) solid var(--ink); outline-offset: calc(var(--u) * 0.12); }
.ink:focus-visible, .tab:focus-visible { outline-offset: 0; }

.quiet-save { position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }

/* ───────── 할 일 ───────── */
.task-list { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
/* 일간의 종이 줄은 입력 행 아래 빈 공간에만 그린다. 긴 할 일이 줄바꿈돼도 행의 구분선과 겹치지 않는다. */
body[data-tab="day"] .task-list {
  display: flex;
  flex-direction: column;
}
body[data-tab="day"] .task-list > .task {
  flex: none;
}
body[data-tab="day"] .task-list::after {
  content: "";
  flex: 1 0 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(var(--row) - var(--hair)),
    var(--rule) calc(var(--row) - var(--hair)),
    var(--rule) var(--row)
  );
}
.task {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--u) * 2) calc(var(--u) * 2.9) 1fr auto auto;
  align-items: center;
  height: var(--row);
  border-bottom: var(--hair) solid var(--rule);
}
.mark {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: var(--fs-l);
  line-height: 1;
}
/* 상태 그림은 모두 같은 크기: 줄 높이에 맞춘 원 하나 */
.st { display: block; width: calc(var(--u) * 1.5); height: calc(var(--u) * 1.5); flex: none; }
.mini-task .mark .st { width: calc(var(--u) * 1.25); height: calc(var(--u) * 1.25); }
.st-inline { display: inline-grid; place-items: center; vertical-align: middle; margin-right: 0.15em; }
.st-inline .st { width: 1.2em; height: 1.2em; }
.mark.ghost { color: var(--print-faint); }
.task.is-done .mark { color: var(--ink); }
.task.is-cancelled .mark, .task.is-deferred .mark, .task.is-delegated .mark { color: var(--ink-soft); }

.prio {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-s);
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  appearance: none;
  cursor: pointer;
}
select.prio:hover { background: var(--ink-wash); }

.task-title { width: 100%; height: 100%; }
.task.is-done .task-title, .task.is-cancelled .task-title {
  color: var(--ink-soft);
  text-decoration: line-through;
  text-decoration-thickness: var(--hair);
}
.task.is-deferred .task-title, .task.is-delegated .task-title { color: var(--ink-soft); }
.task-project {
  max-width: calc(var(--u) * 11);
  padding: 0 calc(var(--u) * 0.5);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: var(--fs-xs);
  color: var(--print-soft);
  text-decoration: none;
}
.task-project:hover { color: var(--print); }

.carry { margin-top: calc(var(--u) * 0.7); text-align: right; }
.carry button, .plain-button {
  padding: calc(var(--u) * 0.3) calc(var(--u) * 0.8);
  border: var(--hair) solid var(--rule-strong);
  border-radius: calc(var(--u) * 2);
  background: transparent;
  color: var(--print-soft);
  font-size: var(--fs-xs);
  font-weight: 500;
}
.carry button:hover, .plain-button:hover { color: var(--print); border-color: var(--print); }

/* ───────── 줄에 붙는 쪽지(자세히) ───────── */
.more { position: static; }
.more > summary {
  list-style: none;
  padding: 0 calc(var(--u) * 0.6);
  color: var(--print-faint);
  cursor: pointer;
  opacity: 0;
  line-height: 1;
  user-select: none;
}
.more > summary::-webkit-details-marker { display: none; }
:is(.task, .ev, .chip, .entry):hover .more > summary,
:is(.task, .ev, .chip, .entry):focus-within .more > summary,
.more[open] > summary { opacity: 1; }
.more[open] > summary { color: var(--ink); }

.more-body {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--u) * 0.2);
  right: 0;
  width: calc(var(--u) * 27);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--u) * 0.7) calc(var(--u) * 0.9);
  padding: calc(var(--u) * 1.1);
  background: var(--note);
  box-shadow: calc(var(--u) * 0.1) calc(var(--u) * 0.5) calc(var(--u) * 1.3) #00000038;
  transform: rotate(-0.5deg);
  font-size: var(--fs-s);
  color: var(--print);
  text-align: left;
}
.more-body label { display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); min-width: 0; }
.more-body label > span { font-size: var(--fs-xs); color: #6d6a4a; }
.more-body .wide { grid-column: 1 / -1; }
.more-body .tick { flex-direction: row; align-items: center; gap: calc(var(--u) * 0.5); }
.more-body .tick > span { font-size: var(--fs-s); color: var(--print); }
.more-body input:not([type="checkbox"]), .more-body select {
  width: 100%;
  padding: calc(var(--u) * 0.25) calc(var(--u) * 0.1);
  border: 0;
  border-bottom: var(--hair) solid #b9ae6e;
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-s);
  font-weight: 500;
}
.more-hint { grid-column: 1 / -1; margin: 0; font-size: var(--fs-xs); color: #6d6a4a; }
.more-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.5); justify-content: flex-end; }
.more-actions button {
  padding: calc(var(--u) * 0.3) calc(var(--u) * 0.7);
  border: var(--hair) solid #b9ae6e;
  border-radius: calc(var(--u) * 2);
  background: #ffffff66;
  color: var(--print);
  font-size: var(--fs-xs);
}
.more-actions button:hover { background: #fff; }
.more-actions .danger { color: var(--stamp); border-color: #c8382c88; }

/* ───────── 시간표 ───────── */
.schedule { display: flex; flex-direction: column; min-height: 0; flex: none; }
.allday {
  display: flex;
  gap: calc(var(--u) * 0.9);
  align-items: baseline;
  padding: calc(var(--u) * 0.35) 0 calc(var(--u) * 0.55);
  border-bottom: var(--hair) solid var(--rule-strong);
}
.allday-label { flex: none; width: calc(var(--u) * 4.2); font-size: var(--fs-xs); color: var(--print-soft); }
.allday-items { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.4) calc(var(--u) * 0.7); min-width: 0; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: calc(var(--u) * 0.45);
  padding: 0 calc(var(--u) * 0.55);
  border-left: calc(var(--u) * 0.22) solid var(--ink);
  background: var(--ink-wash);
  color: var(--ink);
  font-weight: 500;
  line-height: 1.7;
}
/* 칩의 제목 칸에만 건다. `.chip input`으로 두면 칩 안에 든 ⋯ 창의 칸들까지 좁아져, 하루 종일 일정의 창만 모양이 달라진다. */
.chip > input { field-sizing: content; min-width: calc(var(--u) * 3); max-width: calc(var(--u) * 22); }
.chip-when { font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.chip.is-outside, .ev.is-outside {
  border-left-color: var(--cal, var(--print-soft));
  background: color-mix(in srgb, var(--cal, var(--print-soft)) 9%, transparent);
  color: var(--print);
}

/* 시간 줄은 시간표의 높이를 시간 수만큼 고르게 나눈다. 높이를 못박은 곳(한 쪽 보기)에서도, 남는 자리를 채우는 곳
 * (두 쪽 보기의 오른쪽 면)에서도 같은 규칙으로 놓이게, 줄과 일정 조각의 자리는 모두 비율로 적는다. */
.timeline {
  --hour: calc(var(--u) * 2.72);
  position: relative;
  flex: none;
  height: calc(var(--hours) * var(--hour));
  display: grid;
  grid-template-rows: repeat(var(--hours), minmax(0, 1fr));
  border-bottom: var(--hair) solid var(--rule);
}
.hour { position: relative; min-height: 0; border-top: var(--hair) solid var(--rule); }
.hour:first-child { border-top-color: transparent; }
.hour::after {
  content: "";
  position: absolute;
  left: calc(var(--u) * 2.6);
  right: 0;
  top: 50%;
  border-top: var(--hair) dotted var(--rule);
}
.hour-label {
  position: absolute;
  left: 0;
  top: calc(var(--u) * 0.3);
  width: calc(var(--u) * 1.9);
  text-align: right;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--print-soft);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.blocks { position: absolute; inset: 0 0 0 calc(var(--u) * 2.8); }
.ev {
  position: absolute;
  top: calc(var(--top) / var(--hours) * 100% + 1px);
  left: calc(var(--lane) / var(--lanes) * 100%);
  width: calc(100% / var(--lanes) - var(--u) * 0.25);
  height: calc(var(--span) / var(--hours) * 100% - 2px);
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  align-items: baseline;
  column-gap: calc(var(--u) * 0.55);
  padding: calc(var(--u) * 0.18) calc(var(--u) * 0.55);
  border-left: calc(var(--u) * 0.24) solid var(--ink);
  background: color-mix(in srgb, var(--ink) 8%, var(--paper));
  color: var(--ink);
  line-height: 1.35;
}
.ev.is-meeting { border-left-style: double; border-left-width: calc(var(--u) * 0.42); }
/* 최종 시안(2026-11-26): 일정 칸은 모서리를 살짝 둥글게, 시각은 흐리게 */
.ev, .chip { border-radius: 0.45em; }
body[data-tab="day"] .ev-when { color: var(--print-soft); }
.ev-when { flex: none; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.ev-title { flex: 1; min-width: calc(var(--u) * 5); font-weight: 600; }
.ev-place { flex: none; font-size: var(--fs-xs); color: var(--ink-soft); }
.ev .more { margin-left: auto; }
/* ⋯ 단추는 손가락으로 누르기 좋게 크지만, 그 높이가 일정 줄의 높이를 키우면 글자가 칸 아래로 끌려 내려간다.
 * 그래서 시간표와 하루 종일 줄 안에서는 높이를 차지하지 않게 하고(0), 단추만 줄 가운데에 겹쳐 둔다. */
.ev, .chip { align-items: center; }
/* 시간표의 일정은 시각에 맞춘 높이의 칸이라 글이 두 줄이 되면 칸 밖으로 흘러 아래 일정과 겹친다.
 * 한 줄에 두고, 자리가 모자라면 장소부터 줄이고 제목은 끝을 줄임표로 맺는다(전체 글은 ⋯ 창과 목록에서 본다). */
.timeline .ev { flex-wrap: nowrap; }
.timeline .ev > .ev-when { flex: 0 0 auto; }
/* 제목이 먼저다: 장소는 줄의 삼분의 일까지만 쓰고 나머지는 제목 몫이다(전에는 장소가 다 나오고 제목이 "주간 업…"으로 잘렸다). */
.timeline .ev > .ev-title { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .ev > .ev-place { flex: 0 1 auto; min-width: 0; max-width: 34%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline .ev > .more { flex: none; overflow: visible; }
/* 일정이 나란히 놓여 칸을 나눠 쓰면 장소를 숨기고, 셋 이상이 나란하면 끝 시각도 숨긴다. 숨긴 것은 ⋯ 창에서 본다. */
.timeline .ev:not([style$="--lanes:1"]) > .ev-place { display: none; }
.timeline .ev:not([style$="--lanes:1"]):not([style$="--lanes:2"]) .ev-end { display: none; }
/* 좁은 화면에서 일정이 나란히 놓이면(칸을 나눠 쓰면) 끝 시각은 숨기고 제목을 보여 준다 */
@media (max-width: 699px) { .timeline .ev:not([style*="--lanes:1"]) .ev-end { display: none; } }
:is(.ev, .chip) > .more { align-self: center; height: 0; display: flex; align-items: center; }
.now-line {
  position: absolute;
  left: calc(var(--u) * -0.9);
  right: 0;
  top: calc(var(--top) / var(--hours) * 100%);
  border-top: calc(var(--u) * 0.12) solid var(--stamp);
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: calc(var(--u) * -0.31);
  width: calc(var(--u) * 0.5);
  height: calc(var(--u) * 0.5);
  border-radius: 50%;
  background: var(--stamp);
}

.ev-add { height: var(--row); display: flex; align-items: center; border-bottom: var(--hair) solid var(--rule); }
.ev-add input { width: 100%; height: 100%; padding: 0 calc(var(--u) * 0.4); }
.ev-add input::placeholder { font: inherit; color: var(--print-faint); }

/* ───────── 도장과 스티커 ───────── */
.stickers { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: calc(var(--u) * 0.45); }
.stuck { display: contents; }
.sticker { padding: 0; border: 0; background: none; line-height: 1; pointer-events: none; }
.sticking .sticker { pointer-events: auto; cursor: pointer; }
.sticking .sticker:hover { opacity: 0.45; }

.stamp {
  display: inline-block;
  padding: calc(var(--u) * 0.2) calc(var(--u) * 0.5) calc(var(--u) * 0.12);
  border: calc(var(--u) * 0.17) solid var(--stamp);
  border-radius: calc(var(--u) * 0.32);
  color: var(--stamp);
  font-size: var(--fs-s);
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1.15;
  white-space: nowrap;
  transform: rotate(var(--tilt, -3deg));
  filter: url(#ink);
  mix-blend-mode: multiply;
}
.mark-sticker { display: inline-grid; transform: rotate(var(--tilt, 0deg)); }
.mark-sticker svg {
  width: calc(var(--u) * 1.75);
  height: calc(var(--u) * 1.75);
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 채움 모양: 덩어리는 펜 색으로 채우고, 선은 긋고, 무늬는 종이색으로 판다 */
.mark-sticker .solid { fill: currentColor; stroke: currentColor; stroke-width: 1.5; }
.mark-sticker .line { stroke: currentColor; stroke-width: 2.1; }
.mark-sticker .cut { stroke: var(--paper); stroke-width: 1.9; }
.tray .mark-sticker .cut { stroke: #fffffe; }
.emoji-sticker { font-size: calc(var(--u) * 1.5); line-height: 1; }
.pen-red { color: var(--stamp); }
.pen-blue { color: var(--sat); }
.pen-green { color: #2e7a4d; }
.pen-amber { color: #c08400; }
.pen-ink { color: var(--ink); }

.head-stickers { min-width: calc(var(--u) * 6); min-height: calc(var(--u) * 2.4); display: flex; justify-content: flex-end; align-items: flex-end; }

/* ───────── 스티커 서랍: 책 위에 얹힌 스티커 판 (필기 서랍 `.inktray`도 같은 판을 쓴다) ───────── */
.tray, .inktray {
  position: absolute;
  z-index: 30;
  right: calc(var(--u) * -3.6);
  bottom: calc(var(--u) * 1.4);
  width: calc(var(--u) * 25);
  padding: calc(var(--u) * 1.3) calc(var(--u) * 1.4);
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.9);
  background: #fffffe;
  border-radius: calc(var(--u) * 0.9);
  box-shadow: 0 0 0 1px #0000001a, calc(var(--u) * 0.4) calc(var(--u) * 1) calc(var(--u) * 2.4) #00000059;
  transform: rotate(1.2deg);
  font-size: var(--fs-s);
}
.tray[hidden], .inktray[hidden] { display: none; }
.tray-help { position: relative; margin: 0; font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.5; }
.tray-help > summary { display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; }
.tray-help > summary::-webkit-details-marker { display: none; }
.tray-title { font-size: var(--fs-s); font-weight: 700; color: var(--print); }
.help-mark {
  width: 20px; height: 20px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--print-soft); border-radius: 50%;
  color: var(--print-soft); font: 700 12px/1 system-ui, sans-serif;
}
.tray-help > summary:hover .help-mark, .tray-help[open] .help-mark { border-color: var(--print); background: var(--print); color: var(--paper); }
.tray-help > summary:focus-visible .help-mark { outline: 2px solid var(--ink); outline-offset: 2px; }
/* 설명은 서랍의 다른 것을 밀어내지 않고 그 위에 겹쳐 펼친다(서랍이 아래에 붙어 있어, 밀어내면 물음표가 손끝에서 달아난다) */
.tray-help > ul { position: absolute; z-index: 2; top: calc(100% + var(--u) * 0.4); left: 0; right: 0; margin: 0; padding: calc(var(--u) * 0.8) calc(var(--u) * 1) calc(var(--u) * 0.8) calc(var(--u) * 2.1); background: var(--paper); color: var(--print); border-radius: calc(var(--u) * 0.5); box-shadow: 0 0 0 1px #0000001f, 0 6px 18px #00000040; }
.tray-help li + li { margin-top: calc(var(--u) * 0.25); }
.tray-group { display: flex; flex-direction: column; gap: calc(var(--u) * 0.55); }
.tray-group h3 { margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--print-soft); }
.tray-items { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.55) calc(var(--u) * 0.7); align-items: center; }
.tray-item {
  padding: calc(var(--u) * 0.3);
  border: 0;
  border-radius: calc(var(--u) * 0.5);
  background: none;
  color: inherit;
  line-height: 1;
}
.tray-item:hover { background: #0000000d; }
.tray-item[aria-pressed="true"] { background: var(--note); box-shadow: 0 0 0 var(--hair) #b9ae6e; }
.tray-colors { display: flex; gap: calc(var(--u) * 0.5); }
.tray-colors input { position: absolute; opacity: 0; }
.tray-colors span {
  display: block;
  width: calc(var(--u) * 1.3);
  height: calc(var(--u) * 1.3);
  border-radius: 50%;
  background: currentColor;
  cursor: pointer;
}
.tray-colors input:checked + span { box-shadow: 0 0 0 calc(var(--u) * 0.15) #fff, 0 0 0 calc(var(--u) * 0.3) currentColor; }
.tray-colors input:focus-visible + span { outline: calc(var(--u) * 0.14) solid var(--ink); outline-offset: calc(var(--u) * 0.35); }
.tray-pencil-picker { min-width: 0; }
.tray-pencil-picker summary { color: var(--print); cursor: pointer; }
.sticker-pencils { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4em; padding: .6em; }
.sticker-pencils label { cursor: pointer; }
.tray-custom { display: flex; align-items: center; gap: calc(var(--u) * 0.6); font-size: var(--fs-xs); color: var(--print-soft); }
.tray-custom input {
  flex: 1;
  min-width: 0;
  padding: calc(var(--u) * 0.25) calc(var(--u) * 0.3);
  border: 0;
  border-bottom: var(--hair) solid var(--rule-strong);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-s);
}
.tray-close { align-self: flex-end; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.8); border: var(--hair) solid var(--rule-strong); border-radius: calc(var(--u) * 2); background: none; color: var(--print-soft); font-size: var(--fs-xs); }
.tray-close:hover { color: var(--print); border-color: var(--print); }

/* ───────── 알림 ───────── */
.trouble {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--print);
  color: var(--paper);
  font-size: 14px;
  box-shadow: 0 6px 20px #00000059;
}
.trouble[hidden] { display: none; }
.stuck {
  position: fixed;
  z-index: 40;
  left: 18px;
  bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--stamp);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 14px #0000004d;
}

/* ───────── 없는 쪽 ───────── */
.lost { max-width: 30rem; padding: 2.5rem; border-radius: 6px; background: var(--paper); box-shadow: 0 18px 40px #00000059; }
.lost h1 { margin: 0 0 0.6rem; font-size: 1.4rem; }
.lost p { margin: 0 0 1.2rem; color: var(--print-soft); line-height: 1.6; }
.lost a { color: var(--ink); font-weight: 600; }

/* ───────── 쪽 넘기기 ───────── */
::view-transition-group(root), ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
/* 쪽 넘김: 오른쪽 쪽 한 장이 책등을 축으로 들려 넘어간다. 넘어가는 쪽은 90도를 지나면 뒷면이 보이지 않아 사라지고 아래의 새 쪽이 드러난다.
 * 앞서 쓰던 것은 펼침면 전체의 밝기를 바꾸는 필터를 함께 움직여 끊겨 보였고(사용자 지적), 필터 없이 회전 하나만 움직여 부드럽게 한다.
 * 처음엔 천천히 들리고(ease-in), 중간에 빠르고, 끝에서 가라앉는다. 길이 900ms. */
::view-transition-group(spread) { animation-duration: 900ms; }
::view-transition-new(spread) { animation: none; mix-blend-mode: normal; }
::view-transition-old(spread) {
  z-index: 1;
  mix-blend-mode: normal;
  clip-path: inset(0 0 0 50%);
  transform-origin: 50% center;
  backface-visibility: hidden;
  will-change: transform;
  animation: 900ms cubic-bezier(.5, .02, .3, 1) both leaf-turn;
}
@keyframes leaf-turn {
  from { transform: perspective(2600px) rotateY(0deg); }
  to { transform: perspective(2600px) rotateY(-180deg); }
}
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  ::view-transition-old(spread) { clip-path: none; transform-origin: left center; }
}
:root:has(.spread.is-single)::view-transition-old(spread) { clip-path: none; transform-origin: left center; }

/* ───────── 목표 ───────── */
.goals { display: flex; flex-direction: column; }
.goal {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--u) * 1.9) 1fr auto;
  align-items: center;
  min-height: var(--row);
  border-bottom: var(--hair) solid var(--rule);
}
.check {
  display: grid;
  place-items: center;
  width: calc(var(--u) * 1.15);
  height: calc(var(--u) * 1.15);
  padding: 0;
  border: calc(var(--u) * 0.12) solid var(--print-soft);
  border-radius: calc(var(--u) * 0.15);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-m);
  font-weight: 800;
  line-height: 1;
}
.check.ghost { border-color: var(--rule); }
/* 체크 상자는 첫 줄의 가운데에 맞춘다(줄 높이가 바뀌는 휴대폰에서도 글자와 어긋나지 않게) */
.goal .check { align-self: start; margin-top: calc((var(--row) - var(--u) * 1.15) / 2); }
.goal.is-done textarea { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: var(--hair); }
/* 지우는 ×는 늘 보이게 둔다(손가락으로 쓰는 화면에는 올려 보기가 없다). 평소에는 옅게, 올리면 또렷하게 */
.row-del { padding: 0 calc(var(--u) * 0.5); border: 0; background: none; color: var(--print-soft); font-size: var(--fs-l); line-height: 1; opacity: 0.55; }
:is(.goal, .ledger-row):hover .row-del, :is(.goal, .ledger-row):focus-within .row-del { opacity: 1; }
.row-del:hover { color: var(--stamp); }

/* ───────── 달력 칸에 적는 일정 줄 ───────── */
/* 일정 줄 목록(ul.lines)에만 건다. `.lines`로만 적으면 이름이 같은 메모·주요업무 칸(textarea.lines)까지 "넘치면 가림"이 되어,
 * 칸보다 긴 메모의 아랫부분이 잘리고 내려 볼 수도 없었다(2026-11-17). */
.lines:not(textarea) { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: calc(var(--u) * 0.08); min-height: 0; overflow: hidden; }
.line {
  display: flex;
  gap: calc(var(--u) * 0.35);
  align-items: baseline;
  font-size: var(--fs-xs);
  line-height: 1.32;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}
.line-title { overflow: hidden; text-overflow: ellipsis; }
.line-when { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; opacity: 0.75; }
.line:not(:has(.line-when)) { padding-left: calc(var(--u) * 0.4); border-left: calc(var(--u) * 0.18) solid var(--ink); }
.line.is-outside { color: var(--print); }
.line.is-outside:not(:has(.line-when)) { border-left-color: var(--cal, var(--print-soft)); }
.line.is-outside .line-when { color: var(--cal, var(--print-soft)); opacity: 1; }
.line.is-carried { opacity: 0.6; }
.line-rest { color: var(--print-soft); font-weight: 400; border: 0 !important; padding-left: 0 !important; }

/* ───────── 월간 ───────── */
.month {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto repeat(var(--weeks), minmax(0, 1fr));
  margin-top: calc(var(--u) * -0.5);
}
.month-left { grid-template-columns: calc(var(--u) * 1.8) repeat(4, minmax(0, 1fr)); }
.month-right { grid-template-columns: repeat(3, calc((100% - var(--u) * 1.8) / 4)) minmax(0, 1fr); }
.dow {
  padding: 0 calc(var(--u) * 0.5) calc(var(--u) * 0.35);
  border-bottom: var(--hair) solid var(--rule-strong);
  font-size: var(--fs-s);
  font-weight: 600;
  color: var(--print-soft);
}
.dow.red { color: var(--stamp); }
.dow.blue { color: var(--sat); }
.dow-goals { color: var(--print); padding-left: calc(var(--u) * 1); }
.wk {
  padding-top: calc(var(--u) * 0.5);
  border-bottom: var(--hair) solid var(--rule);
  font-size: var(--fs-xs);
  color: var(--print-faint);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.wk:hover { color: var(--print); }
.cell {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.15);
  padding: calc(var(--u) * 0.35) calc(var(--u) * 0.5) calc(var(--u) * 0.25);
  border-bottom: var(--hair) solid var(--rule);
  border-left: var(--hair) solid var(--rule);
}
.cell-top { display: flex; align-items: flex-start; gap: calc(var(--u) * 0.4); min-height: calc(var(--u) * 1.75); }
.cell-top .stickers { margin-left: auto; gap: calc(var(--u) * 0.25); }
.cell-top .stamp { font-size: var(--fs-xs); padding: calc(var(--u) * 0.1) calc(var(--u) * 0.3) calc(var(--u) * 0.04); border-width: calc(var(--u) * 0.13); }
.cell-top .mark-sticker svg { width: calc(var(--u) * 1.35); height: calc(var(--u) * 1.35); }
.cell-top .emoji-sticker { font-size: calc(var(--u) * 1.2); }
.cell-num {
  flex: none;
  min-width: calc(var(--u) * 1.6);
  height: calc(var(--u) * 1.6);
  display: grid;
  place-items: center;
  margin: calc(var(--u) * -0.15) 0 0 calc(var(--u) * -0.25);
  border-radius: 50%;
  color: var(--print);
  font-size: var(--fs-m);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-decoration: none;
}
.cell-num:hover { background: var(--ink-wash); }
.cell.red .cell-num { color: var(--stamp); }
.cell.blue .cell-num { color: var(--sat); }
/* 오늘 날짜: 최종 시안(2026-11-26)의 옅은 회색 원. 달력 칸·휴대폰 주간 칸·주간 요일 칸이 같다. */
:root { --today-fill: #deddd7; }
:is(.cell.is-today .cell-num, .phone-cell.is-today .phone-num, .daycol.is-today .daycol-num) {
  background: radial-gradient(circle closest-side, var(--today-fill) 97%, transparent 100%);
  box-shadow: none;
  color: var(--ink);
  font-weight: 800;
}
.cell-holiday { font-size: var(--fs-xs); color: var(--stamp); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell.is-dim > :not(.cell-foot) { opacity: 0.36; }
.cell-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; min-height: calc(var(--u) * 1.1); }
.cell-tasks { font-size: var(--fs-xs); color: var(--ink-soft); text-decoration: none; line-height: 1; }
.cell-tasks:hover { color: var(--ink); }
.cell-add { margin-left: auto; }
.cell-add > summary { padding: 0 calc(var(--u) * 0.2); font-size: var(--fs-m); font-weight: 600; }
.cell:hover .cell-add > summary, .cell:focus-within .cell-add > summary { opacity: 1; }
.cell-add .more-body { top: calc(100% - var(--u) * 0.6); width: calc(var(--u) * 22); }
.month-left .cell:nth-child(5n + 2) .more-body, .month-left .cell:nth-child(5n + 3) .more-body { right: auto; left: 0; }
.month-goals { grid-column: 4; padding: 0 0 0 calc(var(--u) * 1); border-left: var(--hair) solid var(--rule); min-width: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.head a { color: inherit; text-decoration: none; }
.head a:hover { color: var(--print); text-decoration: underline; text-underline-offset: 0.2em; }

/* ───────── 빈 자리와 도움말 ───────── */
.empty { margin: calc(var(--u) * 1) 0; font-size: var(--fs-s); color: var(--print-soft); line-height: 1.6; }
.hint { margin: calc(var(--u) * 0.6) 0 0; font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.6; }
.hint code, .path { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.95em; }

/* ───────── 주간 ───────── */
.week {
  flex: 1;
  min-height: 0;
  /* 쪽마다 네 칸: 위아래 두 단, 한 단에 두 칸 */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  margin-top: calc(var(--u) * -0.5);
}
.week > :nth-child(n + 3) { margin-top: calc(var(--u) * 0.9); padding-top: calc(var(--u) * 0.9); border-top: var(--hair) solid var(--rule-strong); }
.week > :nth-child(odd) { border-left: 0; padding-left: 0; }
.week-side { display: flex; flex-direction: column; gap: calc(var(--u) * 0.8); min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; padding-right: calc(var(--u) * 1); }
.week-side .block > .label { padding-top: calc(var(--u) * 0.1); }
.daycol {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: calc(var(--u) * 0.5);
  padding: 0 calc(var(--u) * 0.6) calc(var(--u) * 0.3);
  border-left: var(--hair) solid var(--rule);
}
.daycol-head {
  display: flex;
  align-items: baseline;
  gap: calc(var(--u) * 0.45);
  min-height: calc(var(--u) * 2.4);
  padding-bottom: calc(var(--u) * 0.3);
  border-bottom: var(--hair) solid var(--rule-strong);
}
.daycol-head .stickers { margin-left: auto; align-self: center; gap: calc(var(--u) * 0.25); }
.daycol-head .stamp { font-size: var(--fs-xs); padding: calc(var(--u) * 0.1) calc(var(--u) * 0.3) calc(var(--u) * 0.04); border-width: calc(var(--u) * 0.13); }
.daycol-head .mark-sticker svg { width: calc(var(--u) * 1.4); height: calc(var(--u) * 1.4); }
.daycol-num { font-size: var(--fs-xl); font-weight: 800; line-height: 1; color: var(--print); text-decoration: none; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.daycol-wd { font-size: var(--fs-s); font-weight: 600; color: var(--print-soft); }
.daycol.red .daycol-num, .daycol.red .daycol-wd { color: var(--stamp); }
.daycol.blue .daycol-num, .daycol.blue .daycol-wd { color: var(--sat); }
.daycol.is-today .daycol-num { display: grid; place-items: center; min-inline-size: 1.15em; min-block-size: 1.15em; }
/* 요일 머리의 작은 글(음력·공휴일·기념일). 길면 줄을 바꿔 머리가 높아진다. */
.daycol-head .date-notes { flex: 1 1 0; min-width: 0; font-size: var(--fs-xs); }
.daycol-head .stickers { flex: none; }
/* 왼쪽 면의 "이 주의 주요 프로젝트" 이름줄을 첫 요일 머리와 같은 높이·같은 바닥에 맞춘다 */
.week-side > .block:first-child > .label { display: flex; align-items: flex-end; box-sizing: border-box; min-block-size: calc(var(--u) * 2.4); padding-block: 0 calc(var(--u) * 0.3); }
/* 일정 줄은 줄어들지 않고(줄어들면 글자가 서로 겹친다), 할 일이 많으면 할 일 목록이 그 칸 안에서 내려간다 */
.daycol > .lines { flex: none; }
.daycol > .mini-tasks { flex: 1 1 0; min-height: 0; }
.daycol .line { white-space: normal; font-size: var(--fs-s); }
.daycol .line-title { overflow: visible; }

.mini-tasks { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.mini-task {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--u) * 1.5) minmax(0, 1fr) auto;
  align-items: start;
  padding: calc(var(--u) * 0.3) 0;
  border-bottom: var(--hair) solid var(--rule);
  font-size: var(--fs-s);
  line-height: 1.38;
}
.mini-task .mark { font-size: var(--fs-m); height: auto; padding-top: calc(var(--u) * 0.1); place-items: start; }
.mini-title { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.mini-prio { margin-right: calc(var(--u) * 0.35); font-weight: 800; }
.mini-when { margin-right: calc(var(--u) * 0.4); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-task.is-done .mini-title, .mini-task.is-cancelled .mini-title { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: var(--hair); }
.mini-task.is-deferred .mini-title, .mini-task.is-delegated .mini-title { color: var(--ink-soft); }
.mini-task .more > summary { width: 24px; height: 24px; }
.mini-task .more-icon { width: 16px; height: 16px; }
.mini-task:hover .more > summary, .mini-task:focus-within .more > summary { opacity: 1; }
.mini-task .more-body { width: calc(var(--u) * 21); }
.week > :nth-child(odd) .more-body { right: auto; left: 0; }
/* 칸보다 많으면 그 칸 안에서 내려 보는데, 아래가 반쯤 잘린 줄만 보이면 깨진 것처럼 보인다.
 * 아래에 더 있을 때만 가장자리에 옅은 그림자를 둔다(맨 아래까지 내리면 사라진다). 위쪽도 같다. */
.mini-tasks {
  background:
    linear-gradient(var(--paper) 30%, transparent) center top / 100% calc(var(--u) * 1.6) no-repeat local,
    linear-gradient(transparent, var(--paper) 70%) center bottom / 100% calc(var(--u) * 1.6) no-repeat local,
    radial-gradient(farthest-side at 50% 0, #2b302c2e, transparent) center top / 100% calc(var(--u) * 0.7) no-repeat scroll,
    radial-gradient(farthest-side at 50% 100%, #2b302c2e, transparent) center bottom / 100% calc(var(--u) * 0.7) no-repeat scroll;
}
.mini-add { margin-top: auto; border-top: var(--hair) solid var(--rule); }
.mini-add input::placeholder { color: var(--print-faint); font-weight: 400; font-size: var(--fs-l); line-height: 1; }
.mini-add input { width: 100%; padding: calc(var(--u) * 0.45) 0; font-size: var(--fs-s); }
.mini-tasks + .mini-add { border-top: 0; }
.week-side .mini-add { margin-top: 0; }

/* 최종 시안(2026-11-26)의 주간 2×2 칸: 가운데 세로선 하나, 칸마다 안쪽 여백, 윗단과 아랫단 사이를 좁게.
   일정·할 일 줄은 한 줄 높이를 줄여 더 많이 보이고, 새로 적는 줄은 아래 가는 줄 하나만 둔다. */
[data-tab="week"] .week:not(.week-roomy) {
  --week-inset: calc(var(--u) * 0.8);
  background: linear-gradient(var(--rule), var(--rule)) center / var(--hair) 100% no-repeat;
}
[data-tab="week"] .week:not(.week-roomy) > :nth-child(odd) { border-inline-start: 0; padding-inline: 0 var(--week-inset); }
[data-tab="week"] .week:not(.week-roomy) > :nth-child(even) { border-inline-start: 0; padding-inline: var(--week-inset) 0; }
[data-tab="week"] .week:not(.week-roomy) > :nth-child(n + 3) { margin-top: calc(var(--u) * 0.48); padding-top: calc(var(--u) * 0.55); }
[data-tab="week"] .week:not(.week-roomy) > .daycol { overflow: hidden; }
[data-tab="week"] .week:not(.week-roomy) .mini-tasks > .lines { display: flex; flex-direction: column; gap: 0.17em; margin-block-end: 0.35em; }
[data-tab="week"] .daycol { gap: calc(var(--u) * 0.38); }
[data-tab="week"] .mini-task { align-items: center; }
[data-tab="week"] .mini-task > .mark { padding-block: 0; place-items: center; }
[data-tab="week"] .mini-tasks { background: none; }
[data-tab="week"] .daycol > .mini-tasks { flex: 0 1 auto; overscroll-behavior: contain; }
[data-tab="week"] .daycol .mini-tasks > .mini-add { flex: none; margin-top: 0; border-top: 0; border-bottom: var(--hair) solid var(--rule); }
[data-tab="week"] .daycol .mini-tasks > .mini-add input::placeholder { font: inherit; color: var(--print-faint); }

/* ───────── 연간 ───────── */
/* 여섯 달씩의 묶음은 넓은 화면에서는 없는 것처럼 두고(열두 달이 한 격자), 좁은 화면에서는 묶음이 한 화면이 된다 */
.minis-half { display: contents; }
/* 반년 고르기는 휴대폰에서만 쓴다(아래 좁은 화면 규칙에서 켠다) */
.minis-switch { display: none; }
@media (max-width: 699px) {
  .minis-switch { display: inline-flex; align-self: flex-start; padding: 3px; border-radius: 999px; background: var(--ink-wash); }
  .minis-switch button { height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--print-soft); font: inherit; font-size: 13px; font-weight: 600; }
  .minis-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
}
.minis {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: calc(var(--u) * 1.1) calc(var(--u) * 2);
}
.mini { display: flex; flex-direction: column; gap: calc(var(--u) * 0.25); min-height: 0; }
.mini-name { align-self: flex-start; font-size: var(--fs-m); font-weight: 800; color: var(--print); text-decoration: none; line-height: 1.1; }
.mini-name:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: calc(var(--u) * 0.05); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.mini-dow { text-align: center; color: var(--print-faint); font-size: calc(var(--u) * 0.66); padding-bottom: calc(var(--u) * 0.15); border-bottom: var(--hair) solid var(--rule); margin-bottom: calc(var(--u) * 0.15); }
.mini-day {
  position: relative;
  display: grid;
  place-items: center;
  height: calc(var(--u) * 1.42);
  color: var(--print);
  text-decoration: none;
  line-height: 1;
  border-radius: calc(var(--u) * 0.2);
}
a.mini-day:hover { background: var(--ink-wash); }
.mini-day.red { color: var(--stamp); }
.mini-day.blue { color: var(--sat); }
.mini-day.is-today { box-shadow: inset 0 0 0 calc(var(--u) * 0.13) var(--ink); border-radius: 50%; font-weight: 800; }
.mini-day.is-busy::after {
  content: "";
  position: absolute;
  bottom: calc(var(--u) * 0.06);
  width: calc(var(--u) * 0.24);
  height: calc(var(--u) * 0.24);
  border-radius: 50%;
  background: var(--ink);
}
.mini-day.is-away { background: color-mix(in srgb, var(--sat) 18%, transparent); font-weight: 700; }
.mini-day.is-off { background: color-mix(in srgb, var(--stamp) 20%, transparent); font-weight: 700; }

.year-goals { max-height: 34%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; margin-top: calc(var(--u) * -1.3); }
.strip {
  display: grid;
  grid-template-columns: calc(var(--u) * 2.5) repeat(31, minmax(0, 1fr));
  margin-top: calc(var(--u) * 0.7);
  font-size: calc(var(--u) * 0.62);
  font-variant-numeric: tabular-nums;
}
.strip-day { text-align: center; color: var(--print-faint); padding-bottom: calc(var(--u) * 0.2); }
.strip-month { font-size: var(--fs-xs); font-weight: 700; color: var(--print); text-decoration: none; align-self: center; }
.strip-month:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.strip-cell {
  position: relative;
  height: calc(var(--u) * 1.72);
  border-right: var(--hair) solid var(--rule);
  border-bottom: var(--hair) solid var(--rule);
}
.strip-month + .strip-cell { border-left: var(--hair) solid var(--rule); }
.strip-day:nth-child(-n + 32) ~ .strip-cell:nth-child(-n + 64) { border-top: var(--hair) solid var(--rule); }
a.strip-cell:hover { outline: calc(var(--u) * 0.12) solid var(--ink); outline-offset: calc(var(--u) * -0.06); z-index: 1; }
.strip-cell.red { background: color-mix(in srgb, var(--stamp) 9%, transparent); }
.strip-cell.blue { background: color-mix(in srgb, var(--sat) 8%, transparent); }
.strip-cell.is-none { background: repeating-linear-gradient(135deg, transparent 0 22%, var(--rule) 22% 28%); border-bottom-color: transparent; }
.strip-cell.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: calc(var(--u) * 0.32);
  height: calc(var(--u) * 0.32);
  border-radius: 50%;
  background: var(--ink);
}
.strip-cell.is-away { background: var(--sat); }
.strip-cell.is-off { background: var(--stamp); }
.strip-cell.is-away::after, .strip-cell.is-off::after { background: #fff; }
.strip-cell.is-today { box-shadow: inset 0 0 0 calc(var(--u) * 0.16) var(--ink); }
.legend { list-style: none; margin: calc(var(--u) * 0.9) 0 0; padding: 0; display: flex; gap: calc(var(--u) * 1.6); font-size: var(--fs-xs); color: var(--print-soft); }
.legend li { display: flex; align-items: center; gap: calc(var(--u) * 0.45); }
.legend-box { position: relative; width: calc(var(--u) * 1); height: calc(var(--u) * 1); border: var(--hair) solid var(--rule); }
.legend-box.is-off { background: var(--stamp); border-color: var(--stamp); }
.legend-box.is-away { background: var(--sat); border-color: var(--sat); }
.legend-box.red { background: color-mix(in srgb, var(--stamp) 9%, transparent); }
.legend-box.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto; width: calc(var(--u) * 0.32); height: calc(var(--u) * 0.32); border-radius: 50%; background: var(--ink); }
a.label-note { text-decoration: none; }
a.label-note:hover { color: var(--print); }

/* ───────── 프로젝트 ───────── */
.projects { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; display: flex; flex-direction: column; gap: calc(var(--u) * 1.4); }
.project-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto calc(var(--u) * 7) calc(var(--u) * 3);
  align-items: center;
  gap: calc(var(--u) * 1);
  min-height: var(--row);
  padding: 0 calc(var(--u) * 0.5);
  border-bottom: var(--hair) solid var(--rule);
  /* 프로젝트에 색을 골랐으면 서버가 --project-ink를 내려 준다. 안 골랐으면 기본 잉크색. */
  color: var(--project-ink, var(--ink));
  text-decoration: none;
}
.project-row:hover { background: var(--ink-wash); }
.project-row[aria-current="page"] { background: color-mix(in srgb, var(--project-ink, var(--ink)) 9%, transparent); box-shadow: inset calc(var(--u) * 0.28) 0 0 var(--project-ink, var(--ink)); }
.project-name { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-meta { font-size: var(--fs-xs); color: var(--print-soft); white-space: nowrap; }
.project-bar { height: calc(var(--u) * 0.5); border: var(--hair) solid var(--rule-strong); background: linear-gradient(90deg, var(--project-ink, var(--ink)) calc(var(--done) * 100%), transparent 0); }
.project-count { font-size: var(--fs-xs); color: var(--print-soft); text-align: right; font-variant-numeric: tabular-nums; }
.project-row.is-done .project-name { color: color-mix(in srgb, var(--project-ink, var(--ink)) 55%, transparent); text-decoration: line-through; text-decoration-thickness: var(--hair); }
.project-row:is(.is-paused,.is-planned,.is-cancelled) .project-name { color: color-mix(in srgb, var(--project-ink, var(--ink)) 55%, transparent); }
.project-index-head { justify-content: flex-start; flex-wrap: wrap; align-items: baseline; gap: .35em .85em; }
.project-status-summary { min-width: 0; font-size: var(--fs-xs); color: var(--print-soft); }
.project-add { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: calc(var(--u) * 1); align-items: center; padding-top: calc(var(--u) * 0.6); border-top: var(--hair) solid var(--rule-strong); }
.project-add input { height: var(--row); border-bottom: var(--hair) solid var(--rule); }
/* 휴대폰: 세 칸을 한 줄에 두면 안내 글이 잘린다. 이름을 한 줄 통째로 쓰고, 묶음과 단추를 그 아래에 둔다. */
@media (max-width: 699px) {
  .project-add { grid-template-columns: minmax(0, 1fr) auto; }
  .project-add input[name="name"] { grid-column: 1 / -1; }
  /* 프로젝트 내용: 위의 칸들이 화면 절반을 쓰므로, 할 일 목록을 작은 틀 안에서 따로 굴리면 다섯 줄밖에 안 보이고
   * 맨 아래의 적는 칸이 숨는다. 목록을 다 펴고 쪽 전체를 내려 보게 한다. */
  body[data-tab="projects"] .page.right > .block.grow { flex: none; }
  body[data-tab="projects"] .page.right .task-list { flex: none; overflow: visible; }
}

.project-form { display: flex; flex-direction: column; gap: calc(var(--u) * 0.8); margin-top: calc(var(--u) * -0.3); }
.project-title { width: 100%; font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
/* 제목 글씨도 고른 프로젝트 색을 따른다(색 점·제목 아래 줄과 같은 색). 안 골랐으면 `.ink`의 잉크색 그대로. */
.project-form .project-title { color: var(--project-ink, var(--ink)); }
.project-title-row { display: flex; align-items: center; gap: .55em; }
.project-title-row .project-title { min-width: 0; }
.project-ink { position: relative; flex: none; }
.project-ink summary { display: grid; place-items: center; width: 24px; height: 28px; cursor: pointer; }
.project-ink summary::-webkit-details-marker { display: none; }
.project-ink summary span { width: 12px; height: 12px; border: 1px solid var(--rule-strong); border-radius: 50%; background: var(--paper); }
.project-pencils {
  position: absolute;
  z-index: 8;
  inset: 100% auto auto 0;
  width: min(270px, 65vw);
  padding: .6em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: 0 4px 20px #0002;
}
.project-pencils > button { margin-bottom: .45em; border: 1px solid var(--rule); border-radius: 4px; background: transparent; color: var(--print); }
.project-sheet-close { display: none; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: calc(var(--u) * 1); }
.fields :is(label,.product-field), .leave-add label { display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); min-width: 0; }
.fields :is(label,.product-field) > span, .leave-add label > span { font-size: var(--fs-xs); color: var(--print-soft); }
.fields input, .fields select, .leave-add input, .leave-add select {
  width: 100%;
  padding: calc(var(--u) * 0.3) 0;
  border: 0;
  border-bottom: var(--hair) solid var(--rule-strong);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-m);
  font-weight: 500;
}
.project-delete { text-align: right; }
.plain-button.danger { color: var(--stamp); border-color: #c8382c66; }
.plain-button.danger:hover { border-color: var(--stamp); color: var(--stamp); }

/* ───────── 근태 ───────── */
.label-row > .label { margin-right: auto; }
.more.rules { position: static; }
.more.rules > summary { display: block; width: auto; min-width: 0; height: auto; line-height: inherit; padding: 0; border-radius: 0; opacity: 1; font-size: var(--fs-xs); font-weight: 400; letter-spacing: 0; color: var(--print-soft); text-decoration: underline; text-underline-offset: 0.25em; cursor: pointer; }
.more.rules > summary:hover, .more.rules[open] > summary { background: none; color: var(--ink); }
details.more.rules > .more-body { display: block; width: min(460px, calc(100vw - 32px)) !important; }
details.more.rules > .more-body > * + * { margin-top: 12px; }
details.more.rules .cuts-form { margin: 12px 0; gap: 2px; font-size: 14px; }
details.more.rules .cuts-hours { grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
details.more.rules .cuts-hours label > span { font-size: 12px; font-weight: 600; color: var(--print-soft); }
details.more.rules .cuts-head, details.more.rules .cut-row { grid-template-columns: minmax(0, 1fr) 96px 104px; gap: 8px; }
details.more.rules .cuts-head { font-size: 12px; }
details.more.rules .cut-row { padding: 3px 0; }
details.more.rules .cut-row input, details.more.rules .cut-row select { height: 32px; font-size: 14px; }
.allowance { position: relative; display: flex; align-items: center; gap: calc(var(--u) * 0.5); font-size: var(--fs-xs); color: var(--print-soft); }
.allowance-now b { margin: 0 calc(var(--u) * 0.1) 0 calc(var(--u) * 0.2); font-size: var(--fs-m); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.allowance .gear { position: static; }
.allowance .gear > summary { display: grid; place-items: center; width: calc(var(--u) * 2); height: calc(var(--u) * 2); padding: 0; opacity: 0.7; color: var(--print-soft); border-radius: 50%; cursor: pointer; }
.allowance .gear > summary:hover, .allowance .gear[open] > summary { opacity: 1; color: var(--ink); background: var(--ink-wash); }
.allowance .gear svg { width: calc(var(--u) * 1.3); height: calc(var(--u) * 1.3); }
.allowance .more-body { width: calc(var(--u) * 15); grid-template-columns: 1fr; transform: none; }
.allowance .more-body input { font-size: var(--fs-m); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.figures { display: grid; grid-template-columns: repeat(3, 1fr); margin: calc(var(--u) * 1) 0 calc(var(--u) * 0.9); }
.figures div { display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); padding-left: calc(var(--u) * 1); border-left: var(--hair) solid var(--rule); }
.figures div:first-child { padding-left: 0; border-left: 0; }
.figures dt { font-size: var(--fs-xs); color: var(--print-soft); }
.figures dd { margin: 0; font-size: calc(var(--u) * 2.6); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.figures dd::after { content: "일"; margin-left: calc(var(--u) * 0.25); font-size: var(--fs-s); font-weight: 500; color: var(--print-soft); letter-spacing: 0; }
.figures .is-main dd { color: var(--ink); }
.figures small { font-size: var(--fs-xs); color: var(--print-soft); }
/* 숫자와 단위("12.27일")는 한 줄에 둔다. 좁은 화면에서는 숫자를 조금 줄여 칸에 들어가게 한다 */
.figures dd { white-space: nowrap; }
@media (max-width: 699px) { .figures dd { font-size: 25px; } .figures div { padding-left: 10px; } }
/* 받은 연차를 가는 막대 하나로: 쓴 만큼은 칠하고, 잡아 둔 만큼은 빗금 */
.leave-bar { display: flex; height: calc(var(--u) * 0.8); margin-top: calc(var(--u) * 0.2); border-radius: 999px; background: var(--paper-edge); overflow: hidden; }
.leave-bar > i { display: block; height: 100%; }
.leave-bar > .is-used { background: var(--stamp); }
.leave-bar > .is-planned { background: repeating-linear-gradient(135deg, #c8382c66 0 3px, #c8382c26 3px 6px); }
.leave-entry > summary { width: fit-content; list-style: none; cursor: pointer; color: var(--print-soft); border-bottom: var(--hair) solid var(--rule); padding: .55em 0; }
.leave-entry > summary::-webkit-details-marker { display: none; }
.leave-entry-actions, .leave-filter { display: flex; align-items: center; justify-content: flex-end; gap: .6em; }
.special-leave-types, .leave-time-fields, .leave-duration-hint { display: none; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="special"]:checked) .special-leave-types {
  display: flex;
  flex-wrap: wrap;
  gap: .35em .8em;
  min-width: 0;
  margin: .35em 0;
  padding: .35em .65em;
  border: var(--hair) solid var(--rule);
}
.special-leave-types legend, .leave-duration-hint { color: var(--print-soft); font-size: var(--fs-s); }
.special-leave-types label { display: inline-flex; flex-direction: row; align-items: center; gap: .25em; }
.special-leave-types input[type="checkbox"] { width: auto; accent-color: var(--print); }
.leave-duration { justify-self: start; }
:is(.leave-add, .ledger-row):has(input[name="portion"][value="timed"]:checked) .leave-time-fields { display: block; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="annual"]:checked) .leave-duration-hint {
  display: block;
  margin: 0;
}
.ledger-row:has(select[name="kind"] :is(option[value="half_am"], option[value="half_pm"], option[value="quarter"]):checked)
  :is(.leave-duration, .leave-time-fields) { display: none; }
.leave-filter label { color: var(--print-soft); }
.kinds { list-style: none; margin: calc(var(--u) * 0.7) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: calc(var(--u) * 0.5) calc(var(--u) * 1.6); font-size: var(--fs-s); }
.kinds li { display: flex; gap: calc(var(--u) * 0.5); align-items: baseline; }
.kinds li::before { content: ""; align-self: center; width: calc(var(--u) * 0.6); height: calc(var(--u) * 0.6); background: var(--stamp); }
.kinds li.is-away::before { background: var(--sat); }
.kinds b { font-weight: 700; }
/* 근태 기록: 자세히 창과 같은 틀(이름 왼쪽·칸 오른쪽, 짝은 한 줄)로 쪽 위에 놓는다 */
.leave-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 0.5); margin-top: calc(var(--u) * 0.7); }
.leave-add > label, .leave-add > .field-row { display: grid; grid-template-columns: calc(var(--fs-s) * 2.6) minmax(0, 1fr); align-items: center; gap: calc(var(--u) * 0.9); }
.leave-add > label > span:first-child, .leave-add .field-label { font-size: var(--fs-s); font-weight: 600; color: var(--print-soft); white-space: nowrap; }
.leave-add .field-pair { gap: calc(var(--u) * 0.6); }
.field-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: calc(var(--u) * 0.9); }
.leave-add .leave-add-go { justify-self: end; margin-top: calc(var(--u) * 0.4); padding-left: calc(var(--u) * 1.6); padding-right: calc(var(--u) * 1.6); font-weight: 600; }
/* 쪽 안의 만들기는 테두리 알약(채움은 창의 확정만): 2026-11-26 사용자가 정함. 기본 `.plain-button`의 모양을 그대로 쓴다. */
/* 반차·반반차를 고르면 스크립트가 사용 방식과 시각 줄에 hidden을 건다. 위의 display 규칙이 hidden을 이기지 않게 한다. */
.leave-add [hidden] { display: none !important; }

.ledger { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; margin-top: calc(var(--u) * -0.5); }
.ledger-head, .ledger-row {
  display: grid;
  grid-template-columns: calc(var(--u) * 11) calc(var(--u) * 6) minmax(0, 1fr) calc(var(--u) * 5) calc(var(--u) * 2);
  align-items: center;
  gap: calc(var(--u) * 0.6);
}
.ledger-head { padding-bottom: calc(var(--u) * 0.4); border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-xs); color: var(--print-soft); font-weight: 600; }
.ledger-row { position: relative; min-height: var(--row); border-bottom: var(--hair) solid var(--rule); color: var(--ink); font-weight: 500; }
.ledger-row.is-ahead { color: var(--ink-soft); }
.ledger-date { color: inherit; text-decoration: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-date:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.ledger-kind { font-weight: 700; color: var(--stamp); }
.ledger-row.is-away .ledger-kind { color: var(--sat); }
.ledger-what { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ledger-place { margin-left: calc(var(--u) * 0.6); font-size: var(--fs-xs); color: var(--print-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.ledger-row .more > summary { opacity: 1; text-align: right; }

/* ───────── 설정 ───────── */
.choices { display: flex; gap: calc(var(--u) * 2); margin-top: calc(var(--u) * 0.8); }
.choices label { display: flex; align-items: center; gap: calc(var(--u) * 0.5); color: var(--ink); font-weight: 500; cursor: pointer; }
.choices input { accent-color: var(--ink); width: calc(var(--u) * 1.1); height: calc(var(--u) * 1.1); margin: 0; }
.path { margin: calc(var(--u) * 0.8) 0 0; color: var(--ink); overflow-wrap: anywhere; }

/* 연간 쪽 아래: 그해의 쉬는 날과 자리를 비우는 날 */
.year-lists {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: calc(var(--u) * 2);
  margin-top: calc(var(--u) * 1.2);
  overflow: hidden;
}
.year-list { display: flex; flex-direction: column; min-height: 0; font-size: var(--fs-xs); }
.year-list > .label { padding-bottom: calc(var(--u) * 0.42); border-bottom: var(--hair) solid var(--rule-strong); }
/* 목록이 자리보다 길면 그 안에서 내려 본다. 전에는 넘친 줄을 그냥 가려서(쉬는 날은 보이지 않는 셋째 단으로 밀려서)
 * 목표를 몇 줄 적으면 연말의 공휴일이 말없이 사라졌다. */
.year-list ul { list-style: none; margin: calc(var(--u) * 0.4) 0 0; padding: 0; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.year-list.is-holidays ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: calc(var(--u) * 1.6); align-content: start; }
.year-list li { break-inside: avoid; }
.year-list a { display: flex; gap: calc(var(--u) * 0.6); align-items: baseline; padding: calc(var(--u) * 0.1) 0; color: var(--ink); text-decoration: none; line-height: 1.35; }
.year-list a:hover .year-list-what { text-decoration: underline; text-underline-offset: 0.2em; }
.year-list-date { flex: none; min-width: calc(var(--u) * 3.9); font-variant-numeric: tabular-nums; font-weight: 500; }
.year-list.is-holidays .year-list-date { color: var(--stamp); }
.year-list.is-holidays .year-list-what { color: var(--print); }
.year-list b { flex: none; color: var(--stamp); font-weight: 700; }
.year-list .is-away b { color: var(--sat); }
.year-list-what { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--print-soft); }
.year-list .is-past a { opacity: 0.55; }
.year-list .empty { margin: calc(var(--u) * 0.6) 0 0; }

/* ───────── 설정: 달력 구독과 내보내기 ───────── */
.text-button { padding: 0; border: 0; background: none; color: var(--ink); font-size: var(--fs-xs); font-weight: 600; text-decoration: underline; text-underline-offset: 0.25em; }
.text-button:hover { color: var(--print); }
.oops { margin: calc(var(--u) * 0.7) 0 0; padding: calc(var(--u) * 0.5) calc(var(--u) * 0.8); border-left: calc(var(--u) * 0.25) solid var(--stamp); background: #c8382c12; color: var(--print); font-size: var(--fs-s); line-height: 1.5; }
.sub {
  position: relative;
  display: grid;
  grid-template-columns: calc(var(--u) * 1.5) minmax(0, 1fr) auto auto auto;
  align-items: center;
  column-gap: calc(var(--u) * 0.9);
  padding: calc(var(--u) * 0.5) 0 calc(var(--u) * 0.45);
  border-bottom: var(--hair) solid var(--rule);
}
.sub-color { width: calc(var(--u) * 1.3); height: calc(var(--u) * 1.3); padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
.sub-color::-webkit-color-swatch-wrapper { padding: 0; }
.sub-color::-webkit-color-swatch { border: 0; border-radius: 50%; }
.sub-name { font-weight: 600; height: calc(var(--u) * 1.8); }
.sub.is-off .sub-name { color: var(--ink-soft); }
.tick { display: flex; align-items: center; gap: calc(var(--u) * 0.35); font-size: var(--fs-xs); color: var(--print-soft); cursor: pointer; white-space: nowrap; }
.tick input[type="checkbox"] { width: calc(var(--u) * 1); height: calc(var(--u) * 1); margin: 0; accent-color: var(--ink); }
.sub .row-del { opacity: 1; }
.sub-status { grid-column: 2 / -1; margin: 0; font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.5; }
.sub-status.is-wrong { color: var(--stamp); }
.sub-host { margin-right: calc(var(--u) * 0.7); color: var(--print-faint); }
.sub-add { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.6fr) auto; gap: calc(var(--u) * 0.9); align-items: center; padding-top: calc(var(--u) * 0.6); }
.sub-add input { height: var(--row); border-bottom: var(--hair) solid var(--rule); }
.howto { margin-top: calc(var(--u) * 0.7); font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.6; }
.howto summary { cursor: pointer; color: var(--print); font-weight: 600; }
.howto dl { margin: calc(var(--u) * 0.5) 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: calc(var(--u) * 0.35) calc(var(--u) * 1); }
.howto dt { color: var(--print); font-weight: 600; white-space: nowrap; }
.howto dd { margin: 0; }
.hint.is-warning { padding-left: calc(var(--u) * 0.7); border-left: calc(var(--u) * 0.2) solid var(--stamp); color: var(--print); }
.feed-reset { margin-top: calc(var(--u) * 0.7); }
body[data-tab="settings"] .page { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
body[data-tab="settings"] .block { flex: none; }

/* ───────── 설정: 노션 ───────── */
.state { margin: calc(var(--u) * 0.8) 0 0; font-size: var(--fs-m); color: var(--ink); line-height: 1.5; }
.steps { margin: calc(var(--u) * 0.7) 0 0; padding-left: calc(var(--u) * 1.6); font-size: var(--fs-s); color: var(--print); line-height: 1.65; }
.steps li { padding: calc(var(--u) * 0.15) 0; }
.steps .path, .steps .sample { display: block; margin: calc(var(--u) * 0.2) 0; font-size: 0.95em; }
.sample { font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink); background: var(--ink-wash); padding: calc(var(--u) * 0.2) calc(var(--u) * 0.5); width: fit-content; }
.pages { display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); margin: calc(var(--u) * 0.6) 0 calc(var(--u) * 0.8); max-height: calc(var(--u) * 14); overflow-y: auto; }
.pages label { display: flex; align-items: center; gap: calc(var(--u) * 0.5); padding: calc(var(--u) * 0.25) 0; color: var(--ink); font-weight: 500; cursor: pointer; border-bottom: var(--hair) solid var(--rule); }
.pages input { accent-color: var(--ink); margin: 0; }
.sync-facts { margin: calc(var(--u) * 0.8) 0 0; display: grid; grid-template-columns: auto 1fr; gap: calc(var(--u) * 0.3) calc(var(--u) * 1.2); font-size: var(--fs-s); }
.sync-facts dt { color: var(--print-soft); }
.sync-facts dd { margin: 0; color: var(--ink); font-weight: 600; }
.sync-actions { display: flex; align-items: center; gap: calc(var(--u) * 1.4); margin-top: calc(var(--u) * 0.9); }

/* ───────── 좁은 창: 두 쪽을 위아래로 놓는다 ─────────
 * 펼침면이 들어가지 않는 너비에서는 책을 한 쪽 너비로 줄이고 왼쪽·오른쪽 쪽을 차례로 쌓는다.
 * 자(--u)를 "한 쪽 너비의 2%"로 바꾸므로 글자와 칸의 비례는 펼쳤을 때와 같다.
 */
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  .desk { place-items: start center; padding: 22px 82px 28px 12px; }
  .book {
    --w: clamp(560px, 100vw - 84px, 720px);
    height: auto;
    container-type: inline-size;
    --u: 2cqw;
  }
  .spread { position: relative; inset: auto; grid-template-columns: minmax(0, 1fr); }
  .page, .page.left, .page.right { min-height: calc(var(--u) * 70.4); padding: calc(var(--u) * 2.9) calc(var(--u) * 3.3) calc(var(--u) * 1.9); }
  .page.right { border-top: var(--hair) dashed var(--rule-strong); }
  .spread::after { display: none; }
  .tabs { position: fixed; left: auto; right: 8px; top: 12px; width: 70px; }
  .tray, .inktray { position: fixed; right: 82px; bottom: 18px; transform: none; }
  .month-right { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.2fr); }
  /* (여기에 있던 "설정 쪽은 넘쳐도 그대로 둔다"는 면을 아래로 쌓던 때의 것이다. 지금은 면 하나가 화면 하나라서,
   * 그 규칙이 남아 있으면 설정의 아래쪽 줄(저절로 띄우기·저장하는 곳·끄기)이 잘리고 내려지지도 않는다. 2026-11-17에 뺐다.) */
}
.paste { display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); margin-bottom: calc(var(--u) * 0.9); font-size: var(--fs-xs); color: var(--print-soft); }
.paste input { height: calc(var(--u) * 2); border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-s); }
.pages b { font-weight: 700; }
.open-link { margin-left: calc(var(--u) * 0.3); font-size: var(--fs-s); font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 0.2em; white-space: nowrap; }
.pages .name-label { margin-left: calc(var(--u) * 0.6); font-size: var(--fs-xs); font-weight: 400; color: var(--print-soft); }
.pages .page-name { flex: 1; min-width: 0; height: calc(var(--u) * 1.7); border-bottom: var(--hair) solid var(--rule-strong); font-weight: 700; }

/* ───────── 일간: 한 쪽 보기 ───────── */
/* 책은 그대로 두고 쪽 하나만 가운데에 펴 놓는다. 색인과 가름끈이 쪽 가장자리를 따라간다. */
.spread.is-single { inset: 0 20%; grid-template-columns: minmax(0, 1fr); }
.spread.is-single::after { display: none; }
.page.single { padding: calc(var(--u) * 2.4) calc(var(--u) * 3.3) calc(var(--u) * 1.6); gap: calc(var(--u) * 0.9); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.book.is-single .tabs { left: calc(80% + var(--u) * 1.1); }
.page.single .timeline { --hour: calc(var(--u) * 1.7); }
.page.single .block > .label { padding-bottom: calc(var(--u) * 0.3); }
.page.single .label-row { align-items: center; }
/* 한 쪽의 두 묶음은 넓은 화면에서는 없는 것처럼 두고, 차례만 정한다: 날짜, 주요업무, 시간표, 할 일, 메모 */
.single-part { display: contents; }
.single-part > * { flex: none; }
.single-a > :nth-child(1) { order: 0; }
.single-a > :nth-child(2) { order: 1; }
.single-b > :nth-child(1) { order: 2; }
.single-a > :nth-child(3) { order: 3; }
.single-b > :nth-child(2) { order: 4; flex: 1 0 auto; }
.single-b > :nth-child(3) { order: 5; }
/* (일간의 "한 쪽으로 보기"·"두 쪽으로 보기" 링크는 없앴다: 설정의 1D1P·1D2P 토글이 대신한다. 2026-11-26) */
@media (max-width: 699px) {
  .head { position: relative; }
}
/* 단추의 글은 자리가 모자라도 글자마다 꺾이지 않는다(세로로 선 글자가 된다) */
.text-button, .plain-button { white-space: nowrap; word-break: keep-all; }
.head-tools { display: flex; align-items: baseline; gap: calc(var(--u) * 1.5); }
.ev-add { gap: calc(var(--u) * 0.2); }
.ev-add-mark { flex: none; width: calc(var(--u) * 1.4); text-align: center; color: var(--print-faint); font-weight: 700; font-size: var(--fs-m); line-height: 1; }
/* ───────── 제목 옆 물음표: 누르면 쓰는 법이 종이 쪽지로 펼쳐진다 ───────── */
.label-help { position: relative; display: flex; align-items: center; gap: calc(var(--u) * 0.6); flex: none; }
.label-help > .label { white-space: nowrap; }
/* 아주 좁은 화면에서 제목과 넘기기 줄이 한 줄에 못 들어가면, 글자를 꺾지 않고 넘기기 줄을 아랫줄로 내린다 */
.head-plain, .label-row { flex-wrap: wrap; row-gap: calc(var(--u) * 0.5); }
.head-plain > .head-tools, .label-row > .turner { margin-left: auto; }
.help-pop > summary { display: block; list-style: none; cursor: pointer; }
.help-pop > summary::-webkit-details-marker { display: none; }
.help-pop > summary:hover .help-mark, .help-pop[open] .help-mark { border-color: var(--print); background: var(--print); color: var(--paper); }
.help-pop > summary:focus-visible .help-mark { outline: 2px solid var(--ink); outline-offset: 2px; }
.help-sheet {
  position: absolute; z-index: 20; top: calc(100% + var(--u) * 0.5); left: 0;
  width: min(calc(var(--u) * 30), calc(100vw - 56px));
  padding: calc(var(--u) * 0.9) calc(var(--u) * 1.1);
  background: var(--paper); color: var(--print-soft);
  border-radius: calc(var(--u) * 0.5);
  box-shadow: 0 0 0 1px #0000001f, 0 6px 18px #00000040;
  font-size: var(--fs-xs); font-weight: 400; line-height: 1.6;
}
.help-sheet dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 0.15); }
.help-sheet dt { color: var(--print); font-weight: 600; }
.help-sheet dt:not(:first-child) { margin-top: calc(var(--u) * 0.5); }
.help-sheet dd { margin: 0; }
.help-sheet .sample { margin-right: calc(var(--u) * 0.4); display: inline-block; padding: 0 calc(var(--u) * 0.3); }

/* ───────── 일간의 오른쪽 면: 시간표가 남는 높이의 3분의 2, 메모가 3분의 1 ───────── */
.page.right > .schedule { flex: 2 1 0; min-height: auto; }
.page.right > .schedule > .timeline { flex: 1 1 auto; height: auto; min-height: calc(var(--hours) * var(--u) * 1.5); }
.page.right > .schedule ~ .grow { flex: 1 1 0; }
.task-project-pick {
  max-width: calc(var(--u) * 11);
  height: 100%;
  padding: 0 calc(var(--u) * 0.3);
  border: 0;
  background: transparent;
  font-size: var(--fs-xs);
  color: var(--print-soft);
  cursor: pointer;
  appearance: none;
  text-align-last: right;
}
.task-project-pick:hover, .task-project-pick:focus-visible { color: var(--ink); background: var(--ink-wash); }

/* ───────── 설정: 노션 토큰 ───────── */
.token-form { display: flex; align-items: flex-end; gap: calc(var(--u) * 0.8); margin: calc(var(--u) * 0.7) 0; }
.token-form input { flex: 1; min-width: 0; height: calc(var(--u) * 2); border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-s); }
.howto p { margin: calc(var(--u) * 0.4) 0; }

/* ───────── 근태: 하루에 깎는 일수 ───────── */
.cuts-note { margin-left: calc(var(--u) * 0.6); font-weight: 500; color: var(--ink); }
.cuts-form { display: flex; flex-direction: column; gap: calc(var(--u) * 0.2); margin: calc(var(--u) * 0.5) 0; }
.cuts-hours { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: calc(var(--u) * 0.9); margin-bottom: calc(var(--u) * 0.5); }
.cuts-hours label { display: flex; flex-direction: column; gap: calc(var(--u) * 0.15); }
.cuts-hours input { width: 100%; padding: calc(var(--u) * 0.2) 0; border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-s); font-weight: 700; font-variant-numeric: tabular-nums; }
.cuts-head, .cut-row { display: grid; grid-template-columns: 1fr calc(var(--u) * 9) calc(var(--u) * 7); align-items: center; gap: calc(var(--u) * 0.8); }
.cuts-head { padding-bottom: calc(var(--u) * 0.25); border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-xs); color: var(--print-soft); }
.cuts-head .num { text-align: right; }
.cut-row { padding: calc(var(--u) * 0.2) 0; border-bottom: var(--hair) solid var(--rule); color: var(--print); }
.cut-row input { width: 100%; text-align: right; font-size: var(--fs-s); font-weight: 700; font-variant-numeric: tabular-nums; }
.cut-row select { width: 100%; padding: 0; border: 0; background: transparent; font-size: var(--fs-s); color: var(--ink); text-align-last: right; appearance: none; cursor: pointer; }
.cut-row.is-changed .cut-kind { color: var(--ink); font-weight: 600; }
.ledger-time { display: block; font-size: var(--fs-xs); color: var(--print-soft); font-variant-numeric: tabular-nums; }
.together { display: block; font-size: var(--fs-xs); font-weight: 500; color: var(--print-soft); white-space: nowrap; }
.kinds small { margin-left: calc(var(--u) * 0.4); font-size: var(--fs-xs); color: var(--print-soft); }
.wide-hint { grid-column: 1 / -1; color: var(--print-soft); line-height: 1.55; }

/* ───────── 날짜 고르기: 브라우저의 달력 대신 플래너의 종이 ───────── */
input[data-date] { font-variant-numeric: tabular-nums; }
/* 자세히 창(겹 91) 안의 칸에서도 펼쳐지므로 그보다 위에 둔다. 바탕은 다른 창들과 같은 종이색이다. */
.datepop {
  position: absolute;
  z-index: 120;
  width: calc(var(--u) * 21);
  padding: calc(var(--u) * 0.9) calc(var(--u) * 1) calc(var(--u) * 0.7);
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 0 0 1px #0000001f, 0 10px 30px #00000052;
  font-size: var(--fs-s);
  color: var(--print);
  line-height: 1.2;
}
.datepop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: calc(var(--u) * 0.5); padding-bottom: calc(var(--u) * 0.4); border-bottom: var(--hair) solid var(--rule); }
.datepop-title { font-size: var(--fs-m); font-weight: 800; letter-spacing: -0.01em; }
.datepop-nav { width: calc(var(--u) * 2); height: calc(var(--u) * 2); padding: 0; border: 0; background: none; color: var(--ink); font-size: var(--fs-l); line-height: 1; border-radius: 50%; }
.datepop-nav:hover { background: var(--ink-wash); }
.datepop-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: calc(var(--u) * 0.1); text-align: center; }
.datepop-wd { padding-bottom: calc(var(--u) * 0.3); font-size: var(--fs-xs); color: #6d6a4a; }
/* 칸(1fr)은 가로로 넓어서, 너비를 칸에 맡기면 오늘·고른 날의 동그라미가 타원이 된다. 가로세로를 같게 묶고 칸 가운데에 둔다. */
.datepop-day { justify-self: center; width: min(100%, calc(var(--u) * 2.1)); height: auto; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--print); font-size: var(--fs-s); font-weight: 500; font-variant-numeric: tabular-nums; }
.datepop-day:hover { background: var(--ink-wash); }
.datepop-day.is-other { color: #6d6a4a80; }
.datepop-wd.is-sun, .datepop-day.is-sun { color: var(--stamp); }
.datepop-wd.is-sat, .datepop-day.is-sat { color: var(--sat); }
.datepop-day.is-other.is-sun, .datepop-day.is-other.is-sat { opacity: 0.55; }
.datepop-day.is-today { box-shadow: inset 0 0 0 calc(var(--u) * 0.13) var(--ink); font-weight: 800; }
.datepop-day.is-chosen { background: var(--ink); color: var(--paper); box-shadow: none; font-weight: 800; }
.datepop-foot { display: flex; justify-content: space-between; margin-top: calc(var(--u) * 0.5); padding-top: calc(var(--u) * 0.4); border-top: var(--hair) solid var(--rule); }
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) { .datepop { width: calc(var(--u) * 24); } }
/* 시각 맞추기: 오전/오후·시·분 바퀴를 돌려 가운데 줄에 맞춘다(휴대폰의 알림 시각 맞추기와 같은 방식) */
input[data-time] { font-variant-numeric: tabular-nums; }
.datepop.timepop { width: 232px; padding: 10px 12px 10px; border-radius: 14px; }
.wheel { position: relative; display: grid; grid-template-columns: 1.15fr 1fr 1fr; height: 180px; }
/* 가운데 줄의 띠: 여기에 온 것이 고른 값이다 */
.wheel::before { content: ""; position: absolute; left: 0; right: 0; top: 72px; height: 36px; border-radius: 9px; background: var(--ink-wash); pointer-events: none; }
.wheel-col {
  position: relative; box-sizing: border-box; height: 180px; padding: 72px 0;
  overflow-y: auto; scroll-snap-type: y mandatory; overscroll-behavior: contain;
  scrollbar-width: none; outline: 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34%, #000 66%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 34%, #000 66%, transparent 100%);
}
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-item { height: 36px; display: grid; place-items: center; scroll-snap-align: center; font-size: 18px; font-weight: 500; color: var(--print-soft); font-variant-numeric: tabular-nums; cursor: pointer; user-select: none; }
.wheel-item.is-on { color: var(--ink); font-size: 21px; font-weight: 700; }
.timepop-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.timepop-done { margin-left: auto; height: 34px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--print); color: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; }
.timepop-done:hover { background: #000; }
@media (max-width: 699px) { .datepop.timepop { width: 248px; } }

/* 휴대폰용 월간 달력(넓은 화면에서는 숨긴다) */
.month-phone { display: none; }
.phone-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.phone-grid .dow { padding: 0 0 6px; text-align: center; }
.phone-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 46px; padding: 6px 0 4px; border-bottom: var(--hair) solid var(--rule); color: var(--print); text-decoration: none; }
.phone-num { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.phone-cell.red .phone-num { color: var(--stamp); }
.phone-cell.blue .phone-num { color: var(--sat); }
.phone-cell.is-dim { opacity: 0.35; }
.phone-dots { display: flex; gap: 3px; height: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.dot-task { background: none; box-shadow: inset 0 0 0 1px var(--ink); }
.phone-agenda { margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.phone-agenda > li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 8px 0; border-bottom: var(--hair) solid var(--rule); }
.phone-day { color: var(--print); text-decoration: none; font-size: 13px; }
.phone-day b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.phone-day.red { color: var(--stamp); }
.phone-day.blue { color: var(--sat); }
.phone-agenda .line { white-space: normal; }

/* ───────── 태블릿·휴대폰 ─────────
 * 1200px 이상: 펼침면(두 쪽). 700~1199px(태블릿): 쪽을 위아래로 쌓고 색인은 오른쪽에 붙인다.
 * 700px 미만(휴대폰): 책을 화면 너비에 맞추고, 글자는 읽을 만한 크기로 고정하며, 색인은 아래 막대로 내린다.
 * 한 쪽 보기는 좁은 화면에서 어차피 한 쪽이므로 가운데 정렬 설정을 풀어 준다. */
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  .spread.is-single { inset: auto; }
  .book.is-single .tabs { left: auto; }
  .page.single { overflow-y: visible; }
  .book { --w: clamp(320px, 100vw - 84px, 720px); }
}
@media (max-width: 699px) {
  .desk { padding: 8px 8px 76px; }
  .book {
    --w: calc(100vw - 16px);
    --u: 3.6cqw;
    --fs-xs: 11.5px;
    --fs-s: 13px;
    --fs-m: 14.5px;
    --fs-l: 17px;
    --fs-xl: 24px;
    --fs-xxl: 44px;
    --row: 40px;
  }
  .page, .page.left, .page.right, .page.single {
    min-height: 0;
    padding: calc(var(--u) * 1.8) calc(var(--u) * 1.6) calc(var(--u) * 1.5);
    gap: calc(var(--u) * 1.2);
  }
  .page.left { padding-right: calc(var(--u) * 1.6); }
  .page.right { padding-left: calc(var(--u) * 1.6); }

  /* 색인은 아래에서 올라오는 판(최종 시안): 평소에는 손잡이만 보이고, 누르거나 위로 밀면 올라온다 */
  .tabs {
    position: fixed;
    z-index: 60;
    inset: auto 5px 0 5px;
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-radius: 13px 13px 0 0;
    box-shadow: 0 -3px 14px #30261c30, inset 0 1px #b8ab94;
    transform: translateY(calc(100% - 20px - env(safe-area-inset-bottom)));
    transition: transform 240ms cubic-bezier(.22, .8, .3, 1);
  }
  @media (prefers-reduced-motion: reduce) { .tabs { transition: none; } }
  .book.is-single .tabs { left: 5px; }
  .tabs:has(#index-open:checked) { transform: none; }
  .index-state { display: block; position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
  .index-grip { display: block; position: relative; flex: none; height: 20px; cursor: pointer; touch-action: none; }
  .index-grip::after { content: ""; position: absolute; inset: 8px 0 auto; width: 36px; height: 4px; margin-inline: auto; border-radius: 3px; background: var(--print-soft); }
  /* 닫혀 있을 때는 눌리지도 읽히지도 않게 한다(올라오는 동안에는 곧바로 보이게 시간차를 둔다) */
  .tabs:not(:has(#index-open:checked)) :is(.index-primary, .index-secondary) { visibility: hidden; transition: visibility 0s 240ms; }
  .index-primary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px 3px; }
  .index-secondary { display: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding-top: 3px; border-top: var(--hair) solid var(--rule); }
  .index-state#index-more:checked ~ .index-secondary { display: grid; }
  .index-primary > .tab[href^="/day/"] { order: 1; }
  .index-primary > .tab[href^="/week/"] { order: 2; }
  .index-primary > .tab[href^="/month/"] { order: 3; }
  .index-primary > .tab[href^="/year/"] { order: 4; }
  .index-primary > .tab-more { order: 5; display: grid; }
  .tab, .tab:hover, .tab[aria-current="page"], .tab[aria-expanded="true"], .tab-more {
    position: relative;
    flex: none;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    min-height: 42px;
    display: grid;
    place-items: center;
    padding: 2px 3px;
    border: 0;
    border-radius: 7px;
    font-size: clamp(10px, 2.7vw, 13px);
    line-height: 1;
    white-space: nowrap;
    word-break: keep-all;
    overflow-wrap: normal;
  }
  .tab:hover { background: var(--paper-edge); }
  .tab[aria-current="page"], .tab[aria-expanded="true"], .index-state#index-more:checked ~ .index-primary .tab-more { background: var(--paper-edge); }
  .tab[aria-current="page"]::after { content: ""; position: absolute; bottom: 5px; left: 50%; width: 18px; height: 2px; transform: translateX(-50%); border-radius: 2px; background: var(--cover); }
  .tab[href="/notes"] { border-top: 0; }
  .tabs-gap, .tab-tool[data-ink-toggle], .tabs > .tab-today { display: none; }
  .tray, .inktray { position: fixed; z-index: 70; left: 8px; right: 8px; bottom: calc(28px + env(safe-area-inset-bottom)); width: auto; transform: none; }
  .trouble { bottom: calc(28px + env(safe-area-inset-bottom)); }
  .stuck { bottom: calc(28px + env(safe-area-inset-bottom)); left: 8px; }

  /* 쪽 안의 틀 */
  .week { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; margin-top: 0; }
  .week > * { margin-top: 0; padding-top: calc(var(--u) * 1); border-top: var(--hair) solid var(--rule-strong); border-left: 0; padding-left: 0; }
  .week > :first-child { border-top: 0; }
  .daycol { min-height: calc(var(--u) * 12); }
  .head-tools { flex-wrap: wrap; gap: calc(var(--u) * 1); }
  .today-note, .date-meta { white-space: nowrap; }
  .more-body { width: min(calc(100vw - 48px), 320px); }
  .datepop { width: min(calc(100vw - 32px), 320px); }

  /* 월간: 두 쪽에 걸친 달력 대신 일곱 열짜리 달력과 그 아래의 일정 목록 */
  .month-phone { display: block; }
  .month-left, .month-right > .cell, .month-right > .dow:not(.dow-goals) { display: none; }
  .month-right { display: block; }
  .month-right .month-goals { margin-top: calc(var(--u) * 0.6); }
  /* 한 쪽씩 넘겨 볼 때는 목표가 화면을 혼자 쓰므로, 달력 옆에 붙어 있을 때의 세로 줄과 들여쓰기를 없앤다 */
  .month-right .month-goals { border-left: 0; padding-left: 0; }
  body[data-tab="month"] .page.left .folio { display: none; }

  /* 연간: 석 달씩 세 줄이 아니라 두 달씩, 숫자가 붙지 않게 */
  .minis { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; gap: calc(var(--u) * 2) calc(var(--u) * 2.4); }
  .mini-grid { font-size: 12px; row-gap: 3px; }
  .mini-dow { font-size: 10px; }

  /* 프로젝트: 이름이 잘리지 않게 줄을 둘로, 날짜 칸은 한 줄에 둘씩 */
  .project-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name count" "meta bar"; row-gap: 2px; padding: 8px 4px; }
  .project-name { grid-area: name; white-space: normal; overflow: visible; text-overflow: clip; }
  .project-meta { grid-area: meta; }
  .project-bar { grid-area: bar; width: calc(var(--u) * 8); }
  .project-row > :last-child { grid-area: count; text-align: right; }
  .project-form .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-form .fields input, .project-form .fields select { min-width: 0; width: 100%; }
}

/* 메모 쪽 */
.note-list, .note-links {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
.note-list a, .note-links label {
  display: block;
  padding: calc(var(--u) * 0.8);
  border-bottom: var(--hair) solid var(--rule);
  color: var(--print);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.note-list a:hover, .note-list a[aria-current="page"] { background: var(--ink-wash); }
.note-list a[aria-current="page"] { font-weight: 700; }
.note-list a { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: .65em; align-items: baseline; }
.note-list small, .note-list time, .note-meta { color: var(--print-soft); font-size: var(--fs-xs); }
.note-search { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; flex: none; }
.note-search input {
  grid-column: 1; min-width: 0; padding: 7px 9px; background: var(--paper); color: var(--print);
  border: 1px solid var(--rule-strong); border-radius: 5px; font: inherit;
}
.note-search input:not(:placeholder-shown) + .note-search-clear { grid-column: 2; }
.note-search input::placeholder { color: var(--print-soft); opacity: .8; }
.note-search input::-webkit-search-cancel-button { appearance: none; }
.note-search-clear {
  grid-column: 2; display: grid; place-items: center; padding: 0 10px; background: var(--paper-dim); color: var(--print);
  border: 1px solid var(--rule); border-radius: 5px; font: inherit; text-decoration: none;
}
.note-search-clear:hover { border-color: var(--rule-strong); }
/* 돋보기 단추: 입력 칸 왼쪽 안에 겹쳐 둔다 */
.note-search { position: relative; }
.note-search-go {
  position: absolute; inset-block: 0; inset-inline-start: 0; width: 34px; display: grid; place-items: center;
  padding: 0; border: 0; background: transparent; color: var(--print-soft); cursor: pointer;
}
.note-search-go:hover { color: var(--print); }
.note-search input { padding-inline-start: 32px; }
.note-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .5em 1.2em; margin-block: .65em; }
.note-meta select { max-width: 45vw; padding: .3em .5em; border: 1px solid var(--rule); border-radius: 5px; background: var(--paper); color: var(--print); }
.note-links label { display: flex; align-items: center; gap: 0.65em; }
.note-links button { align-self: flex-end; margin-top: 0.8em; }
.note-head { justify-content: flex-end; }
.notes-back { display: none; }
.note-editor { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.note-title.ink {
  width: 100%;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--print);
  padding-bottom: calc(var(--u) * 0.85);
  border-bottom: var(--hair) solid var(--rule-strong);
}
.note-paper {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 0 calc(var(--u) * 0.3);
  font-size: var(--fs-m);
  line-height: var(--row);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(var(--row) - var(--hair)), var(--rule) calc(var(--row) - var(--hair)) var(--row)) local;
}
.note-paper p { margin: 0; }
.note-paper:focus { outline: 0; }
.note-shortcuts {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.55em;
  flex-wrap: wrap;
  font-size: var(--fs-s);
  color: var(--print);
  overflow-wrap: anywhere;
}
.note-shortcuts a { color: var(--ink); text-decoration: underline; text-underline-offset: 0.18em; }
.note-manage { font-weight: 600; }
.note-tools {
  position: fixed;
  z-index: 105;
  top: var(--tool-top, 8px);
  left: var(--tool-left, 8px);
  width: max-content;
  max-width: calc(100vw - 16px);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  box-shadow: 0 6px 22px #211d1833;
  border-radius: 8px;
  color: var(--print);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.note-tool-row { display: flex; align-items: center; padding: 3px; gap: 2px; }
.note-tool-row button {
  min-width: 38px;
  min-height: 36px;
  padding: 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 17px;
}
.note-tool-row button[data-note-command="bold"] { font-weight: 800; }
.note-tool-row button[data-note-command="italic"] { font-style: italic; }
.note-tool-row button[data-note-command="underline"] { text-decoration: underline; }
.note-tool-row button[data-note-command="strikeThrough"] { text-decoration: line-through; }
.note-tool-row button:is(:hover, [aria-pressed="true"], [aria-expanded="true"]) { background: var(--paper-edge); }
.note-tool-row button[data-note-palette] { color: var(--note-active-color, var(--print)); }
.note-tool-row button[data-note-palette][data-light-ink] { background: #24211e; }
.note-palette {
  padding: 12px 14px 8px;
  border-top: 1px solid var(--rule);
  background: linear-gradient(165deg, var(--paper), var(--paper-dim));
  max-height: max(96px, calc(var(--note-viewport, 100dvh) - 122px));
  overflow-y: auto;
  scrollbar-width: thin;
}
.note-pencils {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  width: min(264px, calc(100vw - 48px));
  padding-top: 14px;
  isolation: isolate;
}
.note-pencil {
  position: relative;
  display: grid;
  place-items: start stretch;
  min-width: 0;
  height: 47px;
  padding: 0;
  border: 0;
  background: transparent;
}
.note-pencil:nth-last-child(-n+12) { height: 70px; }
.note-pencil:focus-visible { z-index: 2; }
.note-pencil-shape {
  position: relative;
  display: grid;
  grid-template-rows: 24px 1fr;
  width: 100%;
  height: 70px;
  pointer-events: none;
  filter: drop-shadow(0 -1px 1px #33251820);
}
.note-pencil-shape::before {
  content: "";
  z-index: 1;
  margin: 5px 0 -2px;
  clip-path: polygon(43% 0, 57% 0, 91% 76%, 100% 89%, 98% 94%, 80% 98%, 50% 100%, 20% 98%, 2% 94%, 0 89%, 9% 76%);
  background:
    radial-gradient(ellipse at 43% 72%, #fff4db8a, transparent 65%),
    repeating-linear-gradient(86deg, #71512e0a 0 0.6px, transparent 0.6px 2.5px),
    linear-gradient(90deg, #c09b70, #e7cda4 46%, #c4a172);
}
.note-pencil-tip {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 31%;
  width: 38%;
  height: 9px;
  clip-path: polygon(46% 0, 54% 0, 100% 93%, 75% 98%, 50% 100%, 25% 98%, 0 93%);
  background: linear-gradient(90deg, #18110e2b, #fff2 51%, #19120c42), var(--pencil);
}
.note-pencil-shape::after {
  content: "";
  background:
    linear-gradient(90deg, #251c2b38 0%, #251c2b28 26%, #ffffff26 26%, #ffffff16 46%, #ffffff0d 72%, #2113152c 72%, #21131538 100%),
    var(--pencil);
  box-shadow: inset 0 0 0 0.5px #32261b36;
}
.note-pencil:nth-last-child(-n+12) .note-pencil-shape::after { border-radius: 0 0 2px 2px; }
.note-pencil:hover .note-pencil-shape { filter: brightness(1.08); }
.note-pencil[aria-pressed="true"] .note-pencil-shape {
  height: 82px;
  transform: translateY(-12px);
  filter: drop-shadow(0 -2px 2px #33251838);
}
.note-pencil[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  z-index: 1;
  top: 26px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  transform: translateX(-50%);
  border: 1px solid var(--paper);
  border-radius: 50%;
  background: var(--print);
  color: var(--paper);
  box-shadow: 0 1px 2px #1a171548;
  font: 600 11px/1 system-ui;
  pointer-events: none;
}
.note-palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--rule);
  color: var(--print-soft);
  font-size: 12px;
}
.note-palette .plain-button { font-size: inherit; }
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  body[data-tab="notes"] .spread:not(.is-single):not(:has(.note-editor)) > .page.right,
  body[data-tab="notes"] .pager-dots { display: none; }
  .note-head { justify-content: flex-end; }
  .notes-back { display: inline-flex; order: 1; font-size: 22px; }
}
@media (pointer: coarse) {
  .note-tools {
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    bottom: max(calc(var(--keyboard-bottom, 0px) + 8px), 106px);
  }
  .note-tool-row { justify-content: center; }
  .note-tool-row button { min-width: 46px; min-height: 44px; }
  .note-palette { max-height: max(96px, calc(var(--note-viewport, 100dvh) - 164px)); }
  .note-paper { font-size: 16px; }
}

/* ───────── 긴급은 빨간 글씨 (사용자 요청: 긴급 표시는 빨강) ───────── */
.task.is-urgent .task-title, .task.is-urgent .prio, .mini-task.is-urgent .mini-title, .mini-task.is-urgent .mini-prio { color: var(--stamp); }
.task.is-urgent.is-done .task-title, .task.is-urgent.is-cancelled .task-title, .mini-task.is-urgent.is-done .mini-title, .mini-task.is-urgent.is-cancelled .mini-title { color: #c8382c99; }

/* ───────── 상태를 오른쪽 단추로 고르는 메뉴 ───────── */
/* 길게 누르는 동안 휴대폰이 글자 고르기나 제 메뉴를 띄우지 않게 한다 */
.mark { cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
/* 날짜·시각 고르기 창과 같은 종이 창으로 맞춘다(전에는 혼자 노란 쪽지였다) */
.statusmenu {
  position: fixed;
  z-index: 80;
  min-width: 148px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--paper);
  border-radius: 12px;
  box-shadow: 0 0 0 1px #0000001f, 0 10px 30px #00000052;
  /* 글자와 단추를 0.5pt씩 줄였다(사용자 요청 2026-11-26) */
  font-size: calc(14px - 0.5pt);
  color: var(--print);
}
.statusmenu[hidden] { display: none; }
.statusmenu button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(7px - 0.25pt) 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.statusmenu button:hover, .statusmenu button:focus-visible { background: var(--ink-wash); outline: 0; }
.statusmenu button[aria-current="true"] { font-weight: 800; color: var(--ink); background: var(--ink-wash); }
/* 손가락으로 누르는 기기에서는 줄을 넉넉하게 */
@media (pointer: coarse) { .statusmenu button { min-height: 42px; } }
.statusmenu .mark-char { display: grid; place-items: center; width: calc(22px - 0.5pt); color: var(--ink); }
.statusmenu .st { width: calc(20px - 0.5pt); height: calc(20px - 0.5pt); }

/* ───────── 잠금: 들어오는 쪽과 설정의 칸 ───────── */
.login { display: flex; flex-direction: column; gap: 0.9rem; width: min(26rem, calc(100vw - 2rem)); }
.login h1 { margin: 0; }
.login p { margin: 0; }
/* 들어가는 화면은 서버에 올린 플래너에서 맨 먼저 보는 곳이다. 칸은 칸답게 테두리를 두르고, 단추는 한눈에 단추로 보이게 채운다. */
.login input { height: 2.9rem; padding: 0 0.8rem; border: 1px solid var(--rule-strong); border-radius: 8px; background: #ffffffb3; font: inherit; font-size: 1.05rem; color: var(--ink); }
.login input:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.login button { align-self: stretch; height: 2.9rem; padding: 0 1.3rem; border: 0; border-radius: 8px; background: var(--print); color: var(--paper); font-size: 1rem; font-weight: 700; cursor: pointer; }
.login button:hover { background: #000; }
/* 이 화면은 책 밖이라 책의 길이 단위(--u)가 듣지 않는다. 안내 줄의 여백을 rem으로 따로 준다. */
.login .oops { margin: 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--stamp); border-radius: 0 6px 6px 0; font-size: 0.95rem; }
.lock-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; gap: calc(var(--u) * 0.8); margin: calc(var(--u) * 0.7) 0; }
.lock-form input { min-width: 0; height: calc(var(--u) * 2); border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-s); }
.open-wide { margin-top: calc(var(--u) * 0.9); }
.open-wide input:disabled + span { color: var(--print-faint); }
@media (max-width: 699px) { .lock-form { grid-template-columns: minmax(0, 1fr); } }

/* ───────── 설정: 한 줄에 이름과 조작 하나 ─────────
 * 설명은 이름 아래 한 줄로만 두고, 긴 이야기는 "알아 둘 것"에 접어 둔다. */
.set { display: flex; flex-direction: column; }
.set + .set { margin-top: calc(var(--u) * 0.6); }
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  body[data-tab="settings"] .spread {
    display: block;
    overflow: hidden auto;
    scroll-snap-type: none;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }
  body[data-tab="settings"] .spread::after,
  body[data-tab="settings"] .pager-dots { display: none; }
  body[data-tab="settings"] .spread > .page {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding-inline: calc(var(--u) * 3.3);
    border-inline-start: 0;
  }
}
.set-title { display: flex; align-items: center; gap: calc(var(--u) * 0.8); margin: 0; padding-bottom: calc(var(--u) * 0.45); border-bottom: var(--hair) solid var(--rule-strong); font-size: var(--fs-s); font-weight: 700; color: var(--print); }
.badge { padding: calc(var(--u) * 0.12) calc(var(--u) * 0.6); border: var(--hair) solid var(--rule-strong); border-radius: 999px; font-size: var(--fs-xs); font-weight: 500; color: var(--print-soft); line-height: 1.4; }
.badge.is-on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: calc(var(--u) * 1.2); min-height: calc(var(--u) * 3.4); padding: calc(var(--u) * 0.55) 0; border-bottom: var(--hair) solid var(--rule); }
.row-stack { grid-template-columns: minmax(0, 1fr); gap: calc(var(--u) * 0.6); }
.row-what { display: flex; flex-direction: column; gap: calc(var(--u) * 0.15); min-width: 0; }
.row-what b { font-size: var(--fs-s); font-weight: 600; color: var(--print); }
.row-what small { font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.45; overflow-wrap: anywhere; }
.row-side { display: flex; align-items: center; gap: calc(var(--u) * 1); font-size: var(--fs-s); color: var(--ink); white-space: nowrap; }
.row-side form { display: contents; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.92em; }
.set-note { margin: calc(var(--u) * 0.7) 0 calc(var(--u) * 0.2); font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.5; }
.set .oops { margin: calc(var(--u) * 0.6) 0; }

/* 둘 가운데 하나 고르기 */
.seg { display: inline-flex; border: var(--hair) solid var(--rule-strong); border-radius: 999px; overflow: hidden; }
.seg label { cursor: pointer; }
/* 보이지 않는 라디오라서 크기를 0으로 둔다. 안 그러면 `.leave-add input`의 width: 100%가 걸려
   쪽 너비만 한 숨은 칸이 되어 쪽을 가로로 넘치게 한다(근태 입력을 열면 쪽이 옆으로 밀렸다). */
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; margin: 0; }
.seg span { display: block; padding: calc(var(--u) * 0.35) calc(var(--u) * 1.1); font-size: var(--fs-s); color: var(--print-soft); }
.seg input:checked + span { background: var(--ink); color: var(--paper); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -2px; }

/* 켜고 끄기 */
.switch { position: relative; display: inline-block; cursor: pointer; }
.switch input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.switch i { display: block; width: calc(var(--u) * 3.2); height: calc(var(--u) * 1.8); border-radius: 999px; background: var(--rule-strong); transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: calc(var(--u) * 0.2); left: calc(var(--u) * 0.2); width: calc(var(--u) * 1.4); height: calc(var(--u) * 1.4); border-radius: 50%; background: var(--paper); transition: transform 0.15s; }
.switch input:checked + i { background: var(--ink); }
.switch input:checked + i::after { transform: translateX(calc(var(--u) * 1.4)); }
.switch input:disabled + i { opacity: 0.4; cursor: not-allowed; }
.switch input:focus-visible + i { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 글 넣는 칸과 그 옆의 단추 */
/* 설정·외부달력의 글 칸은 둥근 상자다(최종 시안 그대로, 2026-11-26 사용자가 정함). 프로젝트·근태·할 일의 칸은 밑줄이다. */
.field { min-width: 0; height: calc(var(--u) * 2.4); padding: 0 calc(var(--u) * 0.7); border: var(--hair) solid var(--rule-strong); border-radius: calc(var(--u) * 0.4); background: #ffffff80; color: var(--ink); font: inherit; font-size: var(--fs-s); }
.field:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.field::placeholder { color: var(--print-faint); }
.inline-form { display: flex; align-items: center; gap: calc(var(--u) * 0.6); }
.inline-form .field { flex: 1; }
.inline-form .plain-button { flex: none; }

/* 접어 둔 설명 */
.help { margin: calc(var(--u) * 0.5) 0 0; font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.6; }
.help summary { cursor: pointer; color: var(--print-soft); font-weight: 500; }
.help summary:hover { color: var(--print); }
.help p { margin: calc(var(--u) * 0.4) 0 0; }
.help .inline-form { margin: calc(var(--u) * 0.5) 0; }

/* 노션 페이지 고르기 */
.pick .pages label { align-items: center; }
.pick .pages .is-home { background: var(--ink-wash); padding-left: calc(var(--u) * 0.5); }
.pick .pages .page-name { flex: 1; height: calc(var(--u) * 2); }
@media (max-width: 699px) {
  .row { min-height: 52px; padding: 10px 0; gap: 12px; }
  .seg span { padding: 8px 14px; }
  .switch i { width: 46px; height: 28px; }
  .switch i::after { top: 3px; left: 3px; width: 22px; height: 22px; }
  .switch input:checked + i::after { transform: translateX(18px); }
  .field { height: 42px; padding: 0 12px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form .field { flex: 1 1 100%; }
  .tab-today { margin-bottom: 0; }
}

/* ───────── 아무 자리에나 찍은 스티커 ─────────
 * 면 위에 한 겹 덮어 두고, 자리는 그 면 안에서의 비율(--x, --y)로 놓는다. 평소에는 눌리지 않고 아래의 칸이 눌린다.
 * 스티커 서랍을 연 동안에만 끌어 옮기고 고를 수 있다. */
.placed { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.page.single .placed { bottom: auto; height: 100%; }
.placed-item {
  position: absolute;
  left: calc(var(--x) * 100%);
  top: calc(var(--y) * 100%);
  /* 기울기는 스티커 통째에 준다: 고른 테두리와 손잡이가 그림과 함께 돈다 */
  /* --follow: 안으로 내려 보는 칸이 내려간 만큼 스티커도 올라간다(일꾼 `stickers.rs`의 follow_scroll) */
  transform: translateY(var(--follow, 0px)) translate(-50%, -50%) rotate(var(--turn, 0deg));
  display: inline-grid;
  place-items: center;
  font-size: calc(var(--fs-m) * var(--size, 1));
  line-height: 1;
  user-select: none;
  touch-action: none;
}
.placed-item > .stamp, .placed-item > .mark-sticker, .placed-item > .image-sticker { --tilt: 0deg !important; }
/* 찍은 도장은 테두리와 여백도 글자와 함께 커진다(서랍의 도장과 같은 비율을 em으로 옮긴 값).
 * 고정 길이로 두면 크게 키웠을 때 글자만 커져 테두리에 달라붙는다. */
.placed-item .stamp { font-size: 1em; padding: 0.2em 0.49em 0.12em; border-width: 0.17em; border-radius: 0.31em; }
.placed-item .mark-sticker svg { width: 2em; height: 2em; }
.placed-item .emoji-sticker { font-size: 1.8em; }
.image-sticker { display: block; width: auto; height: 3.4em; max-width: 6em; object-fit: contain; transform: rotate(var(--tilt, 0deg)); pointer-events: none; }
.tray .image-sticker { height: calc(var(--u) * 2.2); max-width: calc(var(--u) * 3); transform: none; }
/* 찍어 둔 스티커는 서랍을 열지 않아도 바로 눌린다: 누르면 도구가 뜨고, 끌면 옮겨진다 */
.placed-item { pointer-events: auto; cursor: grab; }
.placed-item:hover { outline: 1px dashed var(--ink-soft); outline-offset: 5px; border-radius: 2px; }
.placed-item.is-picked { outline: 1.5px solid var(--ink); outline-offset: 5px; border-radius: 2px; z-index: 4; }
.placed-item.is-dragging { cursor: grabbing; opacity: 0.8; }
/* 고른 스티커: 오른쪽 위에 동그란 지우기, 나머지 세 꼭짓점에 크기 손잡이.
 * 스티커의 글자 크기는 --size를 따라 커지므로, 여기 것들은 크기를 px로 못박아 둔다. */
.placed-x {
  position: absolute; top: -17px; right: -17px;
  width: 22px; height: 22px; padding: 0;
  display: grid; place-items: center;
  border: 2px solid var(--paper); border-radius: 50%;
  background: var(--stamp); color: #fff;
  font: 700 15px/1 system-ui, sans-serif;
  box-shadow: 0 1px 4px #00000059;
  cursor: pointer;
}
.placed-x:hover { background: #a52a20; }
.placed-corner {
  position: absolute; width: 10px; height: 10px;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 2px;
}
/* 손잡이는 작게 보이되, 잡히는 자리는 넉넉하게 */
.placed-corner::before { content: ""; position: absolute; inset: -8px; }
.placed-corner.is-nw { top: -11px; left: -11px; cursor: nwse-resize; }
.placed-corner.is-se { bottom: -11px; right: -11px; cursor: nwse-resize; }
.placed-corner.is-sw { bottom: -11px; left: -11px; cursor: nesw-resize; }
/* 돌리기 손잡이: 위쪽 가운데에서 짧은 줄로 이어진 둥근 단추 */
.placed-turn {
  position: absolute; top: -40px; left: 50%; margin-left: -11px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 1.5px solid var(--ink); border-radius: 50%;
  background: var(--paper); color: var(--ink);
  font: 700 14px/1 system-ui, sans-serif;
  box-shadow: 0 1px 4px #00000033;
  cursor: grab;
}
.placed-turn:active { cursor: grabbing; }
.placed-turn::after { content: ""; position: absolute; top: 100%; left: 50%; width: 1.5px; height: 11px; margin-left: -0.75px; background: var(--ink); }
.placed-turn::before { content: ""; position: absolute; inset: -8px; }
.placed-copy {
  position: absolute; top: calc(100% + 16px); left: 50%; transform: translateX(-50%) rotate(calc(var(--turn, 0deg) * -1));
  padding: 7px 14px; white-space: nowrap;
  border: 1px solid var(--paper-edge); border-radius: 999px;
  background: var(--paper); color: var(--print);
  font: 600 13px/1 var(--font);
  box-shadow: 0 4px 14px #00000047;
  cursor: pointer; z-index: 5;
}
.placed-copy:hover { background: var(--paper-dim); }
@media (pointer: coarse) {
  .placed-x { width: 30px; height: 30px; top: -21px; right: -21px; font-size: 19px; }
  .placed-corner { width: 14px; height: 14px; }
  .placed-corner::before { inset: -12px; }
  .placed-corner.is-nw { top: -13px; left: -13px; }
  .placed-corner.is-se { bottom: -13px; right: -13px; }
  .placed-corner.is-sw { bottom: -13px; left: -13px; }
  .placed-copy { padding: 11px 18px; font-size: 15px; }
  .placed-turn { width: 30px; height: 30px; top: -50px; margin-left: -15px; font-size: 18px; }
  .placed-turn::after { height: 13px; }
  .placed-turn::before { inset: -10px; }
}

/* 스티커를 손에 든 동안의 알림(좁은 화면에서만): 서랍은 잠깐 접어 쪽을 누를 수 있게 한다 */
.aim-hint { display: none; }
@media (max-width: 699px) {
  .aiming .tray { display: none; }
  .aim-hint {
    position: fixed; z-index: 75; left: 50%; bottom: 78px; transform: translateX(-50%);
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px 10px 16px; border-radius: 999px;
    background: var(--print); color: var(--paper);
    font-size: 14px; font-weight: 600; white-space: nowrap;
    box-shadow: 0 4px 14px #00000059;
  }
  .aim-cancel { padding: 5px 12px; border: 1px solid #ffffff66; border-radius: 999px; background: none; color: inherit; font-size: 13px; }
}

/* ───────── 한 번 더 묻는 창: 뒤를 어둡게 가리고 종이 창으로 묻는다 ───────── */
.ask { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: var(--modal-overlay); }
.ask-sheet {
  width: min(360px, 100%); padding: 22px 22px 16px;
  background: var(--paper); color: var(--print);
  border: 1px solid var(--paper-edge);
  border-radius: 8px; box-shadow: 0 14px 40px #00000066;
}
.ask-text { margin: 0; font-size: 15px; line-height: 1.6; word-break: keep-all; }
.ask-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
.ask-actions button { min-height: 44px; padding: 9px 16px; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.ask-no { border: 1px solid var(--rule-strong); background: none; color: var(--print); }
.ask-no:hover { border-color: var(--print); }
.ask-yes { border: 1px solid var(--print); background: var(--print); color: var(--paper); }
.ask-yes:hover { background: #000; }
.ask-actions button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* 스티커를 고른 동안에는 쪽 전체가 찍는 자리다 */
.sticking .page { cursor: crosshair; }
.sticking .tray, .sticking .tray * { cursor: auto; }
.tray-image { position: relative; display: inline-grid; }
.tray-image-del { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: var(--print-soft); color: var(--paper); font-size: 11px; line-height: 1; opacity: 0; cursor: pointer; }
.tray-image:hover .tray-image-del, .tray-image-del:focus-visible { opacity: 1; }
.tray-upload { display: inline-block; margin-top: calc(var(--u) * 0.5); cursor: pointer; }
.tray-upload .plain-button { display: inline-block; }
.tray, .inktray { max-height: calc(100vh - 32px); overflow-y: auto; scrollbar-width: thin; }

/* ───────── 좁은 화면(휴대폰·태블릿): 면을 옆으로 넘겨 본다 ─────────
 * 세로로 길게 내리지 않는다. 왼쪽 면과 오른쪽 면이 화면 하나씩이고, 손가락으로 옆으로 넘긴다.
 * 한 면이 화면보다 길면 그 면 안에서만 내린다. */
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  .desk { padding-top: 12px; padding-bottom: 12px; min-height: 100dvh; }
  .book { height: calc(100dvh - 24px); }
  .spread {
    position: absolute;
    inset: 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .spread::before { display: none; }
  .page, .page.left, .page.right, .page.single {
    flex: 0 0 100%;
    min-height: 0;
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--rule-strong) transparent;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  .page.right { border-top: 0; border-left: var(--hair) dashed var(--rule-strong); }
  .pager-dots { position: fixed; z-index: 55; left: 0; right: 0; bottom: 6px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
  .pager-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: #ffffff66; pointer-events: auto; }
  .pager-dot[aria-current="true"] { background: #fff; transform: scale(1.3); }
}
@media (max-width: 699px) {
  .desk { padding: 6px 6px 0; }
  .book { height: calc(100dvh - 6px - 28px - env(safe-area-inset-bottom)); }
  .pager-dots { bottom: calc(24px + env(safe-area-inset-bottom)); }
  .pager-dot { background: #29282640; }
  .pager-dot[aria-current="true"] { background: var(--ink); }
  /* 주간: 한 화면에 네 칸(2×2) */
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); height: 100%; }
  .week > * { border-top: 0; padding-top: 0; }
  .week > :nth-child(n + 3) { margin-top: 8px; padding-top: 8px; border-top: var(--hair) solid var(--rule-strong); }
  .week > :nth-child(even) { border-left: var(--hair) solid var(--rule); padding-left: 8px; }
  .week > :nth-child(odd) { padding-right: 8px; }
  .daycol { min-height: 0; overflow: hidden; }
  /* 연간: 여섯 달이 한 화면, 옆으로 넘기면 나머지 여섯 달 */
  .minis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; grid-template-columns: none; }
  .minis-half { flex: 0 0 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); gap: 14px 18px; align-content: start; scroll-snap-align: start; padding-right: 2px; }
}

@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  body:is([data-tab="projects"], [data-tab="notes"]) .spread { overflow: hidden; scroll-snap-type: none; }
  body[data-tab="projects"] .spread > .page.right { display: none; }
  body[data-tab="projects"] .pager-dots { display: none; }
  body:is([data-tab="projects"], [data-tab="notes"]) .spread > .page.right:has(.project-sheet-close, .note-editor) {
    position: absolute;
    z-index: 2;
    inset: 0 0 0 auto;
    display: flex;
    width: 95%;
    height: 100%;
    border-left: var(--hair) solid var(--rule);
    box-shadow: -8px 0 22px #28251926;
    /* 아래 목록 면을 덮는 시트이므로 종이색으로 칠한다. 칠하지 않으면 목록이 비쳐 두 쪽이 겹쳐 찍힌다(2026-11-26 QA). */
    background: var(--paper);
    animation: project-sheet-in .24s ease-out;
  }
  .project-sheet-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-inline-start: auto;
    color: var(--print);
    text-decoration: none;
    font-size: 22px;
  }
  @keyframes project-sheet-in { from { transform: translateX(100%); } }
  @media (prefers-reduced-motion: reduce) {
    body:is([data-tab="projects"], [data-tab="notes"]) .spread > .page.right:has(.project-sheet-close, .note-editor) { animation: none; }
  }
}
@media (max-width: 699px) {
  /* 주간의 칸: 일정 줄은 줄어들지 않고, 할 일이 많으면 그 칸 안에서 내린다 */
  .daycol > .lines { flex: none; }
  .daycol > .mini-tasks { flex: 1 1 0; min-height: 0; }
  .daycol .mini-add { margin-top: 0; }
}

/* 4쪽형은 한 면을 두 세로 칸으로 나눈다. */
.week.week-roomy {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}
.week.week-roomy > :first-child {
  padding-right: calc(var(--u) * 0.75);
}
.week.week-roomy > :last-child {
  padding-left: calc(var(--u) * 0.75);
  border-left: var(--hair) solid var(--rule);
}

/* 세워 든 태블릿(700~1179px): 한 면이 화면에 꽉 차게. 너비와 높이 가운데 모자란 쪽에 맞춘다. */
@media (min-width: 700px) and (max-width: 1179px) and (orientation: portrait), (min-width: 700px) and (max-width: 999px), (min-width: 700px) and (max-width: 1179px) and (max-height: 799px) {
  .book { --w: min(100vw - 94px, (100dvh - 24px) / 1.3); }
}

/* 휴대폰의 한 쪽 보기: 하루를 한 장에 아래로 이어서 본다(날짜, 주요업무, 시간표, 할 일, 메모).
 * 두 쪽 보기는 할 일 화면과 시간 화면을 옆으로 넘겨 본다. 전에는 한 쪽 보기도 옆으로 넘기게 해서 둘이 똑같아 보였다.
 * 쪽 자체가 위아래로 내려가는 한 장이므로(위의 좁은 화면 규칙) 여기서는 줄 높이와 메모 자리만 손가락에 맞춘다. */
@media (max-width: 699px) {
  .page.single .timeline { --hour: 30px; }
  .page.single .single-b > :nth-child(2) { min-height: 190px; }
  .page.single .folio { margin-top: calc(var(--u) * 0.5); }
}

/* 설정 오른쪽: 달력 */
.set-title-side { margin-left: auto; }
.sub-add { margin: calc(var(--u) * 0.7) 0 calc(var(--u) * 0.2); }
.sub-add .sub-add-name { flex: 0 0 28%; }
.feed-url { margin: 0; padding: calc(var(--u) * 0.5) calc(var(--u) * 0.7); border: var(--hair) solid var(--rule); border-radius: calc(var(--u) * 0.4); background: #ffffff66; color: var(--ink); font-size: var(--fs-xs); overflow-wrap: anywhere; user-select: all; }
/* 주소 옆의 복사 단추: 주소는 남는 폭을 다 쓰고 단추는 제 크기만 쓴다 */
.feed-line { display: flex; align-items: center; gap: calc(var(--u) * 0.6); min-width: 0; }
.feed-line .feed-url { flex: 1; min-width: 0; }
.feed-line button { flex: none; white-space: nowrap; }
.help dl { margin: calc(var(--u) * 0.5) 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: calc(var(--u) * 0.35) calc(var(--u) * 1); }
.help dt { color: var(--print); font-weight: 600; white-space: nowrap; }
.help dd { margin: 0; }
@media (max-width: 699px) { .help dl { grid-template-columns: minmax(0, 1fr); } .sub-add .sub-add-name { flex: 1 1 100%; } }

/* 좁은 화면의 한 쪽 보기: 책 틀을 화면에 꼭 맞춘다(넓은 화면용의 가운데 정렬이 남아 있으면 내용만큼 넓어져 오른쪽이 잘린다) */
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  .spread.is-single { inset: 0; }
  .page.single { min-width: 0; max-width: 100%; }
}

/* ───────── 할 일 줄: 긴 제목은 줄을 바꿔 다 보이고, 시각과 프로젝트는 그 옆(좁은 화면에서는 아래)에 ───────── */
.task { height: auto; min-height: var(--row); align-items: start; }
.task > .mark, .task > .prio, .task > .more { height: var(--row); }
.task > .more { display: grid; place-items: center; }
textarea.task-title { height: auto; padding: calc((var(--row) - 1.4em) / 2) 0; line-height: 1.4; overflow-wrap: anywhere; }
.task-add .task-title { height: var(--row); }
.task-notes { display: flex; align-items: center; gap: calc(var(--u) * 0.7); min-height: var(--row); padding: 0 calc(var(--u) * 0.5); white-space: nowrap; font-size: var(--fs-xs); color: var(--print-soft); }
.task-notes:empty { display: none; }
.task-notes .task-project { padding: 0; }
.task-when { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.task.is-done .task-when, .task.is-cancelled .task-when { color: var(--ink-soft); }
/* 시간표에 놓인 할 일: 일정과 가려 보이게 테두리만 두른다 */
.ev.is-task { display: flex; align-items: center; gap: calc(var(--u) * 0.5); background: color-mix(in srgb, var(--paper) 82%, var(--ink) 4%); border: var(--hair) dashed var(--ink-soft); border-left: calc(var(--u) * 0.22) solid var(--ink); }
.ev.is-task .mark { width: auto; height: auto; flex: none; }
.ev.is-task .st { width: calc(var(--u) * 1.25); height: calc(var(--u) * 1.25); }
.ev-task-title { color: var(--ink); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ev.is-task.is-done .ev-task-title, .ev.is-task.is-cancelled .ev-task-title { color: var(--ink-soft); text-decoration: line-through; }
/* 넘치는 목록은 스크롤바가 보인다 */
.task-list, .ledger, .projects, .mini-tasks { scrollbar-gutter: stable; }
/* 할 일 줄: [진행 상황][중요도][제목 … 시각·프로젝트][⋯]
   진행 상황과 중요도는 줄이 몇 줄이 되든 그 칸의 가운데에 온다.
   제목과 덧붙이는 것(시각·프로젝트)은 한 줄에 나란히 놓이고, 다 들어가지 않을 때만 덧붙이는 것이 아랫줄 오른쪽으로 내려간다. */
.task { grid-template-columns: calc(var(--u) * 2) calc(var(--u) * 2.9) minmax(0, 1fr) auto; align-items: center; }
.task > .mark, .task > .prio { height: var(--row); align-self: center; }
/* 줄이 두 줄이 되어도 ⋯는 상태·중요도와 같이 줄의 세로 가운데에 둔다 */
.task > .more { align-self: center; height: auto; }
.task-main { display: flex; flex-wrap: wrap; align-items: center; column-gap: calc(var(--u) * 0.8); min-width: 0; min-height: var(--row); }
/* 제목은 글의 길이만큼만 자리를 잡고(남는 자리는 차지한다), 줄보다 길면 그 안에서 줄을 바꾼다 */
.task-main > .task-title, .task-main > textarea.ink.fit.task-title { flex: 1 1 auto; width: auto; min-width: 6em; max-width: 100%; }
.task-main > input.task-title { flex: 1 1 8em; }
.task-main > .task-notes { flex: 0 0 auto; margin-left: auto; min-height: 0; padding: 0; max-width: 100%; white-space: nowrap; }
.task-main > .task-notes .task-project { max-width: calc(var(--u) * 16); }
.task-main > .task-project-pick { flex: 0 0 auto; margin-left: auto; height: var(--row); }
@media (max-width: 699px) {
  /* 중요도 칸은 "긴급" 두 글자가 제목에 붙지 않을 만큼 넓게 */
  .task { grid-template-columns: 34px 40px minmax(0, 1fr) auto; column-gap: 2px; }
  .task-main { column-gap: 10px; }
  .task-main > .task-notes { padding-bottom: 2px; white-space: normal; }
  .task-main > .task-notes .task-project { max-width: none; white-space: normal; overflow: visible; text-align: right; }
}
/* 손가락으로 쓰는 기기에는 "올려놓기"가 없다. 줄마다의 ⋯(자세히)과 지우기 단추를 늘 보이게 한다. */
@media (hover: none) {
  .more > summary { opacity: 0.7; }
  .row-del { opacity: 0.7; }
  .tray-image-del { opacity: 1; }
}


/* 스크롤바가 글씨를 가리지 않게: 넘치는 목록의 오른쪽에 스크롤바가 놓일 자리를 비워 둔다.
   (휴대폰과 맥의 스크롤바는 내용 위에 겹쳐 뜨므로 `scrollbar-gutter`만으로는 자리가 생기지 않는다.) */
.task-list, .ledger, .projects, .mini-tasks, .week-side, .month-goals, .year-goals { padding-right: 12px; scrollbar-gutter: auto; }

/* 휴대폰의 근무상황부: 칸 여섯 개를 한 줄에 두면 넘친다. 한 건을 두 줄로 적는다
   (윗줄: 날짜·시각 / 구분, 아랫줄: 내용 / 연차). 머리줄은 숨긴다. */
@media (max-width: 699px) {
  .ledger-head { display: none; }
  .ledger-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas: "date date kind more" "what what what cut";
    row-gap: 2px;
    column-gap: 10px;
    padding: 8px 0;
    align-items: baseline;
  }
  .ledger-row > .ledger-date { grid-area: date; white-space: normal; }
  .ledger-row > .ledger-kind { grid-area: kind; text-align: right; }
  .ledger-row > .ledger-what { grid-area: what; white-space: normal; font-size: var(--fs-s); color: var(--print); }
  .ledger-row > .more { grid-area: more; }
  .ledger-row > .num { text-align: right; font-size: var(--fs-s); white-space: nowrap; }
  .ledger-row > .ledger-what:empty { display: none; }
}
@media (max-width: 699px) {
  .ledger-row > .num:nth-of-type(3) { grid-area: cut; }
  .ledger-row > .num:nth-of-type(3):not(:empty)::before { content: "시간 "; font-size: var(--fs-xs); font-weight: 400; color: var(--print-soft); }
}

.tray-clear { margin: 0; }

/* ───────── 필기층: 펜으로 쪽 위에 그은 획 ─────────
 * 면 위에 한 겹 덮는다. "쓰기"(평소)에는 눌리지 않아서 펜이 아래의 입력칸까지 닿고, 기기가 그 글을 글씨로 바꿔 준다
 * (아이패드 스크라이블, 갤럭시 S펜·안드로이드 14의 스타일러스 필기). 입력칸 위에 그림 판이 덮이면 그 변환이 막히므로,
 * "그리기"를 고른 동안(body.inking)에만 층이 펜을 받는다.
 * 획의 좌표는 면 너비를 1로 잰 값이다. 그래서 svg는 너비를 면에 맞추고 높이는 viewBox 비율(너비의 4배)대로 두어,
 * 면이 어떤 모양이어도 글씨가 눌리거나 늘어나지 않게 하고 넘치는 것은 층이 자른다. 스티커(3)보다 아래에 깐다. */
.ink-layer, .ink-live-layer { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.page.single .ink-layer, .page.single .ink-live-layer { bottom: auto; height: 100%; }
.ink-touch { display: flex; align-items: center; gap: calc(var(--u) * 0.5); font-size: var(--fs-xs); color: var(--print-soft); cursor: pointer; }
.ink-svg { display: block; width: 100%; height: auto; overflow: hidden; }
.ink-stroke { pointer-events: none; }
/* 그리는 동안: 펜이 쪽을 끌거나 확대하지 않게 하고(touch-action), 글자가 선택되지 않게 한다. */
/* 지우개: 가는 선도 펜이 닿게, 선마다 투명하고 굵은 짝을 얹는다(일꾼이 지우개를 고를 때만 만든다). */
.ink-hit { fill: none; stroke: transparent; stroke-width: 0.03; stroke-linecap: round; stroke-linejoin: round; pointer-events: stroke; }
.ink-live { pointer-events: none; }
/* 서랍 */
.ink-seg { display: flex; gap: calc(var(--u) * 0.4); }
.ink-seg label { position: relative; flex: 1; }
.ink-seg input { position: absolute; opacity: 0; }
.ink-seg span { display: block; padding: calc(var(--u) * 0.45) calc(var(--u) * 0.8); text-align: center; border: var(--hair) solid var(--rule-strong); border-radius: calc(var(--u) * 2); color: var(--print-soft); font-size: var(--fs-xs); cursor: pointer; }
.ink-seg input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.ink-seg input:focus-visible + span { outline: calc(var(--u) * 0.14) solid var(--ink); outline-offset: calc(var(--u) * 0.2); }
/* 그리는 중임을 알리는 알약. 쓰기로 돌아가는 단추가 들어 있다(좁은 화면에서 서랍을 닫고도 빠져나올 길). */
.ink-hint {
  position: fixed; z-index: 75; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  background: var(--print); color: var(--paper);
  font-size: 14px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 4px 14px #00000059;
}
.ink-hint button { padding: 5px 12px; border: 1px solid #ffffff66; border-radius: 999px; background: none; color: inherit; font-size: 13px; cursor: pointer; }
@media (max-width: 699px) { .ink-hint { bottom: calc(78px + env(safe-area-inset-bottom)); } }
@media (pointer: coarse) {
  .ink-seg span { min-height: 36px; display: grid; place-items: center; }
  .ink-hint button { min-height: 32px; }
}

/* ───────── 자세히(⋯): 종이색 창을 가운데에 띄우고 뒤를 어둡게 가린다 ─────────
 * 전에는 노란 쪽지가 줄 옆에 비뚤게 붙었다. 눈에 잘 띄지 않고 색도 겉돌아서, 종이색 그대로의 창으로 바꾸고
 * 나머지 화면을 어둡게 덮는다. 어두운 데를 누르거나 Esc를 누르면 닫힌다. */
/* ⋯ 단추: 동그란 단추 한가운데에 점 세 개. 평소에도 보이되 조용하게, 올리면 잉크색으로 또렷해진다. */
.more > summary {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  color: var(--print-soft);
  opacity: 0.8;
  line-height: 0;
}
.more-icon { display: block; width: 18px; height: 18px; fill: currentColor; }
:is(.task, .ev, .chip, .entry, .mini-task, .ledger-row, .cell):hover .more > summary,
.more > summary:hover, .more > summary:focus-visible { opacity: 1; color: var(--ink); background: var(--ink-wash); outline: 0; }
.more[open] > summary { opacity: 1; color: var(--ink); }
/* 뒤를 가리는 막: 열려 있는 동안 ⋯ 단추의 일부로 화면 전체를 덮는다. 막을 누르면 ⋯를 누른 것이 되어 닫힌다. */
.more[open] > summary::before {
  content: "";
  position: fixed;
  inset: -100vmax;
  z-index: 90;
  background: var(--modal-overlay);
  cursor: default;
}
details.more > .more-body {
  position: fixed !important;
  z-index: 91;
  inset: 50% auto auto 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(420px, calc(100vw - 32px)) !important;
  max-height: min(80vh, 640px);
  overflow-y: auto;
  grid-template-columns: 1fr 1fr;
  gap: 14px 14px;
  padding: 22px 22px 18px;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 8px;
  box-shadow: 0 18px 50px #00000059, 0 0 0 1px #00000014;
  font-size: 14px;
  color: var(--print);
}
/* 창은 어느 줄에서 열든 같은 모양이어야 한다. 창이 든 줄(칩·일정·할 일)의 글자 굵기·줄 높이·줄 긋기가 물려 내려오지 않게 끊는다. */
details.more > .more-body { line-height: 1.4; font-weight: 400; letter-spacing: 0; text-align: left; text-decoration: none; white-space: normal; }
details.more > .more-body label { gap: 6px; }
details.more > .more-body label > span { font-size: 12px; font-weight: 600; color: var(--print-soft); }
details.more > .more-body .tick > span { font-size: 14px; font-weight: 500; color: var(--print); }
details.more > .more-body input:not([type="checkbox"]), details.more > .more-body select {
  height: 40px;
  padding: 0 10px;
  border: 1px solid var(--rule-strong);
  border-radius: 8px;
  background: #ffffffb3;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}
details.more > .more-body input:focus, details.more > .more-body select:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.more-hint { font-size: 12px; color: var(--print-soft); line-height: 1.5; }
.more-actions { gap: 8px; margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--rule); }
.more-actions button { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 1px solid var(--rule-strong); border-radius: 6px; background: transparent; color: var(--print); font-size: 13px; }
.more-actions button:hover { background: var(--ink-wash); }
/* 아랫줄: 지우기는 왼쪽 끝, 확인은 오른쪽 끝 */
.more-actions { justify-content: flex-start; }
.more-actions .danger { margin: 0 auto 0 0; color: var(--stamp); border-color: #c8382c66; }
.more-actions .danger:hover { background: #c8382c12; }
.more-actions .more-done { margin-left: auto; min-width: 84px; justify-content: center; border-color: var(--print); background: var(--print); color: var(--paper); font-weight: 600; }
.more-actions .more-done:hover { background: #000; }
/* ───────── 자세히 창의 줄: 이름은 왼쪽, 칸은 오른쪽 ─────────
 * 이름을 칸 위에 얹으면 줄마다 두 층이 되어 창이 길어지고 어수선하다. 한 줄에 "이름 — 칸"으로 놓고, 짝을 이루는
 * 칸(시작–끝)은 한 줄에 나란히 둔다. 상태 여섯 가지도 같은 줄 틀 안에 작게 묶는다. */
details.more > .more-body { grid-template-columns: minmax(0, 1fr); gap: 8px; }
details.more > .more-body > label, .field-row, .status-row {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 10px;
}
details.more > .more-body > label > span:first-child, .field-label { font-size: 13px; font-weight: 600; color: var(--print-soft); white-space: nowrap; }
details.more > .more-body input:not([type="checkbox"]), details.more > .more-body select { height: 36px; min-width: 0; width: 100%; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.field-dash { color: var(--print-soft); }
/* 체크 칸(회의)은 이름 자리를 비우고 칸 쪽에 놓는다 */
details.more > .more-body > label.tick { grid-template-columns: 58px auto minmax(0, 1fr); }
details.more > .more-body > label.tick > input[type="checkbox"] { grid-column: 2; }
details.more > .more-body > label.tick > span { grid-column: 3; font-size: 14px; font-weight: 500; color: var(--print); }
/* 이름이 긴 창(받은 연차)은 이름을 칸 위에 둔다 */
.allowance details.more > .more-body > label { grid-template-columns: minmax(0, 1fr); gap: 6px; }
/* 월간 칸의 일정 적기: 이름 자리에 날짜가 오는데 58px에 담기지 않아 칸과 겹친다. 날짜를 제목처럼 칸 위에 둔다. */
details.cell-add > .more-body > label { grid-template-columns: minmax(0, 1fr); gap: 10px; }
details.cell-add > .more-body > label > span:first-child { font-size: 15px; font-weight: 700; color: var(--print); }
/* 상태 여섯 가지: 한 줄에 셋씩 작은 단추로, 지금 상태는 잉크색으로 눌려 보인다 */
.status-row { align-items: start; }
.status-row > .field-label { padding-top: 7px; }
.status-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.status-opts button { display: inline-flex; align-items: center; justify-content: center; gap: 3px; height: 30px; padding: 0 4px; border: 1px solid var(--rule); border-radius: 7px; background: transparent; color: var(--print-soft); font-size: 12.5px; white-space: nowrap; }
.status-opts button:hover { background: var(--ink-wash); color: var(--print); }
.status-opts button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); font-weight: 700; }
.status-opts button[aria-pressed="true"] .st { color: var(--paper); }
.more-actions { margin-top: 6px; padding-top: 12px; }
.ask-yes.is-danger { border-color: var(--stamp); background: var(--stamp); color: #fff; }
.ask-yes.is-danger:hover { background: #a52a20; }
.allowance details.more > .more-body { grid-template-columns: 1fr; width: min(320px, calc(100vw - 32px)) !important; }
/* 줄의 프로젝트 이름을 누르면 뜨는 고르기 창: 같은 종이 창에 프로젝트 목록만 담는다 */
.more.pick > summary { display: block; width: auto; min-width: 0; height: auto; line-height: inherit; padding: 0; border-radius: 0; opacity: 1; font-size: var(--fs-xs); font-weight: 400; letter-spacing: 0; color: var(--print-soft); cursor: pointer; }
.more.pick > summary:hover, .more.pick[open] > summary { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 0.25em; }
details.more.pick > .more-body { grid-template-columns: 1fr; gap: 12px; width: min(340px, calc(100vw - 32px)) !important; white-space: normal; text-align: left; }
.pick-head { display: flex; align-items: center; justify-content: space-between; }
.pick-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--print); }
.pick-close { width: 30px; height: 30px; margin: -6px -8px -6px 0; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--print-soft); font-size: 20px; line-height: 1; cursor: pointer; }
.pick-close:hover { background: var(--ink-wash); color: var(--print); }
.pick-list { display: flex; flex-direction: column; max-height: 56vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; margin: 0 -8px; }
.pick-group { margin: 10px 8px 2px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 11.5px; font-weight: 600; color: var(--print-soft); }
.pick-group:first-child, .pick-group.is-first { margin-top: 0; padding-top: 0; border-top: 0; }
.pick-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--print); font-size: 14.5px; font-weight: 500; text-align: left; cursor: pointer; }
.pick-item:hover, .pick-item:focus-visible { background: var(--ink-wash); outline: 0; }
.pick-dot { flex: none; width: 16px; height: 16px; border: 1.5px solid var(--rule-strong); border-radius: 50%; }
.pick-item[aria-checked="true"] { color: var(--ink); font-weight: 700; }
.pick-item[aria-checked="true"] .pick-dot { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4.5px, transparent 5px); }
.pick-name { min-width: 0; overflow-wrap: anywhere; }
.pick-item[hidden], .pick-group[hidden], .pick-empty[hidden] { display: none; }
.pick-empty { margin: 8px; font-size: 13px; color: var(--print-soft); }
details.more.pick > .more-body input.pick-search { font-weight: 400; color: var(--print); }
.pick-none { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--rule); border-radius: 0 0 8px 8px; color: var(--print-soft); }
/* 할 일 줄과 시간표의 장소 */
.task-place { color: var(--print-soft); }
.task-place::before, .ev.is-task .ev-place::before { content: "@ "; opacity: 0.7; }
@media (max-width: 699px) {
  /* 휴대폰에서는 아래에서 올라오는 창으로 */
  details.more > .more-body { inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px !important; transform: none !important; width: auto !important; max-height: 78dvh; padding: 20px 18px 16px; }
  details.more.pick > .more-body, details.more.rules > .more-body, .allowance details.more > .more-body { width: auto !important; }
  .more > summary { width: 34px; height: 34px; }
  .more-icon { width: 20px; height: 20px; }
}
/* 창이 떠 있는 동안에는 책의 면을 색인(옆·아래 막대)보다 위로 올려, 어두운 막과 창이 색인까지 덮게 한다 */
.book:has(details.more[open]) .spread { z-index: 80; }
body:has(details.more[open]) .pager-dots { display: none; }

/* ───────── 손가락으로 누르는 기기: 작은 단추의 누르는 자리를 넓힌다 ─────────
 * 상태 기호·체크·×·글자 단추는 보이는 크기가 14~22px이라 손가락으로는 빗나가기 쉽다(2026-11-17 전체 점검에서 잼).
 * 보이는 크기는 그대로 두고, 보이지 않는 덧자리(::after)로 누르는 자리만 키운다. 옆 칸을 덮지 않게 좌우는 조금만 넓힌다. */
@media (pointer: coarse) {
  :is(.mark, .check, .row-del, .text-button, .cell-tasks, .help-pop > summary, .open-link, .turner a, .daycol-num, .more.pick > summary, .more.rules > summary) { position: relative; }
  :is(.mark, .check, .row-del)::after { content: ""; position: absolute; inset: -10px -4px; }
  :is(.text-button, .cell-tasks, .help-pop > summary, .open-link, .turner a, .daycol-num, .more.pick > summary, .more.rules > summary)::after { content: ""; position: absolute; inset: -11px -6px; }
}

/* ───────── 연간 오른쪽 면(한 면씩 보는 좁은 화면) ─────────
 * 넓은 화면에서는 "쉬는 날·자리를 비우는 날" 목록이 남는 높이를 나눠 쓰는데, 한 면이 화면 하나인 좁은 화면에서는 남는 높이가 없어
 * 목록의 높이가 0이 되어 아예 보이지 않았다(2026-11-17 전체 점검). 여기서는 목록을 제 길이대로 펴고 면을 아래로 내려 본다. */
@media (max-width: 1179px) and (orientation: portrait), (max-width: 999px), (max-width: 1179px) and (max-height: 799px) {
  body[data-tab="year"] .page.right .block.grow { flex: none; }
  .year-lists { flex: none; overflow: visible; }
  .year-list ul { overflow: visible; }
}
@media (max-width: 699px) {
  .year-lists { grid-template-columns: minmax(0, 1fr); }
  /* 한 해 한눈에의 날짜 숫자: 서른한 개를 다 적으면 서로 붙어 읽을 수 없다. 1일과 5일마다만 적는다. */
  .strip-day { visibility: hidden; }
  .strip-day:nth-child(2), .strip-day:nth-child(5n + 1) { visibility: visible; }
}

/* ───────── 일간 한 쪽 보기(넓은 화면·태블릿): 두 쪽 디자인을 가로 절반으로 줄여 한 장에 나란히 ─────────
 * 사장님(2026-11-17): "내가 원하는 일간 한페이지 디자인은 기존 두페이지 디자인의 가로를 반으로 줄여서 한 페이지에 들어오게 하는 형태야".
 * 전에는 한 장에 위에서 아래로(날짜, 주요업무, 시간표, 할 일, 메모) 쌓았다. 이제 두 쪽 보기와 같은 배치를 한 장 안에 둔다:
 * 왼쪽 단에 날짜·주요업무·할 일, 오른쪽 단에 시간표·메모. 휴대폰(700px 미만)은 단이 너무 좁아지므로 아래로 잇는 모양을 그대로 둔다. */
@media (min-width: 700px) {
  /* 이 2단 그리드는 일간(.single-a/.single-b) 전용이다. 같은 껍데기(shell_single)를 쓰는 노트 연결 쪽처럼
   * .single-part가 없는 쪽에 걸리면 제목과 폼이 각각 한 단이 되어 제목이 맨 아래로 내려앉는다(2026-11-26 QA). */
  .page.single:has(> .single-part) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    column-gap: 0;
    overflow: hidden;
  }
  .page.single > .single-part { display: flex; flex-direction: column; gap: calc(var(--u) * 1.1); min-width: 0; min-height: 0; }
  .page.single > .single-part > * { order: 0; flex: none; }
  .page.single > .single-a { padding-right: calc(var(--u) * 1.8); }
  /* 가운데 접힌 자리 대신 가는 점선 하나 */
  .page.single > .single-b { padding-left: calc(var(--u) * 1.8); border-left: var(--hair) dashed var(--rule-strong); }
  /* 왼쪽 단: 할 일 목록이 남는 높이를 쓰고, 길면 그 안에서 내린다 */
  .page.single > .single-a > :nth-child(3) { flex: 1 1 0; min-height: 0; }
  /* 오른쪽 단: 두 쪽 보기처럼 시간표가 2, 메모가 1 */
  .page.single > .single-b > :nth-child(1) { flex: 2 1 0; min-height: 0; display: flex; flex-direction: column; }
  .page.single > .single-b > :nth-child(1) > .schedule { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .page.single > .single-b > :nth-child(1) > .schedule > .timeline { flex: 1 1 auto; height: auto; min-height: 0; }
  .page.single > .single-b > :nth-child(2) { flex: 1 1 0; min-height: 0; }
  /* 단이 좁으니 날짜 숫자를 한 단계 줄인다 */
  .page.single .date-num { font-size: calc(var(--fs-xxl) * 0.78); }
}
@media (min-width: 700px) {
  /* 단이 좁아 날짜 옆에 "두 쪽으로 보기"를 두면 요일이 글자마다 꺾인다. 단추는 장의 오른쪽 위 구석으로 올리고, 요일·주차는 꺾지 않는다. */
  .page.single .date-side, .page.single .date-wd, .page.single .date-meta { white-space: nowrap; }
  .page.single .head { position: static; }
  /* 오른쪽 단의 머리(시간 및 회의일정 + 이전·다음)를 왼쪽 단의 날짜 머리와 같은 높이의 굵은 줄로 맞춘다 */
  .page.single > .single-b > :nth-child(1) > .label-row { box-sizing: border-box; min-height: calc(var(--u) * 5.3); align-items: flex-end; padding-bottom: calc(var(--u) * 0.85); border-bottom: calc(var(--u) * 0.17) solid var(--print); }
  .page.single > .single-a > .head { box-sizing: border-box; }
}
/* 단이 좁은 곳(한 쪽 보기, 휴대폰)에서 일정 셋 이상이 나란하면 시각 글자까지 넣을 자리가 없다. 시각은 시간표의 자리로 알 수 있으니 감추고 제목을 보여 준다. */
.page.single .timeline .ev:not([style$="--lanes:1"]):not([style$="--lanes:2"]) > .ev-when { display: none; }
@media (max-width: 699px) {
  .timeline .ev:not([style$="--lanes:1"]):not([style$="--lanes:2"]) > .ev-when { display: none; }
}

.device-rule { display: none; color: var(--print-soft); }
.device-hint { display: none; margin: 0; padding: 6px 0 2px; font-size: var(--fs-xs); color: var(--print-soft); line-height: 1.4; }
.login .login-note { color: var(--print-soft); font-size: .85rem; }

/* 좁은 세로 화면의 일간은 설정과 관계없이 한 장에서 내려 본다. */
@media (max-width: 699px) and (orientation: portrait), (min-width: 700px) and (max-width: 1179px) and (orientation: portrait) {
  body[data-tab="day"] .spread {
    display: block;
    overflow: hidden auto;
    scroll-snap-type: none;
  }
  body[data-tab="day"] .spread > .page {
    display: flex;
    height: auto;
    min-height: 0;
    overflow: visible;
    border: 0;
  }
  body[data-tab="day"] .spread > .page.left { padding-bottom: 0; }
  body[data-tab="day"] .page.single > .single-part { display: contents; }
  body[data-tab="day"] .page.single > .single-part > * { order: 0; flex: none; }
  body[data-tab="day"] .pager-dots { display: none; }
  body[data-tab="day"] .task-list { min-height: calc(var(--row) * 3); overflow: visible; }
}

@media (max-width: 699px) and (orientation: portrait) {
  /* 최종 시안: 휴대폰의 하루는 머리 다음에 일정이 오고, 그 아래에 주요업무, 할 일, 메모 차례다. */
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) { order: 1; }
  body[data-tab="day"] .page.single > .single-a > :nth-child(2) { order: 2; }
  body[data-tab="day"] .page.single > .single-a > :nth-child(3) { order: 3; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(2) { order: 4; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(3) { order: 5; }
  .tabs .tab-today-default { display: none; }
  body[data-tab="day"] .schedule .timeline,
  body[data-tab="day"] .page.single .schedule .timeline {
    display: block;
    height: auto;
    border: 0;
  }
  body[data-tab="day"] .timeline .blocks { position: static; display: grid; gap: .35em; }
  body[data-tab="day"] .timeline .hour,
  body[data-tab="day"] .timeline .now-line { display: none; }
  body[data-tab="day"] .timeline .ev {
    position: relative;
    inset: auto;
    width: auto;
    min-height: var(--row);
    height: auto;
    align-items: center;
  }
  body[data-tab="day"] .timeline .ev > :is(.ev-when, .ev-place),
  body[data-tab="day"] .timeline .ev .ev-end { display: revert; }
}

/* 세로로 든 태블릿에서는 하루를 한 쪽에 모아 장 전체를 세로로 굴린다(최종 시안, 2026-11-26 사용자가 정함).
 * 전에는 두 단을 나란히 놓았지만 좁아서, 한 단에 위에서 아래로: 머리, 주요업무, 할 일, 시간표, 메모. */
@media (min-width: 700px) and (max-width: 1179px) and (orientation: portrait) {
  body[data-tab="day"] .spread:not(.is-single),
  body[data-tab="day"] .spread > .page.single {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    /* 칸 높이는 내용만큼. 장의 높이가 정해져 있어도 남는 높이를 나눠 갖지 않게 한다(나누면 내용이 칸 밖으로 넘쳐 포개진다). */
    grid-template-rows: none;
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
  }
  body[data-tab="day"] .spread:not(.is-single) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-tab="day"] .spread > .page,
  body[data-tab="day"] .page.single > .single-part { min-width: 0; }
  /* 한 단으로 쌓으면 장 높이가 내용만큼 자란다. 남는 높이를 나눠 갖게 짜인 칸(flex: N 1 0)은 0으로 쪼그라들어 아래 칸과 포개지므로 내용만큼 키운다. */
  body[data-tab="day"] .spread:not(.is-single) > .page > :is(.head, .block, .schedule, .folio, .label-row) { flex: none; }
  body[data-tab="day"] .spread:not(.is-single) > .page .task-list { flex: none; max-height: none; overflow: visible; }
  body[data-tab="day"] .spread > .page { padding-inline: calc(var(--u) * 1.4); }
  body[data-tab="day"] .page.single > .single-part { display: flex; }
  body[data-tab="day"] .page.left .date-num { font-size: calc(var(--fs-xxl) * .78); }
  body[data-tab="day"] :is(.page.right, .page.single) .timeline {
    flex: none;
    height: calc(var(--hours) * var(--hour));
  }
  /* 한 쪽 보기(.page.single)는 위의 `min-width: 700px` 블록에서 단 안의 칸들이 "남는 높이를 나눠 갖게"(flex: N 1 0; min-height: 0) 짜였다.
   * 그런데 여기서는 장 높이가 자동이고 장 전체가 세로로 굴러가므로, 나눠 가질 높이가 없어 칸들이 0으로 쪼그라들고 내용이 넘쳐
   * 아래 칸과 포개졌다(2026-11-26 아이패드 세로 820×1180에서 확인: 오른쪽 단 246px에 시간표 138px짜리 내용, 메모와 겹침).
   * 위쪽 규칙이 더 구체적이라(시간표는 선택자 여섯 겹) 위 `.timeline` 규칙의 고정 높이가 졌다. 같은 겹수로 내용만큼 키우게 되돌린다. */
  body[data-tab="day"] .page.single > .single-a > :nth-child(3),
  body[data-tab="day"] .page.single > .single-b > :nth-child(1),
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) > .schedule,
  body[data-tab="day"] .page.single > .single-b > :nth-child(2) { flex: none; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) > .schedule > .timeline {
    flex: none;
    height: calc(var(--hours) * var(--hour));
    min-height: 0;
  }
}

/* 연간 오른쪽 면: 책이 납작해지는 낮은 화면에서는 아래 목록(쉬는 날·자리를 비우는 날)이 한 줄 높이로 눌렸다.
 * 목록에 최소 높이를 주고, 그래서 넘치면 면을 아래로 내려 본다. 높이가 넉넉한 화면에서는 달라지는 것이 없다. */
@media (min-width: 1180px), (min-width: 1000px) and (max-width: 1179px) and (orientation: landscape) and (min-height: 800px) {
  body[data-tab="year"] .page.right { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
  body[data-tab="year"] .page.right .block.grow { flex: 1 0 auto; }
  /* 목록이 줄지 않게 했더니 이번에는 위의 목표 칸이 대신 눌려 사라졌다. 목표 칸도 줄지 않게 한다. */
  body[data-tab="year"] .page.right .year-goals { flex-shrink: 0; }
  body[data-tab="year"] .year-lists { min-height: calc(var(--u) * 11); }
}

/* ───────── 아이폰: 칸을 눌러도 화면이 확대되지 않게 ─────────
 * 사파리는 글자가 16px보다 작은 칸에 커서를 두면 화면을 확대하고 되돌리지 않는다. 휴대폰 너비에서는 칸의 글자를 16px로 올려
 * 원인을 없앤다(-webkit-touch-callout은 아이폰·아이패드의 사파리만 알아서, 다른 브라우저에는 걸리지 않는다).
 * 아이패드는 책의 글자 크기가 화면에 비례하므로 여기서 올리지 않고, 일꾼(planner-web의 shims)이 viewport에 maximum-scale을 거는 것에 맡긴다. */
@supports (-webkit-touch-callout: none) {
  @media (max-width: 699px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]), textarea, select { font-size: 16px !important; }
    /* 글자가 커지면 새 할 일 줄의 "프로젝트" 고르기가 넓어져 아랫줄로 밀린다. 너비를 묶어 한 줄에 둔다. */
    .task-add .task-project-pick { max-width: 92px; }
  }
}

/* ───────── 고르는 칸(select)의 모양을 어디서나 같게 ─────────
 * 사파리는 고르는 칸을 제 모양(둥근 알약에 위아래 화살표)으로 그려서, 같은 화면이 크롬과 달라 보였다(2026-11-17 웹킷으로 확인).
 * 브라우저의 모양을 걷어 내고 아래 화살표를 직접 그린다. */
.fields select, .leave-add select, details.more > .more-body select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23565a55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.55em center;
  background-size: 0.72em auto;
  padding-right: 1.7em;
}

/* 관리자 전용 페이지 */
body.admin-page { margin: 0; min-height: 100dvh; color: #2e2b24; background: #4c463c; font: 16px/1.45 system-ui, sans-serif; }
.admin-page .admin-sheet { width: min(920px, calc(100% - 28px)); box-sizing: border-box; margin: clamp(14px, 7vh, 72px) auto; padding: clamp(22px, 5vw, 64px); background: #f8f5eb; border: 1px solid #dbcfb8; border-radius: 8px; box-shadow: 2px 3px 0 #d8ccb6, 4px 6px 0 #887b65, 0 14px 42px #211b1655; }
.admin-page .admin-head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; border-bottom: 2px solid #332d24; padding-bottom: 14px; margin: 0 0 28px; }
.admin-page h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.15; }
.admin-page h2 { margin: 0; font-size: 1.05rem; }
.admin-page .admin-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,155px),1fr)); gap: 0 20px; margin-block: 14px; }
.admin-page .admin-metric { padding: 12px 0; border-bottom: 1px solid #d9ceb9; }
.admin-page .admin-metric strong, .admin-page .admin-metric b { display: block; font-size: 1.65rem; }
.admin-page .admin-metric > dd:not(.admin-description) { margin: 2px 0 0; font-size: 1.45rem; font-weight: 700; }
.admin-page .admin-metric > dt { color: #665d50; }
.admin-page .admin-metric .admin-description { color: #665d50; font-size: .85rem; }
.admin-page .admin-context { margin: 0 0 6px; color: #665d50; font-size: .85rem; }
.admin-page .admin-actions { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: flex-end; }
.admin-page .admin-table-wrap { overflow-x: auto; }
.admin-page .admin-table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-page .admin-table :is(th,td) { padding: .65em; border-bottom: 1px solid #d9ceb9; }
.admin-page .admin-actions :is(input,select) { padding: .4em; border: 1px solid #a99c86; border-radius: 4px; background: #fcf9f1; font: inherit; }
.admin-page .admin-metric p { margin: 0; }
.admin-page .admin-section { margin-top: 30px; }
.admin-page .admin-section > h2 { border-bottom: 1px solid #938774; padding-bottom: 9px; }
.admin-page .admin-section dl { margin: 0; }
.admin-page .admin-section dl > div { display: flex; gap: 10px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #d9ceb9; }
.admin-page .admin-section dd { margin: 0; }
.admin-page .admin-login { display: grid; gap: 12px; max-width: 360px; }
.admin-page .admin-login label { display: grid; gap: 6px; }
.admin-page .admin-login input { width: 100%; box-sizing: border-box; padding: 10px 12px; color: inherit; background: #fcf9f1; border: 1px solid #a99c86; border-radius: 4px; font: inherit; }
.admin-page button { padding: 7px 12px; color: inherit; border: 1px solid #a99c86; border-radius: 5px; background: transparent; font: inherit; cursor: pointer; }
.admin-page .admin-login button { justify-self: start; color: #f8f5eb; background: #332d24; }
.admin-page .admin-muted, .admin-page .admin-metric span { color: #665d50; font-size: .9rem; }
.admin-page a { color: inherit; text-underline-offset: .2em; }

body.admin-page { background: #eeece6; font-size: 14px; }
.admin-page .admin-sheet { width: min(1320px, calc(100% - 20px)); margin: 10px auto; padding: clamp(12px, 2vw, 24px); border-radius: 3px; box-shadow: none; }
.admin-page .admin-head { margin-bottom: 12px; padding-bottom: 8px; }
.admin-page h1 { font-size: 1.5rem; }
.admin-page .admin-section { margin-top: 14px; }
.admin-page .admin-section > h2 { padding-bottom: 4px; }
.admin-page .admin-grid { margin-block: 4px; gap: 0 12px; }
.admin-page .admin-metric { padding: 4px 0; }
.admin-page .admin-metric > dd:not(.admin-description) { font-size: 1.1rem; }
.admin-page .admin-table :is(th,td) { padding: .34em .55em; }
.admin-page .admin-table th { background: #eeeae0; }
.admin-page .admin-actions { justify-content: flex-start; }
.admin-page button { padding: 4px 8px; }
.admin-page .admin-overview { display: grid; gap: 0 20px; }
@media (min-width: 800px) {
  .admin-page .admin-overview { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .admin-page .admin-overview > :first-child { grid-row: span 2; }
}
.admin-page .admin-overview .admin-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,112px),1fr)); }
.admin-page .admin-overview .admin-muted { margin: 4px 0; font-size: .8rem; }

.admin-page .admin-overview > :first-child { grid-row: auto; }
.admin-page .admin-overview :is(p, details) { margin: 5px 0; }
.admin-page .admin-overview progress { display: block; width: 100%; height: 13px; accent-color: #356c69; }
.admin-chart { display: block; width: 100%; height: 72px; margin-block: 4px; }
.admin-chart-axis { display: flex; justify-content: space-between; color: #655e52; font-size: 12px; }
.admin-traffic { display: block; width: 100%; height: 284px; border: 0; }
body.admin-stream { margin: 0; color: #2e2b24; background: #f8f5eb; font: 12px/1.35 system-ui,sans-serif; }
.admin-stream p { margin: 3px 0; }
.admin-stream h3 { margin: 5px 0 0; font-size: 13px; }
.admin-stream .admin-chart { height: 45px; }
.admin-stream .admin-section { margin-top: 7px; }
.admin-stream h2 { margin: 0; font-size: 13px; }
.admin-stream .admin-grid { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 4px 0; }
.admin-stream dd { margin: 0; font-weight: 600; }
.admin-stream .admin-description { color: #655e52; font-weight: 400; }
.admin-page .admin-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin: 0 0 0 auto; }
.admin-page .admin-nav a { padding: 4px 8px; border: 1px solid #a99c86; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.admin-page .admin-nav a[aria-current="page"] { background: #332d24; color: #f8f5eb; }
.admin-page .admin-head > .admin-actions { justify-content: flex-end; }
.admin-page .admin-calendar-controls { justify-content: space-between; margin-block: 8px; }
.admin-calendar-modal { position: fixed; inset: 0; margin: auto; width: min(420px,calc(100% - 28px)); padding: 16px; box-sizing: border-box; color: #2e2b24; background: #f8f5eb; border: 1px solid #a99c86; border-radius: 6px; }
.admin-calendar-modal::backdrop { background: #30291f90; }
.admin-calendar-modal select { padding: 10px 12px; color: inherit; background: #fcf9f1; border: 1px solid #a99c86; border-radius: 4px; font: inherit; }

/* 위클리는 스마트폰에서 지원하지 않는다(사용자가 정함, 2026-11-26): 세로로 든 폰과 접은 폴더블, 가로로 눕힌 보통 폰.
 * 가로로 펼친 폴더블(높이 600px 이상)과 태블릿에서만 위클리가 있다. 주간 쪽을 주소로 열면 일꾼(`index.rs`)이 일간으로 보낸다. */
@media (max-width: 699px), (orientation: landscape) and (max-height: 599px) {
  a[href^="/week/"] { display: none; }
  /* 스마트폰(바형·폴더블 세로·가로로 눕힌 폰, 2026-11-26 사용자가 정함): 위클리는 쓰지 않고 데일리는 1D1P만 쓴다.
   * 알약 토글은 보이되 누를 수 없고, 쓸 수 없는 쪽은 흐리다. */
  .set [data-region="diary-type"] .seg, .set [data-region="day-layout"] .seg, .set [data-region="week-layout"] .seg { pointer-events: none; }
  .set :is([data-region="diary-type"], [data-region="day-layout"]) .seg label:first-child span { background: var(--ink); color: var(--paper); font-weight: 600; }
  .set :is([data-region="diary-type"], [data-region="day-layout"]) .seg label:last-child span { background: transparent; color: var(--print-faint); font-weight: 400; }
  .set :is([data-region="diary-type"], [data-region="day-layout"]) .seg label:last-child { opacity: .5; }
  .set [data-region="week-layout"] .seg label { opacity: .5; }
  .set [data-region="week-layout"] .seg span { background: transparent !important; color: var(--print-faint) !important; font-weight: 400 !important; }
  .set .device-hint { display: block; }
}

/* 접힌 폴더블을 가로로 펼친 화면(예: 890×626): 쪽이 가로로 짧아 책을 높이에 맞춰 키운다(최종 시안의 듀오 안쪽 가로).
 * 아이패드 미니 가로(높이 744px)는 이 규칙에 들지 않는다. */
@media (min-width: 700px) and (max-width: 999px) and (orientation: landscape) and (max-height: 699px) {
  .desk { padding: 8px 82px 8px 8px; }
  .book { --w: min(100vw - 94px, 700px); height: calc(100dvh - 16px); }
  /* 하루는 한 단으로 위에서 아래로(머리, 주요업무, 할 일, 시간표, 메모): 두 단으로 나누기에는 쪽이 좁다 */
  body[data-tab="day"] .page.single:has(> .single-part) { display: flex; flex-direction: column; overflow-y: auto; }
  body[data-tab="day"] .page.single > .single-part { display: contents; }
  body[data-tab="day"] .page.single > .single-part > * { flex: none; }
  body[data-tab="day"] .page.single > .single-a > :nth-child(1) { order: 0; }
  body[data-tab="day"] .page.single > .single-a > :nth-child(2) { order: 1; }
  body[data-tab="day"] .page.single > .single-a > :nth-child(3) { order: 2; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) { order: 3; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(2) { order: 4; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(3) { order: 5; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) > .schedule,
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) > .schedule > .timeline { flex: none; height: auto; min-height: 0; }
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) > .schedule > .timeline { height: calc(var(--hours) * var(--hour)); }
  body[data-tab="day"] .page.single > .single-b > :nth-child(1) > .label-row { border-bottom: 0; min-height: 0; padding-bottom: 0; }
}

/* 아직 없는 기능의 자리(최종 시안의 계정 구획): 흐리게 */
.row.is-soon { opacity: .55; }
.row.is-soon .plain-button { cursor: default; }

/* ───────── 근태 내역 필터 알약(최종 시안): 왼쪽 "근태 기록" 줄의 오른쪽 ───────── */
.more.leave-filter-more { position: static; margin-left: auto; }
.more.leave-filter-more > summary {
  display: block; width: auto; min-width: 0; height: auto; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.8);
  border: var(--hair) solid var(--rule-strong); border-radius: calc(var(--u) * 2);
  font-size: var(--fs-xs); font-weight: 500; line-height: inherit; color: var(--print-soft); opacity: 1; white-space: nowrap;
}
.more.leave-filter-more > summary:hover, .more.leave-filter-more[open] > summary { color: var(--print); border-color: var(--print); }
.more.leave-filter-more > summary .filter-name { color: var(--ink); font-weight: 700; }
.filter-on { font-weight: 500; color: var(--print-soft); }
.filter-on a { color: var(--print-soft); text-underline-offset: .2em; }


.date-notes { word-break: keep-all; }

/* ───────── 고르기 창(`ui::pick_window`) ─────────
 * 프로젝트·프로덕트를 고르는 곳은 모두 같은 종이 창이다. 닫혀 있을 때는 지금 고른 이름이 글자로 보이고(안내 글은 흐리게) 오른쪽에 작은 화살표가 붙는다.
 * 항목은 보이지 않는 라디오 칸이라 고른 항목은 `:has(:checked)`로 표시한다(줄에서 바로 고르는 창은 `aria-checked`). */
.more-body label.pick-item { flex-direction: row; align-items: center; gap: 10px; }
.more-body label.pick-item > .pick-name { font-size: inherit; font-weight: inherit; color: inherit; }
.pick-radio, details.more > .more-body .pick-radio { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
label.pick-item:has(.pick-radio:checked) { color: var(--ink); font-weight: 700; }
label.pick-item:has(.pick-radio:checked) .pick-dot { border-color: var(--ink); background: radial-gradient(circle, var(--ink) 0 4.5px, transparent 5px); }
label.pick-item:has(.pick-radio:focus-visible) { background: var(--ink-wash); }
.pick-trigger {
  display: flex !important; align-items: center; justify-content: space-between; gap: .4em; min-width: 0;
  color: var(--ink); font-weight: 500; cursor: pointer; list-style: none;
}
.pick-trigger::-webkit-details-marker { display: none; }
.pick-caret { flex: none; width: .7em; height: .45em; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%23565a55' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.pick-trigger.is-empty, .more.pick > summary.pick-trigger.is-empty { color: var(--print-faint); font-weight: 400; }
.pick-current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 이름 아래 밑줄 칸 모양: 프로젝트 추가·프로젝트 내용의 프로덕트, 노트의 프로젝트 */
.more.pick > summary.product-pick, .more.pick > summary.note-project-pick {
  width: 100%; height: var(--row); padding: 0 .1em; border-radius: 0; border-bottom: var(--hair) solid var(--rule); font-size: var(--fs-m); line-height: 1;
}
.fields .more.pick > summary.product-pick { height: auto; padding-block: calc(var(--u) * .3); border-bottom-color: var(--rule-strong); font-weight: 500; }
.more.pick > summary.product-pick:hover, .more.pick > summary.note-project-pick:hover, .more.pick[open] > summary.product-pick { text-decoration: none; color: var(--ink); background: var(--ink-wash); }
.note-project { display: inline-flex; align-items: center; gap: .6em; }
.note-project > span { color: var(--print-soft); }
.more.pick > summary.note-project-pick { width: auto; height: auto; min-width: 5em; padding: .15em .1em; font-size: var(--fs-s); }
/* 할 일을 적는 줄의 "프로젝트": 이전 고르는 칸과 같은 자리·크기 */
.task-main > .more.pick-choose { flex: 0 0 auto; margin-left: auto; }
.more.pick > summary.task-project-pick {
  display: flex !important; max-width: calc(var(--u) * 11); height: var(--row); padding: 0 calc(var(--u) * .3);
  font-size: var(--fs-xs); font-weight: 400; color: var(--print-soft); text-decoration: none;
}
.more.pick > summary.task-project-pick:hover { color: var(--ink); background: var(--ink-wash); text-decoration: none; }
.more.pick > summary.task-project-pick .pick-current { text-align: right; }
.more.pick > summary.task-project-pick.is-empty { color: var(--print-faint); }
/* 새 프로덕트: 이름 칸은 "새 프로덕트"를 골랐을 때만 보인다 */
.pick-new { display: none; gap: 12px; }
details.more.pick > .more-body:has(.pick-radio[value="new"]:checked) .pick-new { display: grid; }
.pick-new .product-new { display: block; width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: 8px; background: var(--paper); }
.product-picker { display: flex; align-items: center; gap: .6em; }
.product-picker > .more { flex: 1 1 auto; min-width: 0; }

/* ───────── 체크 상자를 책의 모양으로 ─────────
 * 운영체제 기본 체크 상자(파란/검은 네모)는 책의 스위치·단추와 달랐다. 둥근 네모 테두리, 켜면 잉크색으로 채우고 흰 표시를 한다.
 * 스위치(`.switch`)·연간의 "일정 보기" 알약·보이지 않는 색인 상태 칸은 따로 그리므로 뺀다. */
input[type="checkbox"]:not(.index-state):not(.switch input):not(.year-count-toggle input) {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  vertical-align: -0.2em;
  border: 1.5px solid var(--rule-strong);
  border-radius: 0.28em;
  background: transparent no-repeat center / 78%;
  cursor: pointer;
}
input[type="checkbox"]:not(.index-state):not(.switch input):not(.year-count-toggle input):checked {
  border-color: var(--ink);
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.4 6.3 5 8.8l4.7-5.3' fill='none' stroke='%23fbf9f2' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input[type="checkbox"]:not(.index-state):not(.switch input):not(.year-count-toggle input):focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 월간 칸의 "+"(일정 적기)는 마우스가 올라갈 때만 보인다(최종 시안은 칸에 아무 표시가 없다). 손가락 기기(hover 없음)에서는 늘 보인다. */
@media (hover: hover) {
  .cell .cell-add > summary { opacity: 0; }
  .cell:hover .cell-add > summary, .cell:focus-within .cell-add > summary, .cell .cell-add[open] > summary { opacity: 1; }
}

/* 위클리 4쪽형(1W4P)은 펼침면 화면(프로·에어 가로, 컴퓨터)에서만 쓴다. 패드 세로·아이패드 미니·폴더블 가로에서는 1W2P만: 1W4P 쪽은 흐리고 누를 수 없다.
 * (일꾼 `index.rs`의 `SPREAD`와 같은 조건의 반대다. 스마트폰에서는 위클리 방식 줄 전체가 흐리게 따로 처리된다.) */
@media not all and ((min-width: 1180px) or ((min-width: 1000px) and (max-width: 1179px) and (orientation: landscape) and (min-height: 800px))) {
  .set [data-region="week-layout"] .seg label:last-child { opacity: .5; pointer-events: none; }
  .set [data-region="week-layout"] .seg label:last-child span { background: transparent; color: var(--print-faint); font-weight: 400; }
  .set [data-region="week-layout"] .seg label:first-child span { background: var(--ink); color: var(--paper); font-weight: 600; }
}

/* 하루 종일 칩·일정 칸의 ⋯: 마우스를 올렸을 때 나타나는 동그라미가 칸 밖으로 삐져나오지 않게, 칸 높이 안에 들어가는 크기로 줄인다.
 * 칩은 일정 칸과 같은 굵기(600)로 하고 조금 키운다(다른 일정 칸보다 작아 보였다). */
/* ⋯ 단추의 호버 동그라미는 칸 높이보다 작게(사용자가 너무 크다고 함): 칩 1.2em, 일정 칸 1.1em */
:is(.chip, .ev) > .more > summary { width: 1.2em; height: 1.2em; font-size: inherit; }
:is(.chip, .ev) > .more > summary .more-icon { width: 1em; height: 1em; }
.chip { line-height: 2; font-weight: 600; }
.chip > input { font-weight: 600; }
/* 30분짜리처럼 낮은 일정 칸에서도 ⋯의 동그라미가 칸 안에 들어가도록 일정 칸은 더 작게 */
.ev > .more > summary { width: 1.1em; height: 1.1em; }

/* 월간 칸 전체가 그날로 가는 링크다(칸의 빈 곳을 눌러도 열린다). "+"(일정 적기)는 없앴다: 월간 칸에서는 적지 않고 그날의 쪽에서 적는다(사용자가 정함, 2026-11-26). */
.cell { position: relative; }
.cell-open { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.cell > :not(.cell-open) { position: relative; z-index: 1; }
@media (hover: hover) { .cell:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); } }
.cell-open { cursor: pointer; }

/* 쪽에 직접 쓰는 칸(목표·할 일·일정·메모·노트 제목 …)은 눌러도 네모 칸이 생기지 않고 커서만 깜박인다.
 * 실제 종이 책에는 칸이 쳐지지 않으므로(사용자가 정함, 2026-11-26). 설정의 상자 칸(.field)과 종이 창(.more-body) 안의 칸은 그대로 둔다. */
.page :is(input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"], [type="search"], .field), textarea):not(.more-body *):focus,
.page :is(input:not([type="checkbox"], [type="radio"], [type="color"], [type="file"], [type="search"], .field), textarea):not(.more-body *):focus-visible {
  outline: 0;
  box-shadow: none;
  background-color: transparent;
}
.page :is(input.ink, textarea.ink):not(.more-body *):focus-visible { background-color: transparent; }

/* 날짜에 붙여 둔 옛 스티커도 늘 눌러서 집을 수 있다(누르면 아무 자리에나 찍은 스티커가 되어 옮기고 돌리고 복사할 수 있다) */
.stuck .sticker { pointer-events: auto; cursor: grab; }
.stuck .sticker:hover { opacity: 0.8; }

/* 월간 달력 안의 글자는 모두 0.5pt씩 키웠다(1pt는 칸에 줄이 넘쳐 0.5pt로 줄였다)(사용자 요청, 2026-11-26): 날짜 숫자, 일정·할 일 줄, 음력·기념일, "할 일 n", 요일, 주차. */
.month .cell-num { font-size: calc(var(--fs-m) + 0.5pt); }
.month .cell .line, .month .cell .line-when, .month .cell .line-title, .month .cell-tasks, .month .cell .date-notes, .month .cell .cell-holiday { font-size: calc(var(--fs-xs) + 0.5pt); }
.month .dow { font-size: calc(var(--fs-s) + 0.5pt); }
.month .wk { font-size: calc(var(--fs-xs) + 0.5pt); }
.month-event-band { font-size: calc(var(--fs-xs) + 0.5pt); --band-height: calc((var(--fs-xs) + 0.5pt) * 1.42); }
.month .month-task-lines .st-inline, .month .month-task .st-inline { font-size: calc(var(--fs-xs) + 0.5pt); }
/* 월간 칸의 할 일 줄: 동그라미 단추와 글. 동그라미를 누르면 곧바로 바뀐다. */
.month-task { display: flex; align-items: baseline; gap: .25em; min-width: 0; margin: 0; }
.month-task .st-inline { flex: none; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; line-height: 1; font: inherit; align-self: center; }
.month-task .st-inline svg { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }
.month-task .st-inline:hover { opacity: .55; }
.month-task .line-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month .cell .line.is-closed .month-task .line-title, .month .cell .is-closed .month-task .line-title { text-decoration: line-through; }
.month .cell .is-urgent .month-task .line-title { color: var(--stamp); }
.fit-rest-list { list-style: none; margin: 0; padding: 0; }
/* 월간 칸 안의 목록은 줄어들지 않는다(줄어들면 글자가 겹친다). 칸에 다 안 들어가는 줄은 일꾼이 숨기고 "+N"으로 줄인다. */
.month .cell > .lines, .month .cell > .month-task-lines { flex: none; min-height: 0; }

/* ───────── 노트 스티커(노트 연결) ─────────
 * 노트를 쪽의 원하는 자리에 거는 종이 쪽지. 다른 스티커처럼 옮기고 돌리고 크기를 바꾸고 복사하고 지운다. 고른 채 한 번 더 누르면 노트가 열린다. */
.note-sticker {
  display: inline-flex; align-items: center; gap: .3em; max-width: 14em;
  padding: .35em .7em; border: 1px solid color-mix(in srgb, var(--cover) 25%, var(--rule)); border-radius: .35em;
  background: #f0e7d4; color: var(--print); box-shadow: 0 1px 2px #29221824; text-decoration: none; font-weight: 650; font-size: 1em; line-height: 1.2;
}
.note-sticker::before { content: ""; flex: none; width: .75em; height: .9em; border: 1.5px solid currentColor; border-radius: .12em; opacity: .55; }
.note-sticker-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-sticker.is-gone { opacity: .55; }
.placed-item > .note-sticker { --tilt: 0deg; }
/* 서랍의 노트 목록 */
.tray-notes { display: flex; flex-direction: column; gap: 4px; max-height: 9.5em; overflow-y: auto; scrollbar-width: thin; }
.tray-note { display: block; width: 100%; padding: .4em .7em; border: 1px solid var(--rule); border-radius: .35em; background: #f0e7d4; color: var(--print); font: inherit; font-size: var(--fs-s); font-weight: 600; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.tray-note:hover, .tray-note[aria-pressed="true"] { border-color: var(--print); }
.tray-empty { margin: 0; font-size: var(--fs-xs); color: var(--print-soft); }
.tray-note { flex: none; min-height: 2em; }
/* 월간 칸의 줄이 어떤 까닭으로든 칸에 다 들어가지 않아도(일꾼이 아직 재기 전, 글꼴이 늦게 들어올 때) 옆·아래 칸으로 넘치지 않게 한다. */
.month .cell { overflow: hidden; }
/* "노트 걸기"(쪽 아래): 눈에 띄지 않는 밑줄 글자. 누르면 노트를 고르는 종이 창 */
.more.pick > summary.note-hang-trigger { display: inline; font-size: var(--fs-s); font-weight: 600; color: var(--print); text-decoration: underline; text-underline-offset: .25em; }
.more.pick > summary.note-hang-trigger:hover { color: var(--ink); }
.note-hang .pick-item { flex: none; }
.note-hang .tray-item[aria-pressed="true"] { background: var(--ink-wash); }

/* 일정 블록의 앞(색 막대)이 둥글면 뒤도 같은 크기로 둥글게(사용자 지적): 일정 칸·하루 종일 칩·월간 띠·주간 시간표 칸·종일 일정에 같은 반지름을 쓴다. */
.ev, .chip, .month-event-band, .week-time-entry, .line.is-outside:not(:has(.line-when)), .line:not(:has(.line-when)) { border-radius: 0.45em; }
.ev.is-meeting { border-radius: 0.45em; }

/* ───────── 일정 블록의 색(내가 고른 색) ─────────
 * 일간 일정 칸·하루 종일 칩·주간 시간표 칸·월간 칸과 띠에 같은 색이 나온다. 안 골랐으면 기본 잉크색. */
.ev.is-colored, .chip.is-colored { border-left-color: var(--mine); background: color-mix(in srgb, var(--mine) 15%, var(--paper)); }
.week-time-entry.is-colored { border-inline-start: .25em solid var(--mine); background: color-mix(in srgb, var(--mine) 15%, var(--paper)); }
.line.is-colored .line-when { color: var(--mine); opacity: 1; }
.line.is-colored:not(:has(.line-when)) { border-left-color: var(--mine); }
.month-event-band[style*="--mine"] { background: color-mix(in srgb, var(--mine) 18%, var(--paper)); box-shadow: inset .22em 0 0 var(--mine); }
.event-colors { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.event-colors label { cursor: pointer; display: block; }
.event-colors input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.event-colors span { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--swatch, transparent); border: 1.5px solid color-mix(in srgb, var(--swatch, var(--rule-strong)) 55%, var(--paper)); }
.event-colors label:first-child span { background: var(--ink); border-color: var(--ink); }
.event-colors input:checked + span { outline: 2px solid var(--print); outline-offset: 2px; }

/* ───────── 모달(종이 창)을 간결하게 (2026-11-26, 사용자 지적: 다른 화면보다 글자·단추가 유독 크다) ─────────
 * 쪽의 글자(--fs-*)에 맞춰 줄인다: 창의 글은 쪽 본문(--fs-m)과 같고, 이름표는 --fs-xs, 칸 높이 30px, 단추 28px, 폭 340px.
 * 손가락으로 쓰는 좁은 화면(700px 미만)은 누르기 좋게 전의 크기를 그대로 둔다. */
@media (min-width: 700px) {
  details.more > .more-body { width: min(340px, calc(100vw - 32px)) !important; padding: 16px 18px 14px; gap: 9px 10px; font-size: var(--fs-m); border-radius: 7px; }
  details.more > .more-body > label, .field-row, .status-row { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
  details.more > .more-body > label > span:first-child, .field-label { font-size: var(--fs-xs); }
  details.more > .more-body label > span { font-size: var(--fs-xs); }
  details.more > .more-body .tick > span { font-size: var(--fs-m); }
  details.more > .more-body input:not([type="checkbox"]), details.more > .more-body select { height: 30px; padding: 0 8px; font-size: var(--fs-m); border-radius: 6px; }
  details.more > .more-body textarea { font-size: var(--fs-m); border-radius: 6px; }
  .more-actions { margin-top: 4px; padding-top: 10px; }
  .more-actions button, .more-actions .more-done { min-height: 28px; height: 28px; padding: 0 12px; font-size: var(--fs-s); border-radius: 6px; }
  .more-actions .more-done { min-width: 64px; background: var(--print); border-color: var(--print); }
  .more-actions .more-done:hover { background: var(--ink); }
  .pick-title { font-size: var(--fs-m); }
  .pick-item { min-height: 30px; padding: 4px 8px; font-size: var(--fs-m); gap: 8px; }
  .pick-dot { width: 13px; height: 13px; }
  .pick-close { width: 24px; height: 24px; font-size: 17px; }
  .pick-group { font-size: var(--fs-xs); margin: 8px 8px 2px; padding-top: 8px; }
  details.more.pick > .more-body { width: min(300px, calc(100vw - 32px)) !important; }
  .status-opts button { height: 26px; font-size: var(--fs-xs); }
  details.more.rules > .more-body { width: min(400px, calc(100vw - 32px)) !important; }
  details.more.rules .cuts-form, details.more.rules .cut-row input, details.more.rules .cut-row select { font-size: var(--fs-m); }
  details.more.rules .cut-row input, details.more.rules .cut-row select { height: 28px; }
  .field-pair { gap: 4px; }
  .event-colors span { width: 15px; height: 15px; }
}
/* 확인 창(되묻기)과 서랍도 같은 크기 감각으로 */
@media (min-width: 700px) {
  .ask { font-size: var(--fs-m); }
  .ask-actions button, .ask-yes { min-height: 28px; padding: 0 14px; font-size: var(--fs-s); border-radius: 6px; }
}

/* 종일 일정: 한 줄을 일정 수만큼 나눈 긴 칸(1개면 가득, 2개면 1/2, 3개면 1/3 …, 최대 4칸). 5개부터는 4개만 보이고 "+N". */
.allday { align-items: center; }
.allday-items { flex: 1 1 auto; display: grid; grid-template-columns: repeat(var(--n, 1), minmax(0, 1fr)); gap: calc(var(--u) * 0.5); min-width: 0; }
.allday-items > .chip { display: flex; align-items: center; width: 100%; min-width: 0; box-sizing: border-box; }
.allday-items > .chip > input.ink { flex: 1 1 0; min-width: 0; width: 100%; max-width: none; field-sizing: fixed; text-overflow: ellipsis; }
.allday-items > .chip > .more { margin-left: auto; flex: none; }
.allday-rest { flex: none; font-size: var(--fs-xs); font-weight: 700; color: var(--print-soft); padding-inline: .2em; }

/* 노트 목록의 줄 높이는 오른쪽 면의 줄 간격(--row)과 같다(사용자 지정: 좌우 줄 높이를 오른쪽 기준으로). */
@media (min-width: 700px) {
  .note-list a { box-sizing: border-box; height: var(--row); min-height: var(--row); padding-block: 0; align-items: center; border-bottom: var(--hair) solid var(--rule); }
}
/* 노트의 "프로젝트"·"작성일" 표시는 너무 작았다(사용자 지적): 본문 글자(--fs-m)와 같게 키운다. */
.note-meta, .note-meta > span, .note-project > span { font-size: var(--fs-m); }
.more.pick > summary.note-project-pick { font-size: var(--fs-m); }

/* 노트 번호(N001): 제목 아래 줄의 오른쪽 위에 회색으로 작게(사용자 지정, 2026-11-26). */
.note-title-wrap { position: relative; }
.note-no { position: absolute; right: 0; bottom: calc(var(--hair) + 4px); font-size: var(--fs-xs); font-weight: 500; color: var(--print-faint); letter-spacing: .04em; font-variant-numeric: tabular-nums; pointer-events: none; user-select: none; }
.note-title-wrap > .note-title { width: 100%; padding-right: 4.2em; box-sizing: border-box; }

/* 프로젝트 쪽 머리: 다른 쪽(설정·노트 …)과 같이 제목이 줄 바로 위에 앉는다(전에는 위에 떠 있고 줄만 멀었다, 사용자 지적). 개수 요약은 제목 오른쪽 아래 맞춤. */
.head.project-index-head { align-items: flex-end; flex-wrap: nowrap; gap: calc(var(--u) * 0.85); }
.project-index-head .title { line-height: 1; }
.project-index-head .project-status-summary { padding-bottom: .15em; line-height: 1.1; }
@media (max-width: 699px) { .head.project-index-head { flex-wrap: wrap; } }

/* 프로젝트 이름 아래에는 노트 제목 아래와 같은 가는 줄을 둔다(사용자 지정). */
.project-title-row { padding-bottom: calc(var(--u) * 0.85); border-bottom: var(--hair) solid var(--rule-strong); }

/* 노트 삭제: 앞에 휴지통, 연한 빨강(사용자 지정). 지우는 단추라 빨강을 허락했다. */
.plain-button.note-delete { display: inline-flex; align-items: center; gap: .35em; color: color-mix(in srgb, var(--stamp) 65%, var(--paper)); border-color: color-mix(in srgb, var(--stamp) 38%, var(--paper)); }
.plain-button.note-delete:hover { color: var(--stamp); border-color: var(--stamp); }

/* 노트의 "프로젝트 · 작성일" 줄(사용자 지정): 밑에 줄 하나, 프로젝트는 밑줄 드롭다운 대신 알약(눌러서 고르는 이름표), 작성일은 오른쪽 끝. */
.note-meta { justify-content: space-between; flex-wrap: nowrap; padding-bottom: .55em; margin-block: .65em 0; border-bottom: var(--hair) solid var(--rule-strong); }
.note-meta > span:last-child { margin-left: auto; white-space: nowrap; color: var(--print-soft); }
.more.pick > summary.note-project-pick {
  width: auto; height: auto; min-width: 0; padding: .18em .8em .18em .9em; gap: .5em;
  border: var(--hair) solid var(--rule-strong); border-radius: 999px; background: transparent;
  color: var(--print); font-weight: 600;
}
.more.pick > summary.note-project-pick.is-empty { color: var(--print-soft); font-weight: 500; }
.more.pick > summary.note-project-pick:hover, .more.pick[open] > summary.note-project-pick { background: var(--ink-wash); border-color: var(--print); text-decoration: none; }
.more.pick > summary.note-project-pick:not(.is-empty) { border-color: var(--ink); }

/* ───────── 모달 글자를 쪽의 목록 글자(--fs-s)에 맞춘다 (사용자 재지적: 일반 페이지보다 크다) ─────────
 * 쪽의 줄(할 일·일정)이 --fs-s이므로 창 안의 글도 --fs-s, 이름표는 --fs-xs, 칸·단추는 그에 맞춰 더 줄인다. */
@media (min-width: 700px) {
  details.more > .more-body, .more-body { font-size: var(--fs-s); }
  details.more > .more-body input:not([type="checkbox"]), details.more > .more-body select, details.more > .more-body textarea { font-size: var(--fs-s); height: 28px; }
  details.more > .more-body .tick > span { font-size: var(--fs-s); }
  details.more > .more-body > label > span:first-child, .field-label, details.more > .more-body label > span { font-size: var(--fs-xs); }
  .more-actions button, .more-actions .more-done { height: 26px; min-height: 26px; font-size: var(--fs-xs); }
  .pick-title { font-size: var(--fs-s); }
  .pick-item { font-size: var(--fs-s); min-height: 28px; }
  .pick-group { font-size: var(--fs-xs); }
  .pick-empty { font-size: var(--fs-xs); }
  .pick-dot { width: 11.5px; height: 11.5px; border-width: 1.5px; }
  label.pick-item:has(.pick-radio:checked) .pick-dot { background: radial-gradient(circle, var(--ink) 0 3.4px, transparent 3.8px); }
  details.more.pick > .more-body { width: min(280px, calc(100vw - 32px)) !important; }
  .status-opts button { font-size: var(--fs-xs); }
  .ask, .ask-actions button, .ask-yes { font-size: var(--fs-s); }
}

/* ───────── 프로젝트 고르기(노션의 관계 고르기처럼) ───────── */
.pick-searchbox { position: relative; }
.pick-searchbox .pick-glass { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--print-soft); pointer-events: none; }
details.more.pick .pick-searchbox input.pick-search { padding-left: 29px; }
.pick-item .pick-check { margin-left: auto; opacity: 0; color: var(--ink); font-weight: 700; font-size: var(--fs-xs); }
.pick-item[aria-checked="true"] .pick-check, label.pick-item:has(.pick-radio:checked) .pick-check { opacity: 1; }
.pick-item .pick-area { margin-left: .5em; font-size: var(--fs-xs); font-weight: 400; color: var(--print-faint); white-space: nowrap; }
.pick-item:has(.pick-check) .pick-name { flex: 0 1 auto; }
.pick-recent { margin-top: 2px; }
.pick-list:not(.is-all) .pick-fold { display: none; }
.pick-list.is-all .pick-show-all { display: none; }
.pick-show-all { display: block; width: calc(100% - 16px); margin: 6px 8px 2px; padding: 5px 0; border: 0; border-top: var(--hair) solid var(--rule); background: none; color: var(--print-soft); font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.pick-show-all:hover { color: var(--ink); }
.pick-create { margin: 4px -8px 0; padding-top: 4px; border-top: var(--hair) solid var(--rule); }
.pick-create[hidden] { display: none; }
.pick-create-go { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 28px; padding: 4px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: var(--fs-s); font-weight: 600; text-align: left; cursor: pointer; }
.pick-create-go:hover, .pick-create-go:focus-visible { background: var(--ink-wash); outline: 0; }
.pick-plus { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 4px; background: var(--ink); color: var(--paper); font-size: 12px; line-height: 1; }
.pick-create-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 일꾼이 멈췄을 때 화면 구석에 까닭을 보인다(개발 중 단추가 안 눌릴 때 바로 알 수 있게). */
.worker-halt { position: fixed; z-index: 999; left: 8px; bottom: 8px; max-width: min(520px, calc(100vw - 16px)); padding: 6px 10px; border-radius: 6px; background: #3a1d19; color: #ffd9d3; font: 12px/1.35 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; }

/* 모달 안의 글자를 1pt씩 키웠다(사용자 요청, 2026-11-26): 쪽의 목록 글자(--fs-s)보다 1pt 크게, 이름표는 --fs-xs보다 1pt 크게. */
@media (min-width: 700px) {
  details.more > .more-body, .more-body { font-size: calc(var(--fs-s) + 1pt); }
  details.more > .more-body input:not([type="checkbox"]), details.more > .more-body select, details.more > .more-body textarea { font-size: calc(var(--fs-s) + 1pt); height: 30px; }
  details.more > .more-body .tick > span { font-size: calc(var(--fs-s) + 1pt); }
  details.more > .more-body > label > span:first-child, .field-label, details.more > .more-body label > span { font-size: calc(var(--fs-xs) + 1pt); }
  .more-actions button, .more-actions .more-done { height: 28px; min-height: 28px; font-size: calc(var(--fs-xs) + 1pt); }
  .pick-title { font-size: calc(var(--fs-s) + 1pt); }
  .pick-item { font-size: calc(var(--fs-s) + 1pt); min-height: 30px; }
  .pick-group, .pick-empty, .pick-show-all, .pick-item .pick-area { font-size: calc(var(--fs-xs) + 1pt); }
  .pick-create-go { font-size: calc(var(--fs-s) + 1pt); }
  .status-opts button { font-size: calc(var(--fs-xs) + 1pt); }
  .ask, .ask-actions button, .ask-yes { font-size: calc(var(--fs-s) + 1pt); }
}

/* 노트 하단 "프로젝트 · 작성일"은 0.5pt 낮췄고(사용자 요청), 프로젝트 내용의 칸(프로덕트·상태·시작일·종료일)도 같은 모양으로 맞췄다:
 * 이름표는 위에 작게, 값은 알약, 줄 아래에 가는 줄 하나. */
.note-meta, .note-meta > span, .note-project > span, .more.pick > summary.note-project-pick { font-size: calc(var(--fs-m) - 0.5pt); }
.project-form .fields { padding-bottom: .7em; border-bottom: var(--hair) solid var(--rule-strong); align-items: end; }
.project-form .fields > label > span, .project-form .fields .product-field > span { font-size: calc(var(--fs-xs) - 0.5pt); color: var(--print-soft); }
.project-form .fields select, .project-form .fields input[type="text"], .project-form .fields input[type="date"], .project-form .fields .more.pick > summary.product-pick {
  box-sizing: border-box; width: 100%; height: auto; padding: .22em .9em; border: var(--hair) solid var(--rule-strong); border-radius: 999px;
  background-color: transparent; color: var(--print); font-size: calc(var(--fs-m) - 0.5pt); font-weight: 600;
}
.project-form .fields select { padding-right: 2em; background-position: right .85em center; }
.project-form .fields .more.pick > summary.product-pick { display: flex !important; height: auto; }
.project-form .fields .more.pick > summary.product-pick.is-empty { color: var(--print-soft); font-weight: 500; }
.project-form .fields select:hover, .project-form .fields input:hover, .project-form .fields .more.pick > summary.product-pick:hover { background: var(--ink-wash); border-color: var(--print); }

/* "+ 새 프로덕트": 앞의 동그라미 없이, 고르면 바로 아래에 이름 칸이 펼쳐진다(사용자 지정). */
.pick-new-item .pick-dot { display: none; }
.pick-new-item .pick-name { font-weight: 600; color: var(--ink); }
.pick-list .pick-new { margin: 2px 0 6px; padding: 0 8px 4px; }
.pick-list .pick-new .product-new { height: 30px; }

/* ───────── 아래로 펼쳐지는 고르기(`ui::drop_select`) ─────────
 * 이름표(알약) 바로 아래에 목록이 펼쳐진다. 운영체제의 드롭다운은 고른 칸을 가려서 쓰지 않는다(사용자 지적). */
details.more.drop { position: relative; }
details.more.drop > .more-body {
  position: absolute !important; inset: calc(100% + 4px) auto auto 0 !important; transform: none !important;
  width: max-content !important; min-width: 100%; max-height: none; padding: 4px; gap: 0; display: block;
  background: var(--paper); border: 1px solid var(--paper-edge); border-radius: 10px; box-shadow: 0 8px 24px #0000003d; z-index: 40;
}
.drop-item { display: flex !important; align-items: center; gap: 1.2em; min-height: 28px; padding: 3px 10px; border-radius: 7px; color: var(--print); font-size: calc(var(--fs-s) + 1pt); cursor: pointer; white-space: nowrap; }
.drop-item:hover { background: var(--ink-wash); }
.drop-item:has(.pick-radio:checked) { font-weight: 700; color: var(--ink); }
.drop-item .pick-name { flex: 1 1 auto; font-size: inherit; font-weight: inherit; color: inherit; }
.drop-item:has(.pick-radio:checked) .pick-check { opacity: 1; }
.drop-item:has(.pick-radio:focus-visible) { background: var(--ink-wash); }
/* 프로젝트 내용의 칸 안에서는 다른 알약과 같은 모양 */
.project-form .fields .more.drop > summary.drop-trigger {
  display: flex !important; box-sizing: border-box; width: 100%; height: auto; padding: .22em .9em; border: var(--hair) solid var(--rule-strong); border-radius: 999px;
  color: var(--print); font-size: calc(var(--fs-m) - 0.5pt); font-weight: 600; justify-content: space-between;
}
.project-form .fields .more.drop > summary.drop-trigger:hover, .project-form .fields .more.drop[open] > summary.drop-trigger { background: var(--ink-wash); border-color: var(--print); }

/* 날짜 고르기(달력 창)는 6pt(8px) 줄였다(사용자 요청, 2026-11-26): 폭에서 8px을 덜고, 날짜 칸은 폭을 따라 함께 줄어든다. 아래 "오늘 · 지우기" 위의 줄은 없애고 지우기는 빨강. */
@media (min-width: 700px) {
  .datepop { width: calc(var(--u) * 21 - 6pt); font-size: calc(var(--fs-s) - 0.5pt); }
  .datepop-title { font-size: calc(var(--fs-m) - 0.5pt); }
}
.datepop-foot { border-top: 0; }
.datepop-foot .text-button:last-child:not(:first-child) { color: var(--stamp); }

/* 아래로 펼쳐지는 고르기: 항목은 한 줄(이름 왼쪽, ✓ 오른쪽). 칸 안의 `.more-body label`이 세로로 쌓던 것을 되돌린다. */
.more-body .drop-item { flex-direction: row !important; }
/* 근태 입력: 구분+종일/시간 지정, 날짜+장소를 한 줄에 (2026-11-26, 사용자 요청) */
.leave-add > .field-row.kind-row { grid-template-columns: calc(var(--fs-s) * 2.6) minmax(0, 1fr) auto; }
.leave-add > .field-row.date-place { grid-template-columns: calc(var(--fs-s) * 2.6) minmax(0, 1.7fr) calc(var(--fs-s) * 2.6) minmax(0, 1fr); }
@media (max-width: 699px) {
  .leave-add > .field-row.kind-row { grid-template-columns: calc(var(--fs-s) * 2.6) minmax(0, 1fr); }
  .leave-add > .field-row.kind-row > .leave-duration { grid-column: 2; }
  .leave-add > .field-row.date-place { grid-template-columns: calc(var(--fs-s) * 2.6) minmax(0, 1fr); }
}
/* 열기 단추(`details.more > summary`)의 줄 높이 0이 이름표 글씨를 지우던 것을 되돌린다 */
details.more.drop > summary.drop-trigger { line-height: 1.35; }

/* ───────── 근태 쪽 (2026-11-26, 사용자 요청) ─────────
 * · 근태 규칙은 설정 쪽의 한 갈래(`#leave-rules`)로 옮겼다. 근태 쪽에는 그리로 가는 글줄만 둔다.
 * · "+ 새 근태"는 종이 창. 거르기는 오른쪽 쪽 머리의 "이전·다음" 옆.
 * · 내역이 한 쪽(11줄)을 넘으면 다음 쪽으로 이어진다. */
.rules-link { font-size: var(--fs-xs); color: var(--print-soft); text-decoration: underline; text-underline-offset: 3px; }
.rules-link:hover { color: var(--ink); }
.leave-new > summary.leave-new-go { list-style: none; cursor: pointer; padding: .2em .9em; border: var(--hair) solid var(--rule-strong); border-radius: 999px; font-size: var(--fs-xs); color: var(--print); }
.leave-new > summary.leave-new-go::-webkit-details-marker { display: none; }
.leave-new > summary.leave-new-go:hover { background: var(--ink-wash); }
.leave-head-tools { display: flex; align-items: center; gap: calc(var(--u) * 1.2); }
.leave-head-tools .leave-filter-more > summary { font-size: var(--fs-xs); padding: .2em .9em; border: var(--hair) solid var(--rule-strong); border-radius: 999px; color: var(--print); cursor: pointer; list-style: none; }
.ledger-pager { display: inline-flex; gap: calc(var(--u) * 1.2); align-items: baseline; }
.ledger-pager a { color: var(--print-soft); }
.cut-kind small { color: var(--print-soft); font-size: var(--fs-xs); }
#leave-rules .cuts-form { margin-top: calc(var(--u) * .6); }
@media (min-width: 700px) {
  details.more.leave-new > .more-body.leave-add, details.more.leave-edit > .more-body.leave-add { width: min(520px, calc(100vw - 32px)) !important; }
  .more-body.leave-add > .field-row.kind-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .more-body.leave-add > .field-row.date-place { grid-template-columns: 44px minmax(0, 1.8fr) 34px minmax(0, 1fr); }
}
.cut-row.is-fixed .cut-fixed { text-align: right; color: var(--print-soft); font-size: var(--fs-s); }
/* "+ 새 근태" 알약: 열기 단추의 아이콘 꼴(`details.more > summary`)을 덮어 글자 알약으로 */
.more.leave-new > summary.leave-new-go {
  display: block; width: auto; min-width: 0; height: auto; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.8);
  font-size: var(--fs-xs); font-weight: 500; line-height: inherit; color: var(--print); opacity: 1; white-space: nowrap; background: none;
}
.more.leave-new > summary.leave-new-go::before, .more.leave-new > summary.leave-new-go::after { content: none; }
.more.leave-new { position: static; margin-left: auto; }

/* 유연근무는 두 갈래다: 시차출퇴근형(시작일~종료일, 날마다 같은 시각)·시간선택형(주 단위 월~금, 요일마다 시각).
 * 구분이 유연근무일 때만 유형 줄이 보이고, 종일/시간 지정은 감춘다. */
.flex-fields, .leave-week-times, .leave-flex-hint { display: none; }
.leave-flex-hint { margin: 0; color: var(--print-soft); font-size: var(--fs-xs); line-height: 1.45; }
.leave-flex-style { justify-self: start; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked) :is(.leave-duration, .leave-duration-hint) { display: none !important; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked) .flex-fields { display: contents; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked) .leave-time-fields { display: block; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked) .for-staggered { display: block; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked):has(input[name="flex_style"][value="selective"]:checked) .for-staggered,
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked):has(input[name="flex_style"][value="selective"]:checked) .leave-time-fields { display: none; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked):has(input[name="flex_style"][value="selective"]:checked) .for-selective { display: block; }
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="flex"]:checked):has(input[name="flex_style"][value="selective"]:checked) .leave-week-times { display: contents; }

/* 근태 내역: 본문 글씨는 0.5pt 줄인다(작은 글씨 — 시각·장소·머리 줄 — 은 그대로). 2026-11-26, 사용자 요청 */
.ledger-row { font-size: calc(var(--fs-m) - 0.5pt); }
.ledger-row > .num { font-size: calc(var(--fs-m) - 0.5pt); }
.ledger-flex { display: block; font-size: var(--fs-xs); color: var(--print-soft); font-weight: 400; }
/* 종류별 누적: 기록이 없는 항목은 옅게, 특별휴가의 세부 구분은 작게 */
.kinds li.is-none { color: var(--print-faint); }
.kinds li.is-none b { font-weight: 400; }
.kinds li.is-sub { font-size: var(--fs-xs); color: var(--print-soft); }
.kinds li.is-sub::before { width: calc(var(--u) * 0.35); height: calc(var(--u) * 0.35); }
.kinds li.is-sub b { font-weight: 600; }
/* 아래로 펼쳐지는 고르기는 뒤를 어둡게 하지 않는다. 바깥 막은 투명하게 두고(누르면 닫힘) 목록은 그 위에 올린다. */
details.more.drop[open] > summary::before { z-index: 30; background: transparent; }
details.more.drop > .more-body { z-index: 40 !important; }
#leave-rules :is(.cuts-head, .cut-row) { grid-template-columns: minmax(0, 1fr) calc(var(--u) * 9); }

/* ───────── 휴가 설정 창(톱니 단추 하나에 모든 휴가 설정) ───────── */
.allowance details.more.leave-settings > .more-body { display: block; width: min(460px, calc(100vw - 32px)) !important; }
.leave-settings > .more-body > * + * { margin-top: 12px; }
.leave-settings .cuts-form { margin: 12px 0; gap: 2px; font-size: 14px; }
.leave-settings .cuts-hours { grid-template-columns: 1.2fr 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.leave-settings .cuts-years { grid-template-columns: 1fr 1fr; }
.leave-settings .cuts-hours label > span { font-size: 12px; font-weight: 600; color: var(--print-soft); }
.leave-settings .cuts-hours input { font-size: 14px; text-align: left; font-weight: 700; }
.leave-settings .cuts-head, .leave-settings .cut-row { grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
.leave-settings .cuts-head { font-size: 12px; }
.leave-settings .cut-row { padding: 3px 0; }
.leave-settings .cut-row input { height: 32px; font-size: 14px; }
@media (min-width: 700px) {
  .leave-settings .cuts-form, .leave-settings .cut-row input { font-size: var(--fs-m); }
  .leave-settings .cut-row input { height: 28px; }
}
.allowance-now + .allowance-now { margin-left: calc(var(--u) * 0.8); }

/* 창 아래의 단추(닫기·확인·기록·지우기)는 모두 알약 모양: 채움은 확정, 테두리는 닫기·지우기 (2026-11-26, 사용자 요청) */
.more-actions button, .more-actions .more-done, .more-actions .danger { border-radius: 999px; padding-left: 16px; padding-right: 16px; }

/* 월간 칸 위쪽 줄(날짜·도장)은 눌림이 칸 전체의 링크(`.cell-open`)로 지나가게 한다. 도장을 눌러도 그 날로 넘어간다(사용자 지적 2026-11-26).
 * 날짜 숫자·단추처럼 자기 일이 있는 것만 눌림을 받는다. */
.cell > .cell-top { pointer-events: none; }
.cell > .cell-top :is(a, button, input, label, summary) { pointer-events: auto; }

/* ───────── 이 자리에 붙이기 메뉴(오른쪽 단추·길게 누르기·펜 몸통 단추) ─────────
 * 오른쪽 단추를 누르거나(펜은 몸통 단추), 패드에서 손가락·펜 끝으로 길게 누르면 누른 자리에 작은 알약이 뜬다:
 * "스티커 추가 | 노트 연결". 스타일이 빠져 있어 책 맨 아래로 밀려 안 보이던 것을 고쳤다(사용자 지적 2026-11-26). */
.aim-menu {
  position: absolute; z-index: 95; display: flex; align-items: stretch;
  padding: 3px; background: var(--paper); border-radius: 10px;
  box-shadow: 0 6px 18px #00000040, 0 0 0 1px var(--paper-edge);
  /* 다른 창의 단추와 같은 글자 크기·높이(창 아래 단추: --fs-xs + 1pt, 28px) */
  font-size: calc(var(--fs-xs) + 1pt);
}
.aim-item {
  min-height: 28px; padding: 0 11px; border: 0; background: transparent; color: var(--print);
  font: inherit; font-weight: 500; white-space: nowrap; cursor: pointer; border-radius: 7px; position: relative;
}
.aim-item + .aim-item::before { content: ""; position: absolute; left: -1px; top: 25%; bottom: 25%; border-left: var(--hair) solid var(--rule-strong); }
.aim-item:hover, .aim-item:focus-visible { background: var(--ink-wash); outline: 0; }
.aim-dot {
  position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); z-index: 5;
  width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--ink); opacity: 0.55; pointer-events: none;
}
/* 길게 눌렀을 때 기기의 글 고르기·확대 돋보기가 끼어들지 않게 한다 */
.page { -webkit-touch-callout: none; }
/* 근태 창의 "달력에 도장 찍기": 이름 칸 없이 상자와 글만 */
.leave-add > label.leave-stamp { display: flex; flex-direction: row; align-items: center; gap: 8px; grid-template-columns: none; font-size: var(--fs-xs); color: var(--print-soft); cursor: pointer; }
.leave-add > label.leave-stamp > input { width: auto; height: auto; accent-color: var(--print); }

/* 필기는 기본으로 켜져 있다: 층은 눌리지 않고(펜은 문서에서 받는다), 지우개를 고른 동안만 선의 굵은 짝이 눌린다. */
.ink-hit { pointer-events: none; }
.inking-erasing .ink-hit { pointer-events: stroke; }
.tab-ink-lock[aria-pressed="true"] { background: var(--paper); border-inline-start-color: var(--cover); font-weight: 700; }
/* 필기(서랍·잠금)는 펜을 쓰는 패드에서만 색인에 보인다: 컴퓨터(마우스뿐)·휴대폰(700px 미만)에서는 감춘다 */
.tab[data-ink-toggle], .tab-ink-lock { display: none; }
@media (any-pointer: coarse) and (min-width: 700px) {
  .tab[data-ink-toggle], .tab-ink-lock { display: grid; }
}
/* 색인의 구분선: 줄 위아래의 여백을 같게(근태 아래 줄과 같은 만큼) */
.tabs-gap { margin: calc(var(--u) * 0.6) 0; }
/* 일간과 노트 사이의 선: 선 위아래 여백을 같게(선 아래 "노트"와 선 위 "일간" 모두 같은 만큼 띄운다) */
@media (min-width: 700px) {
  .tab[href="/notes"] { margin-top: calc(var(--u) * 1.2); position: relative; border-top: 0; }
  .tab[href="/notes"]::before { content: ""; position: absolute; left: 0; right: 0; top: calc(var(--u) * -0.6); border-top: var(--hair) solid var(--rule); }
}

/* 프로젝트 내용의 네 칸(프로덕트·상태·시작일·종료일)은 높이·글자·두께·안쪽 여백을 모두 같게 한다(사용자 지적: 드롭다운마다 크기가 다르다) */
.project-form .fields :is(.more.pick > summary.product-pick, .more.drop > summary.drop-trigger, input[type="date"], input[type="text"], select) {
  box-sizing: border-box !important; height: calc(var(--u) * 1.9) !important; min-height: 0 !important;
  padding: 0 .9em !important; line-height: 1 !important; display: flex !important; align-items: center;
  font-size: calc(var(--fs-m) - 0.5pt) !important; font-weight: 600 !important;
}
.project-form .fields input[type="date"] { display: block !important; line-height: calc(var(--u) * 1.9 - 2px) !important; }
.project-form .fields :is(summary.product-pick, summary.drop-trigger) { justify-content: space-between; }

/* "+ 새 프로젝트": 제목 줄 오른쪽 끝의 알약(새 근태·새 노트와 같은 모양), 이름·프로덕트를 적는 종이 창 */
.more.project-new { position: static; margin-left: auto; align-self: center; }
.more.project-new > summary.leave-new-go {
  display: block; width: auto; min-width: 0; height: auto; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.8);
  border: var(--hair) solid var(--rule-strong); border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 500; line-height: inherit; color: var(--print); opacity: 1; white-space: nowrap; background: none; list-style: none; cursor: pointer;
}
.more.project-new > summary.leave-new-go::before, .more.project-new > summary.leave-new-go::after { content: none; }
.more.project-new > summary.leave-new-go:hover { background: var(--ink-wash); }

/* 프로젝트 상태 요약: 근태 "종류별 누적"과 같은 모양. 네모는 먹색 한 가지의 짙고 옅음으로만 가른다 */
.project-index-head .project-status-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: .2em calc(var(--u) * 1.4); font-size: var(--fs-s); color: var(--print); }
.project-total b { font-weight: 800; }
.project-kinds { margin: 0; }
.project-kinds li::before { background: var(--ink); }
.project-kinds li.tone-done::before { opacity: .3; }
.project-kinds li.tone-active::before { opacity: 1; }
.project-kinds li.tone-planned::before { opacity: .6; }
.project-kinds li.tone-off::before { opacity: .15; }
.project-kinds li.is-none { color: var(--print-faint); }
.project-kinds li.is-none b { font-weight: 400; }
/* 프로젝트 머리: 첫 줄에 제목과 "+ 새 프로젝트", 둘째 줄에 상태별 건수(제목이 줄바꿈되지 않게) */
.head.project-index-head { flex-wrap: wrap; align-items: center; row-gap: calc(var(--u) * 0.5); }
.project-index-head .title { white-space: nowrap; flex: none; }
.project-index-head .project-status-summary { order: 3; flex: 1 0 100%; }
/* 저축연차는 일 단위로만 쓴다: 종일/시간 지정과 시각 칸을 감춘다 */
:is(.leave-add, .ledger-row):has(select[name="kind"] option[value="saved_annual"]:checked) :is(.leave-duration, .leave-duration-hint, .leave-time-fields) { display: none !important; }
/* 장소는 출장·교육만 적는다(2026-11-26, 사용자가 정함): 나머지 구분(휴가·재택·유연근무 …)에서는 장소 칸을 감추고 날짜 칸이 그 자리를 쓴다 */
:is(.leave-add, .ledger-row):not(:has(select[name="kind"] :is(option[value="trip"], option[value="training"]):checked)) :is(.place-label, .place-input) { display: none; }
@media (min-width: 700px) {
  .more-body.leave-add:not(:has(select[name="kind"] :is(option[value="trip"], option[value="training"]):checked)) > .field-row.date-place { grid-template-columns: 44px minmax(0, 1fr); }
}
/* 왼쪽 "근태 기록" 줄 오른쪽: [근태 내역 필터] [+ 새 근태] */
.leave-row-tools { display: flex; align-items: center; gap: calc(var(--u) * 0.6); margin-left: auto; }
.leave-row-tools > .more { margin-left: 0 !important; }

/* 서식 있는 줄 칸(프로젝트 메모·일간 메모): 줄 쳐진 종이 위에 쓰고, 노트와 같은 서식 도구를 쓴다 */
.note-paper.rich-lines {
  flex: none; min-height: calc(var(--row) * 3); max-height: calc(var(--row) * 8);
  padding: 0 calc(var(--u) * 0.4 + 10px) 0 calc(var(--u) * 0.4); color: var(--ink); font-weight: 500;
  word-break: keep-all; cursor: text;
}
.note-paper.rich-lines:empty::before, .note-paper.rich-lines:has(> div:only-child > br:only-child)::before { content: attr(data-placeholder); color: var(--print-faint); pointer-events: none; }
.block.grow > form[data-autosave] { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.block.grow > form[data-autosave] > .note-paper.rich-lines { flex: 1 1 auto; max-height: none; }

/* 오늘 날짜 뒤의 동그라미: 숫자(두 자리)를 다 품는 온전한 원으로 키운다(사용자 지적: 동그라미가 숫자보다 작아 이상하다).
 * 전에는 "가장 가까운 변" 기준의 그라데이션이라 가로로 긴 두 자리 숫자보다 원이 작았다. */
html body[data-tab] :is(.cell.is-today .cell-num, .phone-cell.is-today .phone-num, .daycol.is-today .daycol-num) {
  display: inline-grid; place-items: center; box-sizing: border-box;
  min-inline-size: 1.6em; min-block-size: 1.6em; aspect-ratio: 1; padding-inline: 0.15em;
  border-radius: 50%; background: var(--today-fill);
}

/* 근태 도장은 눌러서 뗀다(그 근태의 도장 표시만 끈다). 단추 모양은 지운다. */
.leave-stamp-form { display: contents; }
.leave-stamp-btn { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; display: inline-flex; }
.leave-stamp-btn:hover .stamp { opacity: .55; }

/* 색인 상자: 위아래 안쪽 여백을 없애 고른 쪽의 바탕이 맨 위(연간)와 맨 아래(설정)까지 다 덮게 한다(사용자 지적). 모서리는 첫·끝 항목이 둥글게 맡는다. */
@media (min-width: 700px) {
  .tabs { padding: 0; }
  .tabs .index-primary > .tab:first-child { border-start-start-radius: 6px; border-start-end-radius: 6px; }
  .tabs .index-secondary > .tab:last-child { border-end-start-radius: 6px; border-end-end-radius: 6px; }
}

/* 설정의 "+ 새 기념일": 제목 줄 오른쪽의 알약(새 근태·새 프로젝트와 같은 모양) */
.set-title .more.anniv-new { position: static; margin-left: auto; font-weight: 400; }
.more.anniv-new > summary.leave-new-go {
  display: block; width: auto; min-width: 0; height: auto; padding: calc(var(--u) * 0.3) calc(var(--u) * 0.8);
  border: var(--hair) solid var(--rule-strong); border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 500; line-height: inherit; color: var(--print); opacity: 1; white-space: nowrap; background: none; list-style: none; cursor: pointer;
}
.more.anniv-new > summary.leave-new-go::before, .more.anniv-new > summary.leave-new-go::after { content: none; }
.more.anniv-new > summary.leave-new-go:hover { background: var(--ink-wash); }
/* "+ 새 프로젝트"는 둘째 줄의 상태별 건수(취소 및 보류 …)와 같은 높이, 오른쪽 끝에 둔다(사용자 요청). 제목은 첫 줄을 다 쓴다. */
.head.project-index-head .title { flex: 1 0 100%; }
.project-index-head .project-status-summary { order: 2; flex: 1 1 0; min-width: 0; }
.head.project-index-head > .more.project-new { order: 3; margin-left: auto; align-self: center; }
/* 공휴일로 적은 기념일: 목록의 "공휴일" 글자는 달력의 빨간 날과 같은 빨강(색의 약속: 빨간 날) */
.anniv-holiday { color: var(--stamp); font-weight: 600; }

/* 확인 창(되묻기)을 다른 창과 같은 크기로(2026-11-26, 사용자 지적: 확인 창만 글씨·단추가 컸다).
 * 책(.book) 안에 놓이므로 `--fs-*`가 풀린다. 책이 고정 위치의 기준이라, 화면 전체를 덮도록 크게 편다. */
.book > .ask { inset: -100vmax; padding: 100vmax; box-sizing: border-box; }
.ask-sheet { width: min(300px, 100%); padding: 14px 16px 12px; border-radius: 7px; }
.ask-text { font-size: var(--fs-m); line-height: 1.5; }
.ask-actions { margin-top: 10px; padding-top: 10px; gap: 6px; }
.ask-actions button, .ask-yes, .ask-no { min-height: 28px; height: 28px; padding: 0 16px; border-radius: 999px; font-size: calc(var(--fs-xs) + 1pt); font-weight: 600; }

/* 시각 바퀴·달력 아래 글자도 다른 창과 같은 크기로(사용자 지적: 모달 안의 모달이 그대로 크다).
 * 바퀴 한 줄의 높이는 일꾼(`dates.rs`의 WHEEL_ROW = 28)과 같아야 한다. 시(00~23)·분 두 칸이라 폭도 줄인다. */
.datepop.timepop { width: calc(var(--u) * 11); padding: 8px 10px; border-radius: 10px; }
.wheel { grid-template-columns: 1fr 1fr; height: 140px; }
.wheel::before { top: 56px; height: 28px; border-radius: 7px; }
.wheel-item { height: 28px; font-size: var(--fs-m); }
.wheel-item.is-on { font-size: calc(var(--fs-m) + 1pt); }
.timepop-foot { margin-top: 6px; }
.timepop-done { height: 28px; padding: 0 16px; font-size: calc(var(--fs-xs) + 1pt); }
.datepop-foot button, .datepop-foot .text-button { font-size: calc(var(--fs-xs) + 1pt); }
@media (max-width: 699px) { .datepop.timepop { width: 200px; } }
/* 프로젝트 고르기: 프로덕트 이름은 창의 오른쪽 끝에 붙여 작게(✓ 바로 앞) 적는다(사용자 요청) */
.pick-item .pick-name { flex: 1 1 auto; min-width: 0; }
.pick-item .pick-area { margin-left: auto; padding-left: .8em; }
/* 시각 바퀴 칸: 줄 높이 28px에 맞춰 높이 140px, 가운데 띠(56px)에 오도록 위아래를 비운다 */
.wheel-col { height: 140px; padding: 56px 0; }
/* 프로젝트 고르기: ✓ 칸은 늘 같은 자리(오른쪽 끝)를 차지해 프로덕트 이름이 줄마다 같은 곳에 끝난다 */
.pick-item .pick-check { display: inline-block; width: 1em; margin-left: .5em; text-align: center; }
.pick-item .pick-name + .pick-check { margin-left: auto; }

/* 글칸 아래의 추천 목록(새 프로젝트의 프로덕트): 칸이 포커스를 가진 동안 뜨고, 항목마다 호버가 따로 칠해진다 */
.suggest-wrap { position: relative; min-width: 0; }
.suggest { display: none; position: absolute; z-index: 6; left: 0; right: 0; top: calc(100% + 4px); padding: 3px; background: var(--paper); border-radius: 8px; box-shadow: 0 6px 18px #00000040, 0 0 0 1px var(--paper-edge); }
.suggest-wrap:focus-within .suggest { display: block; }
.suggest-item { display: block; width: 100%; min-height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none; text-align: left; font: inherit; font-size: var(--fs-m); color: var(--print); cursor: pointer; }
.suggest-item:hover, .suggest-item:focus-visible { background: var(--ink-wash); outline: 0; }

/* 프로덕트 고르기: 새 프로덕트의 이름 칸은 "+ 새 프로덕트" 바로 아래, 줄과 적용 단추는 "프로덕트 미지정" 아래 창의 맨 아래 */
.pick-foot { display: none; margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--rule); }
details.more.pick > .more-body:has(.pick-radio[value="new"]:checked) .pick-foot { display: block; }
.pick-foot .more-actions { margin: 0; padding: 0; border-top: 0; }

/* 달력 창 아래의 "오늘 · 지우기"는 밑줄 없이(사용자 요청) */
.datepop-foot .text-button, .datepop-foot button { text-decoration: none; border-bottom: 0; box-shadow: none; }

/* 상태 고르기 항목·이름표 앞의 아이콘(할 일의 상태 아이콘과 같다) */
.pick-icon { display: inline-grid; place-items: center; flex: none; width: calc(var(--fs-m) * 1.3); color: var(--ink); }
.pick-icon .st { width: calc(var(--fs-m) * 1.3); height: calc(var(--fs-m) * 1.3); }
.pick-trigger > .pick-icon { margin-right: .45em; }
.drop-trigger { justify-content: flex-start; }
.drop-trigger > .pick-caret { margin-left: auto; }

/* 근태 내역: ⋯는 줄에 올렸을 때만 보이고(손가락 기기는 늘 보임), 작고 옅게. 줄 끝은 위 "근태 기록" 줄(새 근태 아래 선)과 같은 길이로 맞춘다. */
.ledger { padding-right: 0; }
.ledger-row .more > summary { opacity: 0; }
.ledger-row:hover .more > summary, .ledger-row:focus-within .more > summary, .ledger-row .more[open] > summary { opacity: 1; }
@media (hover: none) { .ledger-row .more > summary { opacity: 1; } }
.ledger-row .more-icon { width: 13px; height: 13px; }
.ledger-row .more > summary { color: var(--print-soft); }

/* 일정 창: "종일"은 시각 줄 오른쪽, "회의"는 장소 줄 오른쪽에 둔다 */
.field-row.with-tail { grid-template-columns: 44px minmax(0, 1fr) auto; }
.field-pair-none { color: var(--print-faint); font-size: var(--fs-s); }
.tick-tail { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: var(--fs-xs); font-weight: 500; color: var(--print); cursor: pointer; }
.tick-tail input[type="checkbox"] { width: auto; height: auto; margin: 0; accent-color: var(--print); }

/* 일정 창의 맨 위 줄: [색 고르기] [일정 이름]. 색연필 펼침은 창에 가리지 않게 위로 올린다 */
.event-title-row { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.event-title-row .event-ink { flex: none; }
.event-title-row .event-ink summary { width: 26px; height: 30px; }
.event-title-row .event-ink summary span { width: 16px; height: 16px; }
.event-title-row .event-title-input { flex: 1 1 auto; min-width: 0; font-weight: 700; }
.event-title-row .project-pencils { z-index: 30; }
details.more > .more-body:has(.event-ink[open]) { overflow: visible; }

/* 시간표의 빈 시각 칸을 누르면 그 시각에서 시작하는 새 일정 창이 뜬다. 칸 전체가 누르는 자리이고, 올리면 옅게 칠해진다.
 * 일정 조각 묶음(.blocks)은 눌림을 지나가게 하고 조각과 지금 줄만 받는다. */
.hour-add { position: static; }
.hour-add > summary {
  position: absolute; inset: 0 0 0 calc(var(--u) * 2.6); width: auto; height: auto; padding: 0;
  opacity: 0; cursor: pointer; border-radius: 4px; background: none;
}
.hour-add > summary:hover { opacity: 1; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.hour-add > summary::before { content: none; }
.hour-add[open] > summary::before { content: ""; }
.blocks { pointer-events: none; }
.blocks > * { pointer-events: auto; }

/* 시각 칸을 두 번 누르면 새 일정 창: 칸 위를 덮는 눈에 안 보이는 누르는 자리 */
/* 마우스 모양은 얇고 단순한 "+" 하나(사용자 요청: 이상한 모양으로 바꾸지 말 것) */
.hour-hit { position: absolute; inset: 0 0 0 calc(var(--u) * 2.6); z-index: 1; border-radius: 4px;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Cpath d='M10 3v14M3 10h14' stroke='%23fff' stroke-width='3.4' stroke-linecap='round'/%3E%3Cpath d='M10 3v14M3 10h14' stroke='%23292826' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") 10 10, crosshair; }
.hour-hit:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.week-time-band { position: relative; }
.week-time-band > .hour-hit { inset: 0; }
.event-new-window { position: static; }

/* 오늘 날짜의 동그라미는 숫자보다 크게 그리되 칸의 높이는 늘리지 않는다: 위아래로 넘치는 만큼 바깥 여백을 음수로 줘서,
 * 오늘 칸만 머리가 높아져 시간표가 아래로 밀리던 것(사용자 지적: 오늘만 높이가 다르다)을 없앤다. */
html body[data-tab] :is(.cell.is-today .cell-num, .phone-cell.is-today .phone-num, .daycol.is-today .daycol-num) {
  margin-block: -0.3em;
}

/* 오늘 날짜 표시: 회색 원(위아래로 넘쳐 잘려 보이고 칸의 높이를 흔들었다) 대신, 숫자 밑에 짧은 먹색 막대를 깐다(사용자 제안 2026-11-26).
 * 막대는 숫자 너비만큼, 칸의 높이는 그대로다. 월간 칸·주간 요일 칸·휴대폰 주간 칸이 같다. */
html body[data-tab] :is(.cell.is-today .cell-num, .phone-cell.is-today .phone-num, .daycol.is-today .daycol-num) {
  display: inline-block; position: relative; min-inline-size: 0; min-block-size: 0; aspect-ratio: auto; margin-block: 0; padding-inline: 0;
  border-radius: 0; background: none; box-shadow: none;
}
html body[data-tab] :is(.cell.is-today .cell-num, .phone-cell.is-today .phone-num, .daycol.is-today .daycol-num)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -0.14em; height: max(2px, 0.14em); border-radius: 2px; background: var(--ink);
}

/* 새 일정 창의 열기 단추(summary hidden)는 속성만으로는 숨겨지지 않는다(열기 단추 스타일이 display를 정해 놓았다): 겹쳐 보이던 "일정 추가" 글자를 없앤다 */
.event-new-window > summary { display: none !important; }

/* 일정 창: 가로로 길게(440px), "종일"·"회의" 체크는 네모 옆에 글자를 붙여 한 줄로 */
@media (min-width: 700px) {
  details.more.event-edit > .more-body, details.more.event-new-window > .more-body.event-new { width: min(440px, calc(100vw - 32px)) !important; }
}
.tick-tail { flex-direction: row !important; align-items: center; gap: 6px; white-space: nowrap; }
.tick-tail > span { display: inline; }

/* 새 일정 창: "종일"을 체크하면 시각 칸은 숨고 "종일"이라는 글자만 남는다 */
.times-none { display: none; }
.event-new:has(input[name="all_day"][type="checkbox"]:checked) .field-pair.times { display: none; }
.event-new:has(input[name="all_day"][type="checkbox"]:checked) .times-none { display: block; }

/* 서랍의 색연필(라디오): 노트·프로젝트의 색연필과 같은 모양. 고른 것은 위로 올라오고 ✓가 붙는다 */
.tray-pencils { width: 100%; padding-top: 16px; }
label.note-pencil { cursor: pointer; }
label.note-pencil > input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
label.note-pencil:hover .note-pencil-shape { filter: brightness(1.08); }
label.note-pencil:has(input:checked) .note-pencil-shape { height: 82px; transform: translateY(-12px); filter: drop-shadow(0 -2px 2px #33251838); }
label.note-pencil:has(input:checked)::after {
  content: "✓"; position: absolute; z-index: 1; top: 26px; left: 50%; display: grid; place-items: center; width: 17px; height: 17px;
  transform: translateX(-50%); border: 1px solid var(--paper); border-radius: 50%; background: var(--print); color: var(--paper);
  box-shadow: 0 1px 2px #1a171548; font: 600 11px/1 system-ui; pointer-events: none;
}
label.note-pencil:has(input:focus-visible) { z-index: 2; outline: 2px solid var(--ink); outline-offset: 1px; }
.tray-note { margin: calc(var(--u) * 0.3) 0 0; font-size: var(--fs-xs); color: var(--print-soft); }

/* 새 할 일·목표 줄의 동그라미는 누르면 추가하는 단추다: 옅게 보이지만 눌린다 */
.task-add > .mark.ghost, .goal-add > .check.ghost { cursor: pointer; }
.task-add > .mark.ghost:hover, .goal-add > .check.ghost:hover { opacity: 1; }
/* 속성 hidden이 열기 단추 스타일(display)에 져서 "노트 연결" 글자가 책 밖에 보이던 것을 막는다 */
summary[hidden] { display: none !important; }

/* 프로젝트 쪽 머리: 제목과 "+ 새 프로젝트"는 굵은 줄 위(제목이 줄 바로 위에 앉는다), 상태별 건수는 줄 아래 */
.head.project-index-head { flex-wrap: nowrap; align-items: flex-end; row-gap: 0; }
.head.project-index-head .title { flex: 1 1 auto; }
.head.project-index-head > .more.project-new { order: 0; margin-left: auto; align-self: center; }
.project-status-summary.below-rule { order: 0; flex: none; margin: calc(var(--u) * -0.1) 0 calc(var(--u) * 0.9); padding: 0; }
/* "+ 새 프로젝트"는 제목과 같은 줄(글자 가운데 높이)에 맞춘다 */
.head.project-index-head > .more.project-new { align-self: flex-end; margin-bottom: calc(var(--u) * 0.75); }

/* 프로젝트 삭제 단추: 제목 줄 오른쪽 끝 */
.project-title-row .project-delete-btn { margin-left: auto; flex: none; align-self: center; }

/* 글 서식 줄(A·B·I·U·S)도 "스티커 추가" 팝업과 같은 크기·모양으로(사용자 요청 2026-11-26): 둥근 작은 알약, 28px 칸, 칸 사이 가는 줄 */
.note-tools { border: 0; border-radius: 10px; box-shadow: 0 6px 18px #00000040, 0 0 0 1px var(--paper-edge); overflow: visible; font-size: calc(var(--fs-xs) + 1pt); }
.note-tool-row { padding: 3px; gap: 0; }
.note-tool-row button { position: relative; min-width: 34px; min-height: 28px; padding: 0 8px; border-radius: 7px; font-size: calc(var(--fs-xs) + 1pt); font-weight: 500; }
.note-tool-row button + button::before { content: ""; position: absolute; left: -1px; top: 25%; bottom: 25%; border-left: var(--hair) solid var(--rule-strong); }
.note-tool-row button[data-note-command="bold"] { font-weight: 800; }
.note-tool-row button:is(:hover, [aria-pressed="true"], [aria-expanded="true"]) { background: var(--ink-wash); }
@media (pointer: coarse) { .note-tool-row button { min-width: 42px; min-height: 38px; } }

/* 로그인·가입 화면의 로고: 흰 바탕의 그림을 종이 위에 곱쳐 그려 바탕이 사라지게 한다(그림 파일은 손대지 않는다) */
.brand-wordmark { display: block; width: min(15rem, 70%); height: auto; margin: 0 auto 1.1rem; mix-blend-mode: multiply; }
.brand-top { display: flex; justify-content: center; padding-top: 1.4rem; }
.login .brand-wordmark { margin-bottom: .4rem; }
.login h1 { text-align: center; font-size: 1.1rem; }

/* 회원 로그인·가입·운영자 로그인: 화면 가운데 놓인 작은 종이 한 장 */
/* 네이버처럼 가운데에 필요한 만큼만: 로고, 둥근 카드 한 장(밑줄 입력칸 + 큰 단추), 카드 밖 아래의 링크 줄 */
body.admin-page:has(.auth-wrap, .admin-sheet > .admin-login) { display: grid; justify-items: center; align-content: start; padding: clamp(1.5rem, 12vh, 7rem) 1rem 2rem; box-sizing: border-box; background: #f4f2eb; }
.auth-wrap { width: min(25rem, 100%); display: flex; flex-direction: column; align-items: stretch; }
.auth-wrap > .brand-top { padding: 0; }
.auth-wrap .brand-wordmark { width: 12rem; margin: 0 auto 2rem; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) {
  width: auto; margin: 0; padding: 1.9rem 2rem 2rem; border: 1px solid var(--rule); border-radius: 18px; background: #fffefb; box-shadow: none;
}
.admin-page .admin-sheet:has(> .admin-login) { width: min(25rem, 100%); box-sizing: border-box; }
.admin-page .admin-sheet:has(> .admin-login) .brand-top { padding: 0; }
.admin-page .admin-sheet:has(> .admin-login) .brand-wordmark { width: 12rem; margin: 0 auto 1.6rem; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-head { display: block; margin: 0 0 1rem; padding: 0; border: 0; text-align: center; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) h1 { margin: 0 0 1.1rem; font-size: 1.1rem; font-weight: 700; text-align: center; color: var(--print); }
.admin-page .admin-sheet:has(> .admin-login) h1 { margin: 0; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-context { margin: 0 0 .25rem; }
.auth-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login { max-width: none; gap: .4rem; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login label { gap: 0; font-size: 0; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login input {
  height: 3.2rem; padding: 0 .1rem; border: 0; border-bottom: 1px solid var(--rule-strong); border-radius: 0; background: transparent;
  font-size: 1.05rem; font-weight: 400; color: var(--ink);
}
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login input::placeholder { color: var(--print-soft); opacity: 1; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login input:focus { outline: 0; border-bottom: 2px solid var(--print); margin-bottom: -1px; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login button {
  justify-self: stretch; height: 3.1rem; margin-top: 1.4rem; border: 0; border-radius: 10px; background: var(--print); color: var(--paper);
  font-size: 1.02rem; font-weight: 700;
}
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-login button:hover { background: #000; }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .admin-muted { margin: 0; text-align: center; font-size: .82rem; color: var(--print-soft); }
.admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) .oops { margin: .4rem 0 0; padding: .6rem .8rem; border-left: 3px solid var(--stamp); border-radius: 0 8px 8px 0; background: #fff6f3; font-size: .9rem; }
.admin-page .auth-card > p { margin: 0 0 1rem; text-align: center; color: var(--print-soft); line-height: 1.55; font-size: .92rem; }
.admin-page .auth-card > a { display: block; margin-top: 1rem; text-align: center; font-size: .9rem; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: center; margin: 1.3rem 0 0; font-size: .88rem; }
.admin-page .auth-links a { padding: 0 .85rem; color: var(--print-soft); text-decoration: none; line-height: 1.1; }
.admin-page .auth-links a + a { border-left: 1px solid var(--rule); }
.admin-page .auth-links a:hover { color: var(--print); text-decoration: underline; }
.auth-card form + form { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--rule); }
.copyright { margin: 2.2rem 0 0; text-align: center; font-size: .78rem; letter-spacing: .02em; color: var(--print-faint); }
.login .copyright { margin-top: .6rem; }
.auth-fine { margin: 1.4rem 0 0; text-align: center; font-size: .78rem; color: var(--print-faint); }
@media (max-width: 480px) {
  .admin-page :is(.auth-card, .admin-sheet:has(> .admin-login)) { padding: 1.5rem 1.25rem 1.6rem; border-radius: 16px; }
}
