/* ───────── 완보하는 거북 — OXFORD 노트장 + 포스트잇 ───────── */
:root {
  --paper: #fbf5d4;
  --line: #c9d9e2;
  --margin-line: #e2a29a;
  --ink: #3b3832;
  --ink-soft: #6c665b;
  --ink-faint: #9d978a;
  --rule: rgba(59, 56, 50, .16);

  --note-yellow: #fff1a8;
  --note-pink: #ffdce2;
  --note-sky: #d7eaf6;
  --note-green: #dcefd0;
  --note-white: #fffdf5;

  --accent: #5d8768;
  --focus: #6b91c2;
  --highlight: #ffe486;

  --line-gap: 32px;
  --margin-x: 68px;

  --hand: 'Gaegu', 'Nanum Pen Script', cursive;
  --body: 'Gowun Dodum', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg,
      transparent calc(var(--margin-x) - 1px),
      var(--margin-line) calc(var(--margin-x) - 1px),
      var(--margin-line) calc(var(--margin-x) + .5px),
      transparent calc(var(--margin-x) + .5px)),
    repeating-linear-gradient(180deg,
      transparent 0,
      transparent calc(var(--line-gap) - 1px),
      var(--line) calc(var(--line-gap) - 1px),
      var(--line) var(--line-gap));
}

a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px dashed var(--focus); outline-offset: 3px; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 32px 56px calc(var(--margin-x) + 28px);
}

.muted { color: var(--ink-soft); }
.hand { font-family: var(--hand); font-weight: 700; }

/* ───────── 헤더 ───────── */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding: 6px 0 22px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.turtle { width: 62px; height: 42px; flex: none; transform: rotate(-4deg); }
.logo-text { display: grid; line-height: 1.05; }
.logo-title { font-family: var(--hand); font-weight: 700; font-size: 2.15rem; letter-spacing: .5px; }
.logo-sub { font-size: .8rem; color: var(--ink-soft); margin-top: 3px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a {
  font-family: var(--hand);
  font-size: 1.3rem;
  font-weight: 700;
  text-decoration: none;
  padding: 2px 12px;
  border-radius: 4px;
  color: var(--ink-soft);
}
.tabs a:hover { color: var(--ink); }
.tabs a.on {
  color: var(--ink);
  background: linear-gradient(transparent 52%, var(--highlight) 52%, var(--highlight) 90%, transparent 90%);
}

.lock-btn {
  display: block;
  margin: 8px auto 0;
  font: .8rem var(--body);
  color: var(--ink-faint);
  background: none;
  border: 0;
  cursor: pointer;
}
.lock-btn:hover { color: var(--ink); text-decoration: underline; }
.lock-btn[hidden] { display: none; }
.site-footer {
  margin-top: 56px;
  font-family: var(--hand);
  font-size: 1.05rem;
  color: var(--ink-faint);
  text-align: center;
}

/* ───────── 포스트잇 ───────── */
.note {
  --bg: var(--note-yellow);
  position: relative;
  background: var(--bg);
  padding: 28px 22px 20px;
  border-radius: 2px 2px 3px 3px;
  box-shadow:
    0 1px 2px rgba(70, 60, 30, .08),
    0 12px 18px -14px rgba(70, 60, 30, .45);
  transform: rotate(var(--tilt, 0deg));
}
/* 위쪽 마스킹테이프 */
.note::before {
  content: '';
  position: absolute;
  top: -11px;
  left: 50%;
  width: 92px;
  height: 22px;
  transform: translateX(-50%) rotate(-2.5deg);
  background: rgba(255, 255, 255, .55);
  border-left: 1px dashed rgba(0, 0, 0, .05);
  border-right: 1px dashed rgba(0, 0, 0, .05);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
}
.note--yellow { --bg: var(--note-yellow); }
.note--pink { --bg: var(--note-pink); }
.note--sky { --bg: var(--note-sky); }
.note--green { --bg: var(--note-green); }
.note--white { --bg: var(--note-white); }

.note h2 {
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.7rem;
  line-height: 1.1;
  margin: 0 0 12px;
}
.note-foot {
  display: inline-block;
  margin-top: 14px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
}
a.note-foot:hover { color: var(--ink); }
.empty { color: var(--ink-soft); font-size: .95rem; margin: 6px 0; }

/* ───────── 페이지 머리 ───────── */
.page-head { margin: 4px 0 26px; }
.page-head h1 { font-size: 2.3rem; margin: 0; line-height: 1.15; }
.page-head p { margin: 2px 0 0; min-height: 1.5em; font-size: .92rem; }
.today-tag {
  display: inline-block;
  font-family: var(--body);
  font-size: .8rem;
  font-weight: 400;
  vertical-align: middle;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--highlight);
  margin-left: 6px;
}

/* ───────── 홈 보드 ───────── */
.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 34px;
  align-items: start;
}
.board .note { min-height: 280px; }

/* ───────── 목록 / 항목 ───────── */
.items { list-style: none; margin: 0; padding: 0; }
.items--num { counter-reset: n; }
.item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
}
.item--wrap { flex-wrap: wrap; justify-content: flex-end; }
.item--wrap .item-main { flex-basis: 12em; }
.item:last-child { border-bottom: 0; }
.items--num .item:not(.empty-slot)::before,
.items--num .empty-slot::before {
  counter-increment: n;
  content: counter(n);
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.25rem;
  width: 1.1em;
  color: var(--ink-soft);
}
.item-main { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; cursor: default; }
label.item-main { cursor: pointer; }
.item-title { overflow-wrap: anywhere; }
.is-done .item-title,
.is-done .crow-title {
  text-decoration: line-through;
  text-decoration-color: rgba(59, 56, 50, .45);
  color: var(--ink-faint);
}

/* 손으로 그린 듯한 체크박스 */
.check {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 19px;
  height: 19px;
  margin: 0;
  border: 1.6px solid var(--ink-soft);
  border-radius: 4px 3px 5px 3px;
  background: rgba(255, 255, 255, .6);
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}
.check::after {
  content: '';
  width: 10px;
  height: 5px;
  margin-top: -3px;
  border-left: 2.2px solid var(--accent);
  border-bottom: 2.2px solid var(--accent);
  transform: rotate(-45deg) scale(0);
  transition: transform .15s ease-out;
}
.check:checked { border-color: var(--accent); }
.check:checked::after { transform: rotate(-45deg) scale(1); }

.dot {
  flex: none;
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--c, #aaa);
  margin-right: 1px;
}

/* 우선순위 */
.prio {
  flex: none;
  font-size: .72rem;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid currentColor;
  line-height: 1.6;
}
.prio--high { color: #b5574f; background: rgba(200, 110, 103, .1); }
.prio--mid { color: #8a7a3e; }
.prio--low { color: var(--ink-faint); }

/* ───────── 논문 스티커 ───────── */
.sticker {
  flex: none;
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 3px;
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  transform: rotate(-7deg);
}
.sticker:hover { transform: rotate(0deg); }
.sticker--moonlight { border-radius: 50%; background: #e4def5; }
.sticker--moonlight::after {
  content: '☾';
  position: absolute;
  top: -8px;
  right: -5px;
  font-size: 12px;
  color: #6f5ea8;
}
.sticker--zotero { border-radius: 3px; background: #f6d4d0; transform: rotate(6deg); }
.sticker--zotero::after {
  content: 'Z';
  position: absolute;
  right: -6px;
  bottom: -6px;
  font: 700 9px/1 system-ui, sans-serif;
  padding: 2px 3px;
  border-radius: 3px;
  background: #c4524b;
  color: #fff;
}
.sticker--link { border-radius: 3px; background: #fff; }

/* ───────── 버튼 / 입력 ───────── */
.btn {
  border: 1.5px solid var(--ink);
  background: var(--note-white);
  padding: 5px 15px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .92rem;
  white-space: nowrap;
}
.btn:hover { background: #fff; }
.btn-soft {
  border: 1px dashed var(--ink-soft);
  background: rgba(255, 255, 255, .45);
  padding: 2px 11px;
  border-radius: 999px;
  font-size: .82rem;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink-soft);
}
.btn-soft:hover { color: var(--ink); background: rgba(255, 255, 255, .8); }
.btn-soft:disabled { opacity: .5; cursor: default; }
.btn-danger {
  border: 1px solid #c86e67;
  color: #a9514a;
  background: transparent;
  padding: 4px 13px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .88rem;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--ink-soft);
}
.icon-btn:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
.icon-btn--del { font-size: 1.2rem; }
.pill {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .55);
  padding: 2px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: .88rem;
  text-decoration: none;
}
.pill.on { background: var(--highlight); border-color: transparent; }
.linklike {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.linklike:hover { text-decoration: underline; text-decoration-style: dashed; }

.line-input {
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  padding: 4px 2px;
  min-width: 0;
}
.line-input:focus { outline: none; border-bottom-color: var(--focus); }

.cat-select, .plain-select {
  appearance: none;
  -webkit-appearance: none;
  font-size: .82rem;
  padding: 2px 10px 2px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: rgba(255, 255, 255, .6) radial-gradient(circle at 10px 50%, var(--c, #aaa) 0 4px, transparent 4.5px);
  cursor: pointer;
  max-width: 10em;
}
.plain-select { padding-left: 10px; background: rgba(255, 255, 255, .6); }

/* ───────── 보기 전환 / 툴바 ───────── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.seg a {
  text-decoration: none;
  padding: 3px 14px;
  border-radius: 999px;
  font-size: .9rem;
  color: var(--ink-soft);
}
.seg a:hover { color: var(--ink); }
.seg a.on { background: var(--note-yellow); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }

.date-nav { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.date-pick {
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .6);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: .88rem;
}

/* 카테고리 필터 */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: .84rem;
  padding: 2px 11px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .55);
}
.chip.on {
  background: color-mix(in srgb, var(--c, #f0d860) 28%, #fff);
  border-color: color-mix(in srgb, var(--c, #c9b050) 70%, #fff);
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: .86rem;
  color: var(--ink-soft);
}
.switch-knob {
  position: relative;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: rgba(59, 56, 50, .18);
}
.switch-knob::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.switch.on { color: var(--ink); }
.switch.on .switch-knob { background: var(--accent); }
.switch.on .switch-knob::after { left: 16px; }

/* 목록 행 */
.list-note-card { max-width: 860px; }
.list-note { margin: -4px 0 8px; font-size: .88rem; }
.day-group + .day-group { margin-top: 18px; }
.day-group-title {
  font-family: var(--hand);
  font-size: 1.25rem;
  margin: 0 0 2px;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--rule);
}
.day-group-title a { text-decoration: none; }
.day-group-title a:hover { text-decoration: underline; }
.lrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
}
.lrow:last-child { border-bottom: 0; }
.lrow-main { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.lrow-meta { font-size: .84rem; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.lrow-meta a { text-decoration: none; border-bottom: 1px dotted currentColor; }
.lrow-date { font-variant-numeric: tabular-nums; }
.star-mini { color: #c9a227; font-size: .85rem; }
.lrow-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.btn-soft--muted { border-color: var(--ink-faint); color: var(--ink-faint); }
.closed-tag {
  font-size: .72rem;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(59, 56, 50, .08);
  color: var(--ink-soft);
  margin-left: 4px;
}
.is-closed .item-title { color: var(--ink-faint); }

/* ───────── 하루 플래너 ───────── */
.timebox {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}
.tb-col { display: grid; gap: 36px; min-width: 0; }
.reflect {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  margin-top: 36px;
}
.empty-slot { min-height: 38px; }

/* Check List */
.checklist { list-style: none; margin: 0; padding: 0; }
.crow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "chk title tools" ". link link";
  align-items: center;
  gap: 2px 10px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--rule);
}
.crow > .check { grid-area: chk; }
.crow-title-wrap { grid-area: title; display: flex; align-items: center; min-width: 0; }
.crow-title {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  padding: 3px 0;
}
.crow-title:focus { outline: none; border-bottom-color: var(--focus); }
.crow-tools { grid-area: tools; display: flex; align-items: center; gap: 2px; }
.crow-link { grid-area: link; display: flex; gap: 8px; align-items: center; padding: 2px 0 6px; }
.crow-link[hidden] { display: none; }
.crow-link .line-input { flex: 1; }
.star {
  border: 0;
  background: transparent;
  font-size: 1.15rem;
  line-height: 1;
  width: 30px;
  height: 30px;
  cursor: pointer;
  color: var(--ink-faint);
  border-radius: 6px;
}
.star:hover { background: rgba(255, 255, 255, .6); }
.star.on { color: #c9a227; }

/* Check List 포스트잇이 좁으면 도구 줄을 제목 아래로 내린다 */
.note--green { container-type: inline-size; }
@container (max-width: 470px) {
  .crow {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "chk title" ". tools" ". link";
  }
  .crow-tools { margin-top: -4px; }
}

.add-row { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.add-row .line-input { flex: 1 1 12em; }

/* Brain Dump */
.study {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: .9rem;
  color: var(--ink-soft);
}
.study-input {
  font-family: var(--hand);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  width: 9em;
  letter-spacing: .5px;
}

/* 줄 노트 textarea */
textarea.lined {
  display: block;
  width: 100%;
  resize: vertical;
  border: 0;
  padding: 0 2px;
  line-height: 28px;
  min-height: 140px;
  background-color: transparent;
  background-image: repeating-linear-gradient(180deg, transparent 0, transparent 27px, rgba(80, 110, 140, .22) 27px, rgba(80, 110, 140, .22) 28px);
  background-attachment: local;
}
textarea.lined:focus { outline: none; }
textarea.lined::placeholder, .line-input::placeholder, .crow-title::placeholder { color: var(--ink-faint); }

/* Time Table */
.tt-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.tt-palette { display: flex; flex-wrap: wrap; gap: 5px; margin: 2px 0 12px; }
.brush {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  padding: 1px 9px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: rgba(255, 255, 255, .6);
  cursor: pointer;
}
.brush .dot { width: 10px; height: 10px; }
.brush.on {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 22%, #fff);
  box-shadow: 0 0 0 1px var(--c) inset;
}
.tt-grid {
  --tt-line: rgba(107, 145, 194, .28);
  display: grid;
  grid-template-columns: 2.6em repeat(6, minmax(0, 1fr));
  border-top: 1px solid var(--tt-line);
  border-left: 1px solid var(--tt-line);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  background: rgba(255, 255, 255, .55);
}
.tt-corner, .tt-min {
  border-right: 1px solid var(--tt-line);
  border-bottom: 1px solid var(--tt-line);
}
.tt-min { font-size: .66rem; color: var(--ink-faint); text-align: center; line-height: 18px; }
.tt-hour {
  font-family: var(--hand);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--ink-soft);
  border-right: 1.5px solid var(--tt-line);
  border-bottom: 1px solid var(--tt-line);
}
.tt-hour small { font-family: var(--body); font-size: .55rem; font-weight: 400; color: var(--ink-faint); }
.tt-cell {
  appearance: none;
  border: 0;
  border-right: 1px dotted var(--tt-line);
  border-bottom: 1px solid var(--tt-line);
  height: 22px;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 0;
}
.tt-cell.last { border-right: 1px solid var(--tt-line); }
.tt-cell:hover { background: rgba(107, 145, 194, .12); }
.tt-cell.painted, .tt-cell.painted:hover {
  background: color-mix(in srgb, var(--p) 72%, #fff);
  background-clip: padding-box;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--p) 85%, #000 5%);
}
.tt-cell { position: relative; overflow: visible; }
.tt-cell[data-label]::after {
  content: attr(data-label);
  position: absolute;
  left: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--span, 1) * 100% - 10px);
  font-size: .68rem;
  line-height: 1;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  pointer-events: none;
  z-index: 1;
}
/* 이어진 같은 색 칸 → 한 덩어리 */
.tt-cell.painted.join-r { border-right-color: transparent; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tt-cell.painted.join-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tt-cell.painted.join-r { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--p) 85%, #000 5%), inset 0 -1px 0 color-mix(in srgb, var(--p) 85%, #000 5%), inset 1px 0 0 color-mix(in srgb, var(--p) 85%, #000 5%); }
.tt-cell.painted.join-l { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--p) 85%, #000 5%), inset 0 -1px 0 color-mix(in srgb, var(--p) 85%, #000 5%), inset -1px 0 0 color-mix(in srgb, var(--p) 85%, #000 5%); }
.tt-cell.painted.join-l.join-r { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--p) 85%, #000 5%), inset 0 -1px 0 color-mix(in srgb, var(--p) 85%, #000 5%); }
.tt-midnight { border-top: 1.5px dashed rgba(107, 145, 194, .6); }
.tt-sum { margin: 12px 0 0; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.sum-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-soft); }

/* ───────── 월간 캘린더 ───────── */
.cal-note { padding-top: 24px; }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head h2 { margin: 0 4px; min-width: 6.5em; text-align: center; }
.cal-grid {
  --grid: rgba(107, 145, 194, .25);
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid var(--grid);
  border-left: 1px solid var(--grid);
}
.cal-dow {
  text-align: center;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 2px 0;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  color: var(--ink-soft);
}
.is-sun .cal-num, .cal-dow.is-sun { color: #b8605a; }
.is-sat .cal-num, .cal-dow.is-sat { color: #5a7fae; }
.cal-cell {
  min-width: 0;
  min-height: 108px;
  padding: 4px 5px 6px;
  border-right: 1px solid var(--grid);
  border-bottom: 1px solid var(--grid);
  cursor: pointer;
}
.cal-cell:hover { background: rgba(255, 241, 168, .4); }
.cal-cell.is-out { background: rgba(59, 56, 50, .03); }
.cal-cell.is-out .cal-num { opacity: .45; }
.cal-num {
  display: inline-grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 1.1rem;
}
.cal-cell.is-today .cal-num {
  border: 2px solid #d8935e;
  border-radius: 52% 46% 55% 47%;
  transform: rotate(-6deg);
}
.cal-items { list-style: none; margin: 2px 0 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; }
.cal-items li { min-width: 0; }
.cal-chip {
  display: block;
  width: 100%;
  text-align: left;
  font-size: .76rem;
  line-height: 1.4;
  padding: 1px 5px;
  border: 0;
  border-left: 3px solid var(--c);
  border-radius: 2px;
  background: color-mix(in srgb, var(--c) 20%, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.cal-chip b { color: #b5574f; }
.cal-chip.is-done { text-decoration: line-through; opacity: .5; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; font-size: .8rem; color: var(--ink-soft); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.cal-hint { font-size: .82rem; margin: 6px 0 0; }

/* ───────── 다이얼로그 ───────── */
dialog {
  border: 0;
  padding: 18px 0 0;
  background: transparent;
  width: min(500px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  overflow: visible;
}
dialog::backdrop { background: rgba(60, 50, 30, .28); }
.dlg-card { --tilt: -.4deg; max-height: calc(100vh - 80px); overflow: auto; }
.dlg-card .items { margin-bottom: 10px; }
.dlg-form { display: grid; gap: 12px; }
.dlg-form label { display: grid; gap: 4px; font-size: .86rem; color: var(--ink-soft); }
.dlg-form label.inline { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.dlg-form .cat-select { justify-self: start; font-size: .9rem; padding-top: 4px; padding-bottom: 4px; }
.field, .dlg-form .plain-select {
  border: 1px solid rgba(59, 56, 50, .25);
  border-radius: 6px;
  background: rgba(255, 255, 255, .75);
  padding: 6px 9px;
  font-size: .95rem;
  color: var(--ink);
  max-width: none;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-actions { display: flex; align-items: center; gap: 8px; margin-top: 6px; justify-content: flex-end; }
.spacer { flex: 1; }
.sheet-add { display: grid; gap: 10px; margin-top: 8px; padding-top: 10px; border-top: 1.5px dashed var(--rule); }
.sheet-add-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ───────── 토스트 ───────── */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(59, 56, 50, .92);
  color: var(--paper);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
  z-index: 10;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; }

.error-note { max-width: 520px; }
.loading { font-family: var(--hand); font-size: 1.3rem; margin: 40px 0; }

/* ───────── Notion 연동 · 읽기 전용 ───────── */
.source-badge {
  font-size: .78rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px dashed var(--ink-soft);
  color: var(--ink-soft);
  background: rgba(255, 255, 255, .5);
  margin-right: auto;
}
.source-badge[hidden] { display: none; }
.notion-link { margin-top: 4px; }
.plain-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 12px; }
.check:disabled { cursor: default; }
.cat-select:disabled { cursor: default; opacity: 1; }
.is-readonly label.item-main { cursor: default; }
.is-readonly .add-row,
.is-readonly .sheet-add,
.is-readonly [data-act="new"],
.is-readonly [data-act="move"],
.is-readonly [data-act="del"],
.is-readonly [data-act="link"],
.is-readonly .tt-palette,
.is-readonly .tt-clear { display: none; }
.is-locked .add-row,
.is-locked .tt-palette,
.is-locked .tt-clear { display: none; }
.is-locked .tt-grid { pointer-events: none; }
body.is-saving .source-badge::after { content: ' · 저장 중…'; }
.is-readonly .star { pointer-events: none; }
.is-readonly .star:not(.on) { visibility: hidden; }
.is-readonly .tt-grid { pointer-events: none; }
.is-readonly .tt-sum .muted { display: none; }

/* ───────── 반응형 ───────── */
@media (max-width: 980px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .timebox, .reflect { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  :root { --margin-x: 22px; --line-gap: 30px; }
  .wrap { padding: 12px 16px 40px calc(var(--margin-x) + 14px); }
  .site-header { padding-bottom: 16px; }
  .logo-title { font-size: 1.8rem; }
  .turtle { width: 50px; height: 34px; }
  .tabs a { font-size: 1.15rem; padding: 2px 8px; }
  .page-head h1 { font-size: 1.9rem; }
  .board { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .board .note { min-height: 0; }
  .note { padding: 26px 16px 18px; }
  .seg a { padding: 3px 10px; font-size: .85rem; }

  .crow {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "chk title" ". tools" ". link";
  }
  .crow-tools { justify-content: flex-start; }

  .lrow { flex-wrap: wrap; }
  .lrow > .btn-soft, .lrow-actions { margin-left: 29px; justify-content: flex-start; }

  .cal-note { padding-left: 8px; padding-right: 8px; }
  .cal-cell { min-height: 58px; padding: 2px 3px 4px; }
  .cal-num { font-size: .98rem; min-width: 22px; height: 22px; }
  .cal-items { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 1px; }
  .cal-chip {
    width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    border: 0;
    border-radius: 50%;
    background: var(--c);
    pointer-events: none;
  }
  .cal-chip.is-done { opacity: .35; }
  .field-row { grid-template-columns: 1fr; }
}
