/* 레이아웃: 한 화면 앱. 위 = 얇은 머리 + 필터, 가운데 = 주 단위로 높이를 나눈 월간 그리드, 아래 = 시트(모바일) / 오른쪽 패널(PC) */
:root {
  --bg: #ffffff; --surface: #f6f5f4; --sel: #f1f0ee; --sheet: #ffffff;
  --line: #ece9e4; --line-strong: #e0ddd7;
  --fg: #1a1a1a; --fg-2: #5d5b54; --fg-3: #a4a097;
  --accent: #0b74de; --on-accent: #ffffff; --sun: #e03131;
  --chip-on: #37352f; --on-chip-on: #ffffff;
  --shadow: 0 -8px 30px rgba(20, 18, 14, .12);
  --scrim: rgba(20, 18, 14, .28);
  --ev-purple: #a874c6; --ev-red: #ec3b45; --ev-orange: #f2621c; --ev-pink: #f27d94;
  --ev-teal: #3fb3a1; --ev-yellow: #ffd23f; --ev-olive: #cdd157; --ev-green: #5cc84a;
  --ev-ink-light: #ffffff; --ev-ink-dark: #2f2a12;
  --font-title: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --font-body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --title-weight: 800;
  --r-block: 4px; --r-sheet: 18px;
}
:root[data-tone="oura"] {
  --bg: #f7f1e8; --surface: #efe7da; --sel: #efe5d4; --sheet: #fbf7f0;
  --line: #e9e1d4; --line-strong: #ded5c6;
  --fg: #1c1b1a; --fg-2: #4a4741; --fg-3: #a29d95;
  --accent: #2a72de; --sun: #d9381e; --chip-on: #4a4741;
  --scrim: rgba(40, 30, 20, .25);
  --font-title: "Gowun Batang", "Nanum Myeongjo", "AppleMyungjo", serif;
  --title-weight: 700;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191919; --surface: #232323; --sel: #262626; --sheet: #202020;
    --line: #2a2a2a; --line-strong: #353535;
    --fg: #ecebe8; --fg-2: #a9a69f; --fg-3: #6f6c66;
    --accent: #3b96f0; --sun: #ff6b6b; --chip-on: #ecebe8; --on-chip-on: #191919;
    --shadow: 0 -8px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
  :root:not([data-theme="light"])[data-tone="oura"] {
    --bg: #1b1916; --surface: #24211d; --sel: #2a2621; --sheet: #221f1b;
    --line: #2d2924; --line-strong: #39342d;
    --fg: #f1ebe1; --fg-2: #bdb5a8; --fg-3: #7d766c;
    --accent: #5b93ea; --sun: #f0624d; --chip-on: #f1ebe1; --on-chip-on: #1b1916;
  }
}
:root[data-theme="dark"] {
  --bg: #191919; --surface: #232323; --sel: #262626; --sheet: #202020;
  --line: #2a2a2a; --line-strong: #353535;
  --fg: #ecebe8; --fg-2: #a9a69f; --fg-3: #6f6c66;
  --accent: #3b96f0; --sun: #ff6b6b; --chip-on: #ecebe8; --on-chip-on: #191919;
  --shadow: 0 -8px 30px rgba(0, 0, 0, .5); --scrim: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
:root[data-theme="dark"][data-tone="oura"] {
  --bg: #1b1916; --surface: #24211d; --sel: #2a2621; --sheet: #221f1b;
  --line: #2d2924; --line-strong: #39342d;
  --fg: #f1ebe1; --fg-2: #bdb5a8; --fg-3: #7d766c;
  --accent: #5b93ea; --sun: #f0624d; --chip-on: #f1ebe1; --on-chip-on: #1b1916;
}

html, body { height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 14px;
  overflow: hidden; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  height: 100%; display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* 테마 고르기 (메뉴 안) — 새 테마 = CSS 토큰 블록 하나 + THEMES 항목 하나 */
.themes { display: grid; gap: 8px; }
.theme-opt { display: grid; grid-template-columns: 46px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px; border-radius: 12px; border: 1px solid var(--line-strong); text-align: left; }
.theme-opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-opt .pv { height: 38px; border-radius: 8px; border: 1px solid var(--line-strong); display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 5px; align-content: end; }
.theme-opt .pv i { height: 6px; border-radius: 2px; }
.theme-opt b { display: block; font-size: 14px; font-weight: 700; }
.theme-opt small { color: var(--fg-3); font-size: 12px; }
.seg { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: 5px 11px; border-radius: 999px; font-size: 12px; color: var(--fg-2); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--chip-on); color: var(--on-chip-on); font-weight: 700; }
.tag { border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 8px; font-size: 11px; color: var(--fg-2); white-space: nowrap; }

/* 머리 */
.head { display: flex; align-items: center; gap: 6px; padding-block: 8px 6px; position: relative; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; margin-left: -8px; }
.icon-btn svg { width: 22px; height: 22px; stroke: var(--fg); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.title { font-family: var(--font-title); font-weight: var(--title-weight); font-size: 24px; letter-spacing: -.5px; display: flex; align-items: center; gap: 4px; padding: 4px 6px; border-radius: 10px; }
.title .caret { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 6px solid var(--fg); margin-top: 3px; }
.head .spacer { flex: 1; }
.today-btn { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 500; }
.new-btn { display: none; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 7px 16px; font-size: 13px; font-weight: 700; }

.picker { position: absolute; top: 52px; left: 28px; z-index: 30; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; width: 248px; }
.picker-year { display: flex; align-items: center; justify-content: space-between; font-weight: 700; margin-bottom: 8px; }
.picker-year button { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; }
.picker-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.picker-months button { height: 40px; border-radius: 10px; font-size: 13px; }
.picker-months button[aria-current="true"] { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* 필터 */
.filters { display: flex; gap: 6px; padding-block: 2px 8px; align-items: center; }
.chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; color: var(--fg-2); min-height: 32px; }
.chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); color: var(--on-chip-on); font-weight: 700; }
.filters .who-note { margin-left: auto; font-size: 11.5px; color: var(--fg-3); white-space: nowrap; }

/* 요일 */
.dow { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); }
.dow span { text-align: center; font-size: 12px; color: var(--fg-3); padding-block: 4px 6px; }
.dow span:first-child { color: var(--sun); }

/* 그리드 */
.main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.grid-wrap { min-height: 0; overflow: hidden; position: relative; touch-action: pan-y; }
.grid-wrap.scrolly { overflow-y: auto; }
.grid { height: 100%; display: grid; grid-template-rows: repeat(var(--weeks), minmax(0, 1fr)); }
.grid.slide-l { animation: slideL .22s ease-out; }
.grid.slide-r { animation: slideR .22s ease-out; }
@keyframes slideL { from { transform: translateX(24px); opacity: .4; } }
@keyframes slideR { from { transform: translateX(-24px); opacity: .4; } }

.week { position: relative; border-bottom: 1px solid var(--line); min-height: 92px; }
.week-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); }
.cell { border-right: 1px solid var(--line); padding: 0; border-radius: 0; }
.cell:last-child { border-right: 0; }
.cell.sel { background: var(--sel); }
.week-fg {
  position: absolute; inset: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: var(--blk-h); grid-template-rows: var(--date-h);
  row-gap: 2px; padding-inline: 1px; align-content: start;
  --date-h: 26px; --blk-h: 17px;
}
.date { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 500; min-width: 0; overflow: hidden; }
.date .num { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.date.sun, .date.hol { color: var(--sun); }
.date.today .num { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.date .hname { font-size: 9.5px; white-space: nowrap; overflow: hidden; }
.date.out { opacity: .38; }

.blk {
  pointer-events: auto; margin-inline: 1px; border-radius: var(--r-block);
  font-size: 11.5px; line-height: var(--blk-h); padding-inline: 4px;
  white-space: nowrap; overflow: hidden; text-align: left; font-weight: 500;
  background: var(--c); color: var(--ink); min-width: 0;
}
.blk.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.blk.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.blk.priv { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--c); }
.blk.out { opacity: .38; }
.blk .t { opacity: .85; margin-right: 3px; font-variant-numeric: tabular-nums; display: none; }
.blk.flash { animation: flash 1.2s ease-out 2; }
@keyframes flash { 50% { filter: brightness(1.25); transform: scale(1.04); } }
.more { pointer-events: auto; font-size: 11px; color: var(--fg-2); text-align: center; line-height: var(--blk-h); border-radius: var(--r-block); background: var(--surface); margin-inline: 1px; font-weight: 700; }

/* 색 */
[data-c="purple"] { --c: var(--ev-purple); --ink: var(--ev-ink-light); }
[data-c="red"] { --c: var(--ev-red); --ink: var(--ev-ink-light); }
[data-c="orange"] { --c: var(--ev-orange); --ink: var(--ev-ink-light); }
[data-c="pink"] { --c: var(--ev-pink); --ink: var(--ev-ink-light); }
[data-c="teal"] { --c: var(--ev-teal); --ink: var(--ev-ink-light); }
[data-c="yellow"] { --c: var(--ev-yellow); --ink: var(--ev-ink-dark); }
[data-c="olive"] { --c: var(--ev-olive); --ink: var(--ev-ink-dark); }
[data-c="green"] { --c: var(--ev-green); --ink: var(--ev-ink-dark); }

/* 시트 (모바일) */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--sheet); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow);
  height: 54%; transform: translateY(105%); transition: transform .26s cubic-bezier(.2, .8, .2, 1), height .26s;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.open { transform: translateY(0); }
.sheet.full { height: 90%; }
.sheet.dragging { transition: none; }
.grab { display: grid; place-items: center; height: 26px; touch-action: none; cursor: grab; }
.grab::before { content: ""; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); }
.sheet-body { overflow-y: auto; padding-bottom: 20px; min-height: 0; }

.day-head { display: flex; align-items: baseline; gap: 8px; padding-block: 2px 12px; }
.day-head h2 { margin: 0; font-family: var(--font-title); font-weight: var(--title-weight); font-size: 20px; letter-spacing: -.3px; }
.day-head .hol-name { color: var(--sun); font-size: 13px; font-weight: 500; }
.day-head .x { margin-left: auto; width: 36px; height: 36px; border-radius: 10px; font-size: 20px; color: var(--fg-2); display: none; }
.list { display: grid; gap: 2px; }
.item { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 8px; border-radius: 12px; text-align: left; min-height: 48px; }
.item:hover { background: var(--surface); }
.item .sw { width: 12px; height: 12px; border-radius: 3px; background: var(--c); }
.item .sw.priv { background: transparent; box-shadow: inset 0 0 0 2px var(--c); }
.item .tt { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.item .meta { font-size: 12px; color: var(--fg-3); margin-top: 2px; }
.item.hl { background: var(--sel); }
.who { font-size: 11.5px; border-radius: 999px; padding: 3px 9px; background: var(--surface); color: var(--fg-2); white-space: nowrap; }
.empty { color: var(--fg-3); padding: 18px 8px; font-size: 13.5px; }
.add-row { margin-top: 8px; width: 100%; text-align: left; padding: 13px 8px; border-radius: 12px; color: var(--accent); font-weight: 700; font-size: 14.5px; }
.add-row:hover { background: var(--surface); }

/* 입력 폼 */
.form { display: grid; gap: 14px; }
.form-top { display: flex; align-items: center; gap: 8px; }
.form-top h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; }
.save { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 8px 18px; font-weight: 700; }
.ghost { color: var(--fg-2); padding: 8px 10px; border-radius: 10px; }
.title-in { width: 100%; border: 0; border-bottom: 2px solid var(--line-strong); background: transparent; color: var(--fg); font: inherit; font-size: 19px; font-weight: 500; padding: 8px 2px; border-radius: 0; }
.title-in:focus { outline: none; border-bottom-color: var(--accent); }
.err { color: var(--sun); font-size: 12.5px; margin-top: -8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 40px; }
.row label.k { width: 44px; color: var(--fg-3); font-size: 13px; flex: none; }
.row input[type="date"], .row input[type="time"] { font: inherit; color: var(--fg); background: var(--surface); border: 0; border-radius: 10px; padding: 8px 10px; min-height: 40px; }
.toggles { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; background: var(--c); position: relative; }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--fg); }
.danger { color: var(--sun); font-weight: 700; padding: 10px 4px; justify-self: start; }
.confirm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.confirm span { flex: 1; font-size: 13.5px; }
.confirm .yes { background: var(--sun); color: #ffffff; border-radius: 999px; padding: 7px 14px; font-weight: 700; }

/* + 버튼 */
.fab {
  position: fixed; z-index: 35; width: 56px; height: 56px; border-radius: 50%;
  right: calc(max(16px, env(safe-area-inset-right, 0px)) + 4px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(11, 116, 222, .35);
  display: grid; place-items: center;
}
.fab svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); transform: translateX(-50%); background: var(--chip-on); color: var(--on-chip-on); padding: 9px 16px; border-radius: 999px; font-size: 13px; z-index: 70; opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
.toast.on { opacity: 1; }

/* 메뉴 */
.drawer { position: fixed; top: 0; bottom: 0; left: 0; z-index: 60; width: min(320px, 86vw); background: var(--sheet); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .24s; overflow-y: auto; padding: calc(env(safe-area-inset-top, 0px) + 20px) 20px calc(env(safe-area-inset-bottom, 0px) + 20px) max(20px, env(safe-area-inset-left, 0px)); display: grid; gap: 22px; align-content: start; }
.drawer.open { transform: none; }
.drawer h3 { margin: 0 0 8px; font-size: 12px; color: var(--fg-3); font-weight: 700; letter-spacing: .5px; }
.drawer .brand { font-family: var(--font-title); font-weight: var(--title-weight); font-size: 20px; }
.drawer p { margin: 0; color: var(--fg-2); font-size: 13px; line-height: 1.55; }
.lab { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lab b { font-size: 14px; font-weight: 500; }
.lab small { grid-column: 1; color: var(--fg-3); font-size: 12px; line-height: 1.45; }
.lab .st { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 11px; border-radius: 999px; padding: 3px 8px; background: var(--surface); color: var(--fg-2); }

/* PC */
@media (min-width: 768px) {
  .app { grid-template-rows: auto auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) 340px; column-gap: 24px; }
  .head, .filters { grid-column: 1 / -1; }
  .main { grid-row: 3; grid-column: 1; grid-template-rows: auto minmax(0, 1fr); }
  .head .title { font-size: 28px; }
  .new-btn { display: inline-block; }
  .fab, .scrim { display: none; }
  .sheet {
    position: static; transform: none; height: auto; box-shadow: none; border-radius: 16px;
    grid-row: 3; grid-column: 2; background: var(--surface); padding: 18px 18px 8px; margin-bottom: 16px;
    grid-template-rows: minmax(0, 1fr);
  }
  .grab { display: none; }
  .day-head .x { display: none; }
  .item:hover { background: var(--bg); }
  .add-row:hover { background: var(--bg); }
  .row input[type="date"], .row input[type="time"] { background: var(--bg); }
  .confirm { background: var(--bg); }
  .week-fg { --date-h: 30px; --blk-h: 20px; }
  .date { justify-content: flex-start; padding-left: 6px; font-size: 14px; }
  .date .num { width: 26px; height: 26px; }
  .date .hname { font-size: 11px; }
  .blk { font-size: 12.5px; padding-inline: 6px; }
  .blk .t { display: inline; }
  .dow span { text-align: left; padding-left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ===== 앱 추가분 ===== */
/* 공휴일이 아닌 기념일(어버이날 등)은 회색 */
.date .hname.obs { color: var(--fg-3); }
.day-head .hol-name.obs { color: var(--fg-3); }

/* 알림 띠 (구글 미연결 등) */
.banner { grid-column: 1 / -1; background: var(--surface); border-radius: 12px; padding: 10px 14px; font-size: 13px; color: var(--fg-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.banner a { color: var(--accent); font-weight: 700; }
.app.has-banner { grid-template-rows: auto auto auto minmax(0, 1fr); }
@media (min-width: 768px) {
  .app.has-banner { grid-template-rows: auto auto auto minmax(0, 1fr); }
  .app.has-banner .main, .app.has-banner .sheet { grid-row: 4; }
}
.loading { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: 0; transition: opacity .2s; }
.loading.on { opacity: .8; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .2; } }

/* 로그인 화면 */
.login { height: 100%; display: grid; place-items: center; padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }
.login-box { width: min(340px, 100%); display: grid; gap: 18px; text-align: center; }
.login-box h1 { margin: 0; font-family: var(--font-title); font-weight: var(--title-weight); font-size: 28px; letter-spacing: -.5px; }
.login-box p { margin: 0; color: var(--fg-2); line-height: 1.6; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 6px auto 4px; width: 210px; }
.mini-cal i { height: 9px; border-radius: 3px; background: var(--surface); }
.mini-cal i[data-c] { background: var(--c); }
.kakao { display: flex; align-items: center; justify-content: center; gap: 8px; background: #fee500; color: rgba(0, 0, 0, .85); border-radius: 12px; height: 52px; font-weight: 700; font-size: 15.5px; text-decoration: none; }
.kakao svg { width: 20px; height: 20px; }
.login-box small { color: var(--fg-3); font-size: 12px; line-height: 1.5; }

/* 일정 목록 메모·장소 */
.item .memo { font-size: 12.5px; color: var(--fg-2); margin-top: 4px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.item .loc { font-size: 12px; color: var(--fg-3); margin-top: 3px; }
.item .rec { font-size: 11px; color: var(--fg-3); }
.memo a, .memo-view a { color: var(--accent); }

/* 폼 추가분 */
.memo-in, .loc-in { width: 100%; font: inherit; font-size: 14px; color: var(--fg); background: var(--surface); border: 0; border-radius: 10px; padding: 10px 12px; }
.memo-in { min-height: 84px; resize: vertical; line-height: 1.5; }
.memo-view { font-size: 13px; color: var(--fg-2); white-space: pre-line; overflow-wrap: anywhere; background: var(--surface); border-radius: 10px; padding: 10px 12px; max-height: 160px; overflow-y: auto; }
.row .grow { flex: 1; min-width: 0; }
.scope { display: grid; gap: 8px; background: var(--surface); border-radius: 12px; padding: 12px; }
.scope p { margin: 0; font-size: 13.5px; }
.scope .btns { display: flex; gap: 8px; flex-wrap: wrap; }
.scope .btns button { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 14px; font-weight: 500; }
.scope .btns button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.scope .btns button.del { background: var(--sun); border-color: var(--sun); color: #ffffff; font-weight: 700; }
@media (min-width: 768px) {
  .memo-in, .loc-in, .memo-view, .scope { background: var(--bg); }
}
.drawer .acc { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.drawer .acc button, .drawer .link-btn { color: var(--accent); font-weight: 700; padding: 6px 0; }

/* 설정(실험실)은 메뉴 맨 아래 작은 링크로 숨김 */
.settings-link { justify-self: start; color: var(--fg-3); font-size: 13px; padding: 8px 0; margin-top: 8px; }
.back-link { justify-self: start; color: var(--accent); font-weight: 700; padding: 6px 0; }

/* ===== 11-03 실기기 피드백 ===== */
/* 1) 요일 줄이 남는 높이를 나눠 갖지 않게 (모바일에도 행 지정) */
.main { grid-template-rows: auto minmax(0, 1fr); }
/* 2) 나만 보기 일정도 색을 채운다 (테두리만 → 잘 안 보였음) */
.blk.priv { background: var(--c); color: var(--ink); box-shadow: none; }
.item .sw.priv { background: var(--c); box-shadow: none; }
/* 3) 모바일: 달력은 양옆 끝까지, 블록·글자 키우기 */
@media (max-width: 767px) {
  .app { padding-left: max(4px, env(safe-area-inset-left, 0px)); padding-right: max(4px, env(safe-area-inset-right, 0px)); }
  .head, .filters, .banner { margin-inline: 12px; }
  .week-fg { --date-h: 26px; --blk-h: 20px; padding-inline: 0; row-gap: 3px; }
  .blk { font-size: 12.5px; font-weight: 600; padding-inline: 3px; margin-inline: 1.5px; letter-spacing: -.3px; }
  .more { font-size: 12px; }
  .date { font-size: 14px; }
}

/* ===== 11-03 2차: 타임블럭스 수치에 맞춤 (보통 굵기 · 11.5px · 블록 18px) ===== */
@media (max-width: 767px) {
  .week-fg { --blk-h: 18px; row-gap: 3px; }
  .blk { font-size: 11.5px; font-weight: 400; letter-spacing: -.2px; padding-inline: 4px; }
  .date { font-size: 13.5px; font-weight: 400; }
  .date.today .num { font-weight: 700; }
  .more { font-size: 11px; font-weight: 500; }
}
.blk { -webkit-font-smoothing: antialiased; }

/* ===== 11-03 3차: 더 작게 — 폰 기본 글꼴(갤럭시·아이폰)로, 타임블럭스처럼 가늘고 좁게 ===== */
@media (max-width: 767px) {
  .week-fg { --blk-h: 17px; --date-h: 24px; row-gap: 2px; }
  .blk { font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 10.5px; letter-spacing: -.3px; padding-inline: 3px; }
  .date { font-size: 13px; }
  .date .num { width: 21px; height: 21px; }
  .date .hname { font-size: 9px; }
}

/* ===== 하단 탭 (향후 기능의 자리) ===== */
:root { --tabbar-h: 58px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 36;
  display: flex; justify-content: center; gap: 8px;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg); border-top: 1px solid var(--line);
}
.tab { flex: 0 1 120px; display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--fg-3); font-size: 11px; }
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab circle { fill: currentColor; stroke: none; }
.tab[aria-current="true"] { color: var(--accent); font-weight: 700; }
.app { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; }
.fab { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); }
.toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 84px); }
.sheet { z-index: 50; }

/* 목록 화면 */
.agenda { min-height: 0; overflow-y: auto; padding: 4px 12px 90px; }
.ag-day { padding-block: 10px 4px; border-bottom: 1px solid var(--line); }
.ag-head { display: flex; align-items: baseline; gap: 8px; padding: 2px 8px 6px; font-size: 14px; }
.ag-head.sun b { color: var(--sun); }
.ag-head .rel { font-size: 12px; font-weight: 700; color: var(--on-accent); background: var(--accent); border-radius: 999px; padding: 1px 8px; }
.ag-head .hol { font-size: 12px; color: var(--sun); }
@media (min-width: 768px) {
  .agenda { grid-row: 3; grid-column: 1; }
  .app.has-banner .agenda { grid-row: 4; }
}

/* 11-03: 맨 위 "2026년 11월" 줄이기 */
@media (max-width: 767px) {
  .title { font-size: 19px; letter-spacing: -.3px; }
  .head { padding-block: 4px 2px; }
}

/* 11-03: 달력 안 글자 한 단계 더 작게 */
@media (max-width: 767px) {
  .week-fg { --blk-h: 15px; --date-h: 22px; }
  .blk { font-size: 9.5px; letter-spacing: -.2px; padding-inline: 2.5px; border-radius: 3px; }
  .date { font-size: 12px; }
  .date .num { width: 19px; height: 19px; }
  .date .hname { font-size: 8.5px; }
  .more { font-size: 10px; }
  .dow span { font-size: 11px; }
}
.tab.soon { color: var(--fg-3); opacity: .45; }
.tabbar { justify-content: space-around; gap: 0; }
.tab { flex: 1 1 0; max-width: 120px; }

/* ===== 기간 선택 (시작 → 종료) ===== */
.date-btn { background: var(--surface); border-radius: 10px; padding: 8px 12px; min-height: 40px; font-size: 14px; font-weight: 500; text-align: left; }
.rp { display: grid; gap: 10px; }
.rp-top { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rp-box { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 12px; color: var(--fg-3); }
.rp-box small { grid-column: 1 / -1; font-size: 13px; font-weight: 700; }
.rp-box b { font-size: 34px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.rp-box span { white-space: pre-line; font-size: 12.5px; line-height: 1.35; }
.rp-box.on { color: var(--accent); background: var(--sel); }
.rp-nav { display: flex; align-items: center; justify-content: center; gap: 18px; }
.rp-nav b { font-size: 16px; min-width: 110px; text-align: center; }
.rp-nav button { width: 40px; height: 40px; border-radius: 10px; font-size: 22px; color: var(--fg-2); }
.rp-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 4px; touch-action: pan-y; }
.rp-w { text-align: center; font-size: 12px; color: var(--fg-3); padding-bottom: 4px; }
.rp-w.sun, .rp-d.sun { color: var(--sun); }
.rp-d { height: 44px; display: grid; place-items: center; font-size: 15px; position: relative; }
.rp-d span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; position: relative; z-index: 1; }
.rp-d.out { opacity: .35; }
.rp-d.today span { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.rp-d.mid { background: var(--sel); }
.rp-d.st:not(.en)::before, .rp-d.en:not(.st)::before { content: ""; position: absolute; top: 3px; bottom: 3px; background: var(--sel); }
.rp-d.st:not(.en)::before { left: 50%; right: 0; }
.rp-d.en:not(.st)::before { left: 0; right: 50%; }
.rp-d.mid { margin-block: 3px; height: 38px; }
.rp-d.st span, .rp-d.en span { background: var(--accent); color: var(--on-accent); font-weight: 700; }
.rp-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding-top: 6px; }
.rp-btns .ghost { font-size: 15px; padding: 12px; }
.rp-ok { color: var(--accent); font-weight: 700; font-size: 15px; padding: 12px; border-radius: 10px; }

/* ===== 옮기기 · 복사 · 잘라내기 ===== */
.blk { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.item { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.cell.drop { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 15px; padding: 12px 22px; border-radius: 12px; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); white-space: nowrap; }
.ctx { position: fixed; z-index: 80; background: var(--sheet); border-radius: 16px; box-shadow: 0 10px 34px rgba(0, 0, 0, .22); padding: 6px; display: grid; min-width: 210px; }
.ctx button { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-radius: 10px; font-size: 15.5px; text-align: left; }
.ctx button:hover { background: var(--surface); }
.ctx .ci { width: 22px; text-align: center; font-size: 18px; color: var(--fg-2); }
.clipbar { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); display: flex; align-items: center; gap: 10px; background: var(--chip-on); color: var(--on-chip-on); border-radius: 14px; padding: 12px 14px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }
.clipbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clipbar button { color: inherit; font-weight: 700; padding: 4px 6px; opacity: .85; }

/* 기간 끌어 선택 */
.cell.rng { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.grid-wrap:not(.scrolly) .cell { touch-action: none; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* 11-03: 맨 위 연월 확 줄이기 */
@media (max-width: 767px) {
  .title { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
  .title .caret { border-left-width: 4px; border-right-width: 4px; border-top-width: 5px; }
  .today-btn { padding: 4px 11px; font-size: 12px; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn svg { width: 20px; height: 20px; }
}
.tab.soon { opacity: .7; }
.set-list { display: grid; border-top: 1px solid var(--line); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 2px; border-bottom: 1px solid var(--line); text-align: left; }
.set-row span { display: grid; gap: 2px; }
.set-row b { font-size: 15px; font-weight: 500; }
.set-row small { font-size: 12px; color: var(--fg-3); }
.set-row i { font-style: normal; font-size: 20px; color: var(--fg-3); }
