:root {
  color-scheme: light;
  --page: #f5f5f2; --card: #ffffff; --sunk: #f9f9f7;
  --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e7e6e0; --ring: rgba(11,11,11,.10); --wash: rgba(11,11,11,.04);
  --accent: #2a78d6; --accent-ink: #1c5cab; --accent-wash: #eaf2fc;
  --good: #0ca30c; --warning: #fab219; --critical: #d03b3b;
  --input: #fffdf3; --input-ring: #e8dca8;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--ink); }
body { font: 14px/1.5 "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", "Malgun Gothic", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }

.top { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--ring); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 8px 24px 0; }
.bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 40px; }
.brand { font-weight: 700; font-size: 17px; letter-spacing: -.01em; margin-right: auto; }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.who b { color: var(--ink); font-weight: 650; }
.nas-go { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.nas-go small { font-size: 11px; color: var(--muted); margin-top: 2px; }
nav.tabs { display: flex; gap: 2px; margin-top: 4px; overflow-x: auto; }
nav.tabs a { padding: 9px 14px; font-size: 14px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs a:hover { color: var(--ink); }
nav.tabs a.on { color: var(--ink); font-weight: 650; border-bottom-color: var(--ink); }

main { max-width: 1280px; margin: 0 auto; padding: 20px 24px 60px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; }
.sub, .muted { font-size: 12px; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--ring); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.card h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols2 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .cols2 { grid-template-columns: 1fr; } }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--card); border: 1px solid var(--ring); border-radius: 12px; padding: 14px 16px; }
.tile .l { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 24px; font-weight: 700; margin-top: 2px; }
.tile .v small { font-size: 13px; font-weight: 500; color: var(--ink-2); margin-left: 2px; }
.tile .s { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

.btn { border: 1px solid var(--ring); background: var(--card); border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { background: var(--wash); }
.btn.pri { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.pri:hover { background: #333; }
.btn.on { background: var(--accent-wash); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filters select, .filters input { border: 1px solid var(--ring); border-radius: 8px; padding: 6px 9px; background: var(--card); font-size: 13px; }

.empty { color: var(--muted); padding: 24px 0; text-align: center; font-size: 13px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--wash); color: var(--ink-2); white-space: nowrap; }
.tag.k-P { background: #eaf2fc; color: #1c5cab; } .tag.k-CS { background: #eef7ee; color: #2c6b2c; } .tag.k-R { background: #f3eefa; color: #5b3f8c; }
.tag.k-J { background: #fff4df; color: #8a5a00; } .tag.k-S { background: #fdecec; color: #9b2c2c; }
.pre { white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }

/* 일정 */
.sch-day { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 8px 0; border-top: 1px solid var(--grid); }
.sch-day:first-child { border-top: 0; }
.sch-day .d { font-weight: 650; font-size: 13px; }
.sch-day .d.today { color: var(--accent-ink); }
.sch-day .d small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.sch-it { display: flex; gap: 8px; align-items: baseline; padding: 2px 0; flex-wrap: wrap; }
.sch-it .g { font-size: 12px; color: var(--ink-2); min-width: 92px; }
.sch-it .t { font-weight: 550; }
.sch-it .b { flex-basis: 100%; font-size: 12px; color: var(--ink-2); padding-left: 100px; }
@media (max-width: 600px) { .sch-it .b { padding-left: 0; } }

/* 공유 */
.share-g { padding: 8px 0; border-top: 1px solid var(--grid); }
.share-g:first-child { border-top: 0; padding-top: 0; }
.share-g h3 { font-size: 13px; margin: 0 0 4px; }
.share-g .trip { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* 프로젝트 */
.pj { border-top: 1px solid var(--grid); padding: 12px 0; display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.pj:first-child { border-top: 0; }
@media (max-width: 800px) { .pj { grid-template-columns: 1fr; gap: 6px; } }
.pj .n { font-weight: 650; }
.pj .meta { font-size: 12px; color: var(--ink-2); margin-top: 3px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pj .prog { font-size: 13px; }
.pj .collab { margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.pj .collab b { color: var(--ink); font-weight: 600; margin-right: 6px; }

/* 타임시트 */
.ts-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; }
.ts-days button { border: 1px solid var(--ring); background: var(--card); border-radius: 10px; padding: 8px; cursor: pointer; text-align: left; }
.ts-days button.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ts-days .dn { font-size: 12px; color: var(--muted); }
.ts-days .dv { font-weight: 700; font-size: 16px; }
.ts-days .dv.full { color: var(--good); } .ts-days .dv.part { color: #b07800; }
.ts-row { display: grid; grid-template-columns: minmax(180px, 1.3fr) 90px minmax(160px, 2fr) 70px 32px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--grid); }
.ts-row.h { font-size: 12px; color: var(--muted); border-top: 0; }
.ts-row input[type=number], .ts-row input[type=text], .ts-add select, textarea.iss { border: 1px solid var(--input-ring); background: var(--input); border-radius: 7px; padding: 6px 8px; width: 100%; font-size: 13px; }
.ts-row input:disabled { background: var(--sunk); border-color: var(--grid); }
.ts-row .pn small { display: block; font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .ts-row { grid-template-columns: 1fr 80px; } .ts-row .memo { grid-column: 1 / -1; } }
.ts-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ts-sum { font-weight: 700; }
.ts-sum.bad { color: var(--critical); } .ts-sum.ok { color: var(--good); }
.ts-add { display: flex; gap: 8px; margin-top: 10px; }
.ts-add select { max-width: 420px; }
.notice { background: color-mix(in srgb, var(--warning) 16%, transparent); border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #222; color: #fff; padding: 8px 14px; border-radius: 8px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s; }
#toast.on { opacity: 1; }
.login { max-width: 460px; margin: 80px auto; text-align: center; }
.login h1 { font-size: 20px; }

/* 입력 (팀장) */
.ed-go { margin-left: auto; }
.share-g h3 { display: flex; align-items: center; gap: 8px; }
.sch-it .ed-go { margin-left: auto; padding: 1px 8px; }
.prog-h { display: flex; gap: 10px; align-items: flex-start; }
.prog-h > :first-child { flex: 1; }
.pj .collab { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; }
textarea.ed-box, .ed-f input, .ed-f select { border: 1px solid var(--input-ring); background: var(--input); border-radius: 7px; padding: 6px 8px; width: 100%; font-size: 13px; }
textarea.ed-box { resize: vertical; line-height: 1.5; }
.ed-inline { flex-basis: 100%; }
.ed-inline textarea { margin-top: 4px; }
.ed-act { display: flex; gap: 6px; justify-content: flex-end; align-items: center; margin-top: 8px; }
.ed-l { display: block; font-size: 12px; color: var(--muted); margin: 6px 0 3px; }
.ed-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; }
.ed-f { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.ed-f.wide { grid-column: span 3; }
.ed-sched > .ed-f.wide { margin-top: 10px; }
@media (max-width: 760px) { .ed-grid { grid-template-columns: 1fr 1fr; } .ed-f.wide { grid-column: 1 / -1; } }
.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 40%, transparent); }
.tag.wait { background: #fff4df; color: #8a5a00; }
.ed-log { font-size: 13px; padding: 10px 16px; }
.ed-log .bad { color: var(--critical); margin-top: 4px; }
.ed-log .bad b { color: var(--ink); font-weight: 600; }
