/* OS 사이트 디자인 (M4). 색 대비 4.5:1 이상, 누르는 곳 최소 44px. */
:root {
  --bg: #F5F5F2; --fg: #16171A; --sub: #5C6068; --accent: #2747B8; --late: #A33A0B; --late-bg: #FBF1EB;
  --card: #FFFFFF; --shadow: 0 1px 2px rgba(22, 23, 26, 0.06); --r: 14px; --line: #E7E7E3;
  --side: #16171A; --side-fg: #C9CBD0; --side-sub: #9A9DA4;
  --c-과외: #7C4DDB; --c-대성: #0E7490; --c-오에듀: #2747B8; --c-개인: #6B7280; --c-APPENDIX: #A16207;
  --c-PRISM: #C2410C; --c-대부중개: #15803D; --c-문제은행: #BE185D; --c-신규사업: #4338CA; --c-AI부업: #0F766E;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.5 "IBM Plex Sans KR", system-ui, -apple-system, sans-serif; }
.num, .tnum, time { font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
button, input, select, textarea { font: inherit; color: inherit; }
.sub { color: var(--sub); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 레이아웃: 노트북 = 왼쪽 메뉴, 휴대폰 = 하단 탭 */
.side { display: none; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 20px 16px 96px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); box-shadow: 0 -1px 2px rgba(22, 23, 26, 0.06); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--sub); font-size: 12px; position: relative; }
.tabbar a.on { color: var(--accent); font-weight: 600; }
.tabbar .ico { font-size: 18px; line-height: 1; }
.tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); }
@media (min-width: 900px) {
  .side { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 220px; background: var(--side);
    color: var(--side-fg); padding: 20px 12px; gap: 2px; }
  .side .brand { color: #fff; font-weight: 700; font-size: 18px; padding: 4px 12px 18px; }
  .side a, .side button { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px;
    border-radius: 10px; color: var(--side-fg); background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
  .side a:hover, .side button:hover { background: #24262B; }
  .side a.on { background: #24262B; color: #fff; font-weight: 600; }
  .side .gap { flex: 1; }
  .side .group { color: var(--side-sub); font-size: 12px; padding: 14px 12px 4px; }
  .main { margin-left: 220px; }
  .wrap { padding: 32px 32px 48px; }
  .tabbar { display: none; }
}
.badge { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent);
  color: #fff; font-size: 12px; font-weight: 600; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }

/* 카드·공통 */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; }
.stack > * + * { margin-top: 12px; }
.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.sec-h h2 { font-size: 17px; }
.page-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: 10px; border: 0; background: #ECECE8; color: var(--fg); cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn:hover { background: #E2E2DD; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #1F3A99; }
.btn.ghost { background: none; color: var(--sub); }
.btn.late { background: var(--late); color: #fff; }
.btn.sm { min-height: 44px; padding: 0 12px; font-size: 14px; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid #D4D5D8;
  background: #fff; }
textarea.input { min-height: 96px; }
label.field { display: block; font-size: 14px; color: var(--sub); }
label.field > .input { margin-top: 4px; color: var(--fg); }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.empty { color: var(--sub); padding: 8px 0; }
.err { color: var(--late); background: var(--late-bg); padding: 10px 12px; border-radius: 10px; }
.ok-msg { color: #14532D; background: #E9F5EC; padding: 10px 12px; border-radius: 10px; }

/* 분류 칩: 항상 글자와 함께 */
.cat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--cc, var(--sub)); }
.cat::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cc, var(--sub)); flex: none; }
.cat.on-bg { color: var(--fg); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--sub); }
.late-t { color: var(--late); font-weight: 600; }
.chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.chip.late { background: var(--late-bg); color: var(--late); }
.chip.run { background: #EAEEFA; color: var(--accent); }
.chip.wait { background: #EFEFEC; color: var(--sub); }

/* 오늘: 머리 */
.today-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.today-h .date { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.today-h .dow { font-size: 15px; color: var(--sub); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(64px, auto)); gap: 4px 20px; }
.stat { text-align: right; }
.stat b { display: block; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--sub); }
.stat.late b { color: var(--late); }
@media (max-width: 520px) { .stats { width: 100%; grid-template-columns: repeat(4, 1fr); } .stat { text-align: left; } }

/* 이번 주 7일 줄 */
.weekstrip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 18px; }
.weekstrip a { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow); color: var(--fg); font-variant-numeric: tabular-nums; }
.weekstrip a small { font-size: 12px; color: var(--sub); }
.weekstrip a b { font-size: 17px; font-weight: 600; }
.weekstrip a.on { background: var(--fg); color: #fff; }
.weekstrip a.on small { color: #C9CBD0; }
.weekstrip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-top: 2px; }
.weekstrip a.on .dot { background: #fff; }
.weekstrip .dot.none { background: transparent; }

/* 오늘 집중 01·02·03 */
.focus { list-style: none; margin: 0; padding: 0; }
.focus li { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.focus li + li { border-top: 1px solid var(--line); }
.focus .no { font-size: 22px; font-weight: 700; color: var(--sub); font-variant-numeric: tabular-nums; width: 32px; flex: none; }
.focus .body { flex: 1; min-width: 0; }
.focus .title { font-size: 16px; font-weight: 500; word-break: keep-all; overflow-wrap: anywhere; }
.focus li.done .title { text-decoration: line-through; color: var(--sub); }
.circle { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: none; cursor: pointer; display: flex;
  align-items: center; justify-content: center; }
.circle::before { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #7D8087; box-sizing: border-box; }
.circle:hover::before { border-color: var(--accent); }
.circle.done::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") center/16px no-repeat; border-color: var(--accent); }

/* 2열: 일정 타임라인 + 받은함 */
.cols { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 28px; }
@media (min-width: 760px) { .cols { grid-template-columns: 1fr 1fr; } }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 8px 0; position: relative; }
.timeline li::after { content: ""; position: absolute; left: 63px; top: 16px; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--accent)); }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 67px; top: 28px; bottom: -12px; width: 1px; background: var(--line); }
.timeline time { font-weight: 600; font-size: 14px; padding-top: 2px; }
.timeline .body { padding-left: 18px; min-width: 0; }
.timeline .done .title { text-decoration: line-through; color: var(--sub); }
.inbox-mini { list-style: none; margin: 0; padding: 0; }
.inbox-mini li { padding: 10px 0; }
.inbox-mini li + li { border-top: 1px solid var(--line); }

/* 밀린 일 띠 */
.lateband { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; padding: 6px 8px 6px 18px;
  border-radius: var(--r); background: var(--late-bg); color: var(--late); font-weight: 600; flex-wrap: wrap; }
.lateband a { color: var(--late); min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; }

/* 할 일 줄 */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.row + .row { border-top: 1px solid var(--line); }
.row .body { flex: 1; min-width: 0; }
.row .title { overflow-wrap: anywhere; }
.row.done .title { text-decoration: line-through; color: var(--sub); }
.row .acts { display: flex; align-items: center; gap: 2px; flex: none; }
.row select { min-height: 44px; border: 0; background: #F0F0EC; border-radius: 10px; padding: 0 8px; font-size: 13px; max-width: 92px; }
.star { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 18px; color: #8A8D93; }
.star.on { color: #B45309; }
.more { font-size: 13px; min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }

/* 받은함 카드 */
.ibx { display: grid; gap: 12px; }
.ibx .card .title { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.ibx .from { font-size: 13px; color: var(--sub); margin-top: 4px; }
.ibx .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
details.pick > summary { list-style: none; }
details.pick > summary::-webkit-details-marker { display: none; }
details.pick[open] .menu { display: grid; }
.menu { display: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; margin-top: 10px; width: 100%; }
.menu .btn { justify-content: flex-start; background: #F4F4F1; }
.menu h4 { grid-column: 1 / -1; margin: 6px 0 0; font-size: 12px; color: var(--sub); font-weight: 600; }

/* 프로젝트 */
.pgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.pcard { display: block; color: var(--fg); }
.pcard:hover { box-shadow: 0 2px 6px rgba(22, 23, 26, 0.1); }
.pcard .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pcard .name { font-size: 16px; font-weight: 600; }
.pcard .next { margin-top: 12px; font-size: 14px; }
.pcard .next span { color: var(--sub); font-size: 12px; display: block; }

/* 정리 모드 */
.cleanup details { margin-top: 12px; }
.cleanup summary { min-height: 44px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; font-weight: 600; }
.pickrow { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.pickrow input { width: 22px; height: 22px; margin: 11px; flex: none; accent-color: var(--accent); }
.pickrow .body { flex: 1; padding-top: 8px; min-width: 0; overflow-wrap: anywhere; }
.actionbar { position: sticky; bottom: 64px; z-index: 10; margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  background: var(--fg); color: #fff; padding: 10px; border-radius: var(--r); }
.actionbar .input { width: auto; min-width: 0; flex: 1 1 140px; }
@media (min-width: 900px) { .actionbar { bottom: 16px; } }

/* 일정 */
.navrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.month { width: 100%; border-collapse: separate; border-spacing: 4px; table-layout: fixed; }
.month th { font-size: 12px; color: var(--sub); font-weight: 600; padding: 4px; }
.month td { background: var(--card); border-radius: 10px; vertical-align: top; height: 92px; padding: 6px; font-size: 12px; overflow: hidden; }
.month td.out { background: transparent; color: var(--sub); }
.month td.today { box-shadow: inset 0 0 0 2px var(--accent); }
.month .d { font-weight: 600; display: block; min-height: 44px; color: inherit; }
.month .e { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .month td { height: 72px; padding: 4px; } .month .e { display: none; } .month .cnt { display: block; } }
.month .cnt { display: none; color: var(--accent); font-weight: 600; }
.dayblock + .dayblock { margin-top: 16px; }
.dayblock h3 { font-size: 14px; color: var(--sub); margin-bottom: 6px; }
.dayblock h3.on { color: var(--accent); }

/* 로그인 */
.login { max-width: 360px; margin: 18vh auto 0; padding: 0 16px; }
details > summary.more-sum, details.card > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
