:root {
  --bg: #f3f5f8;
  --paper: #ffffff;
  --ink: #16233b;
  --ink-2: #4d5b73;
  --ink-3: #8b96a8;
  --line: #e1e6ee;
  --line-2: #eef1f5;
  --navy: #16233b;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(22, 35, 59, .05), 0 4px 14px rgba(22, 35, 59, .05);
  /* 일정 종류 색 */
  --pq: #2f6fdf;  --pq-soft: #e6eefc;
  --el: #7c4ddb;  --el-soft: #efe8fb;
  --cs: #d9730d;  --cs-soft: #fdf0e1;
  --bd: #d93a3a;  --bd-soft: #fce8e8;
  --sun: #d93a3a; --sat: #2f6fdf;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: 15px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-inner { height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 10px; font-size: 19px; letter-spacing: -.01em; }
.logo b { font-weight: 800; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.lock { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.lock.on { background: #eaf6ee; border-color: #b7dfc4; color: #23784a; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-weight: 650; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: #22345a; }
.btn-danger { color: var(--bd); border-color: #f1c4c4; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-size: 20px; line-height: 1; cursor: pointer; }
.icon-btn:hover { border-color: var(--ink-3); }

/* summary */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0 16px; }
.sum { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); border-top: 3px solid var(--c); }
.sum .k { font-size: 13px; font-weight: 700; color: var(--c); }
.sum .v { font-size: 13px; color: var(--ink-2); margin-top: 4px; min-height: 40px; }
.sum .v b { display: block; color: var(--ink); font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sum .v b:hover { text-decoration: underline; }
.sum .none { color: var(--ink-3); }

/* toolbar */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: #e6eaf0; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; padding: 6px 16px; border-radius: 8px; font-size: 14px; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; min-width: 128px; text-align: center; font-variant-numeric: tabular-nums; }
.search { margin-left: auto; width: 220px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 14px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 650; cursor: pointer; color: var(--ink-2); }
.fchip::before { content: ""; width: 9px; height: 9px; border-radius: 3px; background: var(--c); }
.fchip.off { opacity: .45; text-decoration: line-through; }

/* calendar */
.cal { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.cal-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-head div { padding: 8px 10px; font-size: 12px; font-weight: 700; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.cal-head div:first-child { color: var(--sun); } .cal-head div:last-child { color: var(--sat); }
.day { min-height: 118px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 6px 6px 8px; cursor: pointer; position: relative; }
.day:nth-child(7n) { border-right: 0; }
.day:hover { background: #fafbfd; }
.day.out { background: #fafbfc; }
.day.out .num { color: #c3cad6; }
.num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 4px; border-radius: 999px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day.sun .num { color: var(--sun); } .day.sat .num { color: var(--sat); }
.day.today .num { background: var(--navy); color: #fff; }
.ev { display: flex; align-items: center; gap: 4px; margin-top: 3px; padding: 2px 6px; border-radius: 6px; background: var(--soft); border-left: 3px solid var(--c); font-size: 12px; line-height: 1.45; cursor: pointer; white-space: nowrap; overflow: hidden; }
.ev:hover { filter: brightness(.96); }
.ev .tag { font-weight: 800; color: var(--c); flex: none; }
.ev .t { overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.ev.past { opacity: .5; }
/* 제출완료 */
.ev.done { background: #eaf6ee; border-left-color: #2f9e5b; }
.ev.done .tag { color: #2f9e5b; }
.ev.done .t { color: var(--ink-3); text-decoration: line-through; }
.dbtn { height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.dbtn:hover { border-color: #2f9e5b; color: #2f9e5b; }
.dbtn.on { background: #2f9e5b; border-color: #2f9e5b; color: #fff; }
.dbtn.on:hover { background: #268a4e; color: #fff; }
.lrow.done .tt { color: var(--ink-3); text-decoration: line-through; }
.lrow.done .tt small { text-decoration: none; }
.lrow.done .stag, .lrow.done .tm { opacity: .5; }
.timeline li.done { background: #f3faf5; }
.timeline li.done .when { color: var(--ink-3); }
.donewhen { display: block; font-size: 12px; font-weight: 600; color: #2f9e5b; }
.fchip.donechip::before { background: #2f9e5b; border-radius: 50%; }
.fchip.donechip.on { background: #eaf6ee; border-color: #b7dfc4; color: #23784a; }
.more { font-size: 12px; color: var(--ink-3); font-weight: 650; margin: 3px 0 0 4px; }

/* list */
.list { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.lgroup { border-top: 1px solid var(--line); }
.lgroup:first-child { border-top: 0; }
.ldate { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #f8f9fb; font-weight: 750; font-size: 14px; position: sticky; top: 60px; z-index: 1; border-bottom: 1px solid var(--line-2); }
.ldate .dd { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: #e6eaf0; color: var(--ink-2); }
.ldate .dd.hot { background: var(--bd); color: #fff; }
.ldate .dd.warm { background: var(--cs-soft); color: var(--cs); }
.lrow { display: grid; grid-template-columns: 58px 112px 1fr auto auto; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid var(--line-2); cursor: pointer; }
.lrow:first-of-type { border-top: 0; }
.lrow:hover { background: #fafbfd; }
.lrow .tm { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stag { display: inline-flex; align-items: center; justify-content: center; height: 24px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 800; color: var(--c); background: var(--soft); white-space: nowrap; }
.lrow .tt { font-weight: 650; min-width: 0; }
.lrow .tt small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-3); }
.lrow .mth { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.list-foot { padding: 12px 16px; text-align: center; border-top: 1px solid var(--line); }
.empty { padding: 48px 16px; text-align: center; color: var(--ink-3); }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-back { position: absolute; inset: 0; background: rgba(15, 23, 40, .45); }
.modal-box { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); padding: 22px; }
.modal-box h2 { margin: 0 0 4px; font-size: 20px; line-height: 1.4; letter-spacing: -.02em; padding-right: 32px; }
.x { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border: 0; background: none; font-size: 22px; color: var(--ink-3); cursor: pointer; border-radius: 8px; }
.x:hover { background: var(--line-2); }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); margin-bottom: 16px; }
.meta b { color: var(--ink-3); font-weight: 600; margin-right: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.timeline li { display: grid; grid-template-columns: 120px 1fr auto auto; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line-2); }
.timeline li:first-child { border-top: 0; }
.timeline .when { font-weight: 650; font-variant-numeric: tabular-nums; }
.timeline .na { color: var(--ink-3); font-weight: 400; }
.timeline .dd { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.timeline .dd.hot { color: var(--bd); }
.timeline li.past .when, .timeline li.past .stag { opacity: .45; }
.memo { white-space: pre-wrap; background: #f8f9fb; border-radius: 10px; padding: 12px 14px; margin-top: 14px; font-size: 14px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.day-list .lrow { grid-template-columns: 52px 104px 1fr auto; padding: 10px 4px; }

/* form */
.field { margin-bottom: 12px; }
.field label, .lbl { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--ink-2); }
.input, .select, .textarea { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; }
.textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--pq); outline-offset: -1px; border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dates { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; margin-bottom: 12px; }
.drow { display: grid; grid-template-columns: 112px 1fr 110px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.drow:first-of-type { border-top: 0; }
.drow .input { height: 38px; font-size: 14px; }
.hint { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }

/* misc */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.loading { padding: 60px; text-align: center; color: var(--ink-3); }
.foot { margin-top: 40px; padding: 20px 0 36px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.foot p { margin: 3px 0; }

@media (max-width: 760px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search { width: 100%; margin-left: 0; order: 3; }
  .month-nav h1 { font-size: 18px; min-width: 112px; }
  .day { min-height: 64px; padding: 4px 3px; }
  .ev { padding: 1px 3px; border-left-width: 0; justify-content: center; }
  .ev .t { display: none; }
  .ev .tag { font-size: 11px; }
  .lrow { grid-template-columns: 46px 1fr; row-gap: 4px; }
  .lrow .stag { grid-column: 2; justify-self: start; }
  .lrow .tm { grid-row: 1 / 3; align-self: start; padding-top: 3px; }
  .lrow .tt { grid-column: 2; }
  .lrow .mth { display: none; }
  .lrow .dbtn { grid-column: 2; justify-self: start; }
  .day-list .lrow { grid-template-columns: 46px 1fr; }
  .timeline li > span:last-child { grid-column: 2; }
  .timeline li { grid-template-columns: 104px 1fr; }
  .timeline .dd { grid-column: 2; }
  .drow { grid-template-columns: 1fr 1fr; }
  .drow .lbl { grid-column: 1 / 3; margin: 0; }
  .top-inner .lock { padding: 0 9px; }
  .logo { font-size: 17px; }
}
@media (max-width: 420px) {
  .btn-primary#addBtn { padding: 0 12px; }
  .row2 { grid-template-columns: 1fr; }
}
