:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --ink: #1f1e1c;
  --muted: #6b6862;
  --line: #e4e1da;
  --accent: #2f5d50;
  --accent-ink: #ffffff;
  --danger: #a33a2b;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
}
#app { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; }
h1 { font-size: 1.5rem; line-height: 1.3; margin: 0 0 12px; }
.muted { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 24px;
}
.narrow { max-width: 440px; margin: 10vh auto 0; }
.todo { border-left: 4px solid var(--accent); }
.eyebrow { color: var(--accent); font-weight: 600; margin: 0 0 4px; font-size: .875rem; }
.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; color: var(--muted); }
label { display: block; margin: 16px 0; font-weight: 600; }
input {
  display: block; width: 100%; margin-top: 6px; padding: 12px;
  font: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
button { font: inherit; cursor: pointer; border-radius: 8px; padding: 12px 18px; border: 1px solid transparent; }
.primary { background: var(--accent); color: var(--accent-ink); width: 100%; }
.todo .primary { width: auto; }
.ghost { background: transparent; border-color: var(--line); color: var(--ink); width: 100%; margin-top: 12px; }
.link { background: none; padding: 0; color: var(--muted); text-decoration: underline; }
.msg { color: var(--muted); min-height: 1.6em; }
details { margin-top: 24px; }

/* ── 공통 (명단 관리 등) */
h2 { font-size: 1.2rem; margin: 0 0 8px; }
h3 { font-size: 1rem; margin: 20px 0 8px; }
.inline { width: auto; margin-top: 0; }
a.btn { display: inline-block; text-decoration: none; padding: 12px 18px; border-radius: 8px; }
.grow { flex: 1; }
.sub { color: var(--muted); font-size: .8125rem; font-weight: 400; }
.danger { color: var(--danger); }
button:disabled { opacity: .45; cursor: not-allowed; }
select { font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

.top nav { display: flex; gap: 20px; }
.top nav a { color: var(--muted); text-decoration: none; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.top nav a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.top { gap: 16px; }
.top nav a, .top .who, .top .link { white-space: nowrap; }
.top .who { display: flex; gap: 12px; align-items: center; min-width: 0; }
.top .name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) {
  .top .name { display: none; }
  .top nav { gap: 14px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .top nav a { font-size: .9375rem; }
  .toolbar .muted { flex-basis: 100%; }
}

.row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.row label { margin: 0; flex: 1 1 180px; }
.cyclebar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin: 8px 0 24px; }
.cyclebar label { margin: 0; display: flex; gap: 8px; align-items: center; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border-radius: 0; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input { display: inline-block; width: auto; flex: 1 1 200px; margin: 0; }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8125rem; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr[data-email] { cursor: pointer; }
table.list tr[data-email]:hover, table.list tr[data-email]:focus { background: #f2f0eb; outline: none; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #eee9df; color: var(--muted); }

.empty { text-align: center; padding: 48px 16px; }
.empty .inline { margin: 8px 4px 0; }

.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 12px; }
.steps input[type=file] { display: block; margin-top: 8px; border: 0; padding: 0; }
.stats { display: flex; gap: 20px; flex-wrap: wrap; color: var(--muted); }
.stats b { color: var(--ink); font-size: 1.25rem; margin-right: 4px; }
.error, .warn { border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.error { background: #fbeeec; color: var(--danger); }
.warn { background: #fdf6e3; color: #7a5a12; }
.card.error { border-color: #efc9c3; }
.error ul, .warn ul { margin: 8px 0 0; padding-left: 20px; }
.changes { padding-left: 20px; }
.chg { display: inline-block; font-size: .8125rem; background: #eef3f1; border-radius: 6px; padding: 1px 8px; margin: 2px 4px 2px 0; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; }

dialog { border: 0; border-radius: 12px; padding: 28px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(31, 30, 28, .35); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid2 label { margin: 8px 0; }
.grid2 select { display: block; width: 100%; margin-top: 6px; }
.span2 { grid-column: span 2; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
label.check input { width: auto; margin: 0; }
@media (max-width: 560px) { .grid2:not(.keep2) { grid-template-columns: 1fr; } .span2 { grid-column: auto; } }
label.check { align-items: flex-start; margin-top: 16px; }
label.check input { margin-top: 5px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; z-index: 10; max-width: calc(100vw - 32px); }
.toast.error { background: var(--danger); }

/* ── 내 과업 (타임테이블) */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.head h1 { margin-bottom: 4px; }
.head p { margin: 0; }
.headbtns { display: flex; gap: 8px; }
.badge { display: inline-block; margin-left: 8px; font-size: .75rem; padding: 2px 10px; border-radius: 99px; background: #eee9df; color: var(--muted); vertical-align: 1px; }
.badge.s-제출 { background: #e6eef5; color: #2c5677; }
.badge.s-수정요청 { background: #fdf0d5; color: #7a5a12; }
.badge.s-승인 { background: #e2efe9; color: var(--accent); }
.info { background: #eef3f1; color: var(--accent); border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; }
.warn p { margin: 6px 0 0; }

.gantt { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 20px 12px; }
.g-months { display: grid; grid-template-columns: repeat(12, 1fr); position: sticky; top: 0; background: var(--card); z-index: 1;
  padding: 10px 0 8px; border-bottom: 1px solid var(--line); font-size: .75rem; color: var(--muted); text-align: center; }
.g-sep { font-size: .75rem; color: var(--muted); padding: 16px 0 0; }
.g-row { padding: 14px 0 12px; border-bottom: 1px solid var(--line); border-radius: 6px; }
.g-row.clickable { cursor: pointer; }
.nodone { font-style: italic; }
.g-row:last-child { border-bottom: 0; }
.g-row.clickable:hover, .g-row.clickable:focus { background: #faf9f6; outline: none; }
.g-row:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.g-label { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 8px; }
.star { color: #c08a1e; }
.chip { font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; }
.g-track { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); height: 26px; }
.g-track i { border-left: 1px dashed #ece9e2; }
.g-track i:first-child { border-left: 0; }
.bar { position: absolute; top: 3px; bottom: 3px; background: #c9d9d2; border-radius: 6px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; }
.bar span { font-size: .75rem; color: var(--accent); white-space: nowrap; }
.g-row.core .bar { background: var(--accent); }
.g-row.core .bar span { color: #fff; }
.g-row.st-중단 { opacity: .5; }
.g-row.st-중단 .bar { background: repeating-linear-gradient(45deg, #ddd, #ddd 4px, #eee 4px, #eee 8px); }
.today { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--danger); border-radius: 2px; }
.g-done { margin-top: 6px; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
textarea { display: block; width: 100%; margin-top: 6px; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.seg-wrap { margin: 16px 0 8px; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; font-weight: 400; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 8px 16px; cursor: pointer; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--ink); }
.seg-wrap .sub { display: block; margin-top: 4px; }
@media (max-width: 560px) {
  .g-months span:nth-child(even) { visibility: hidden; }
  .gantt { padding: 4px 12px 8px; }
  .headbtns { width: 100%; }
  .headbtns button { flex: 1; }
}

/* ── 우리 팀 */
.accent { color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filters button { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: .875rem; color: var(--muted); }
.filters button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.pcard.open { border-color: #d6d2c8; }
.phead { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: none; border-radius: 0; padding: 16px 20px; text-align: left; color: var(--ink); }
.phead:hover { background: #faf9f6; }
.pmeta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pmeta .badge { margin-left: 0; }
.caret { color: var(--muted); }
.pbody { padding: 0 20px 20px; }
.pbody .gantt { border: 0; padding: 0; }
.pbody .warn { margin-top: 0; }
details.rest { margin-top: 8px; }
details.rest summary { cursor: pointer; color: var(--muted); padding: 8px 0; }
.sent { background: #fdf6e3; border-radius: 8px; padding: 10px 14px; }
form.ask { margin-top: 16px; }
@media (max-width: 560px) { .phead, .pbody { padding-left: 14px; padding-right: 14px; } .pbody .actions button { flex: 1; } }

/* ── 진행 현황 */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; }
.kpi b { font-size: 1.75rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .kpis { grid-template-columns: 1fr 1fr; } }
.cardhead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cardhead h2 { margin: 0; }
.tablewrap.flat { border: 0; border-radius: 0; }
.tablewrap.flat table.list th, .tablewrap.flat table.list td { padding-left: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.list th.num { text-align: right; }
.barcol { width: 34%; min-width: 140px; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.stack span { display: block; height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .8125rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: 0; }
.s-ok { background: #2f5d50; }
.s-wait { background: #6f9fbf; }
.s-fix { background: #d9a43b; }
.s-draft { background: #c9d9d2; }
.s-none { background: #cbc5b9; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
ul.plain li:last-child { border-bottom: 0; }
.tablewrap.flat table.list { min-width: 560px; }
.tablewrap.flat td:first-child { white-space: nowrap; }
@media (max-width: 560px) { .card { padding: 20px; } }

/* ── 작년 과업 불러오기 */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.prevlist { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.previtem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin: 0; font-weight: 400; border-bottom: 1px solid var(--line); cursor: pointer; }
.previtem:last-child { border-bottom: 0; }
.previtem input { width: auto; margin: 4px 0 0; flex: none; }
.previtem > span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.previtem.done { opacity: .55; cursor: default; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip.st-완료 { background: #eef3f1; }
.chip.st-중단 { text-decoration: line-through; }
.warnchip { background: #fdf0d5; color: #7a5a12; border-color: #f0dca8; }
.actions button { white-space: nowrap; }
@media (max-width: 560px) { .actions { flex-wrap: wrap; } .actions > .link { flex-basis: 100%; text-align: left; } }

/* 주간보고 분석: 파일 상태 */
.badge.r-wait { background: #e6eef5; color: #2c5677; }
.badge.r-ok { background: #e2efe9; color: var(--accent); }
.badge.r-fail { background: #fbe3df; color: #8a2e1f; }
table.list .badge { margin-left: 0; }

/* 주간보고 검토 */
#app.wide { max-width: 1440px; }
.rv-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .rv-grid { grid-template-columns: 1fr; } }
.rv-confirm { padding: 20px 24px; }
.toolbar.wrap { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.toolbar.wrap label { margin: 0; }
.toolbar.wrap input, .toolbar.wrap select { margin-top: 6px; width: auto; }
.pv { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; font-size: .875rem; }
.pv .blk { padding: 2px 8px; border-left: 3px solid transparent; border-radius: 4px; }
.pv .blk p { margin: 2px 0; }
.pv .blk p.b { font-weight: 700; }
.pv .blk.hl { background: #fff4cc; border-left-color: #c99a00; }
.pv img { max-width: 100%; max-height: 320px; display: block; margin: 6px 0; border-radius: 6px; }
.pvt { border-collapse: collapse; margin: 6px 0; font-size: .8125rem; }
.pvt td { border: 1px solid var(--line); padding: 4px 6px; vertical-align: top; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 12px; cursor: pointer; }
.item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.item.unclear { border-left: 4px solid #c99a00; }
.item h3 { margin: 0; font-size: 1rem; }
.item .conf { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .875rem; }
.item .chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }
.item .chip, .pv .chip { line-height: 1.6; white-space: nowrap; }
.item .chip, .pv .chip { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 99px; background: #eee9df; color: var(--muted); border: 0; }
.item .chip.warn { background: #fdf0d5; color: #7a5a12; }
.item .who, .item .cands { margin: 6px 0; font-size: .9375rem; }
.item .cands ul { margin: 4px 0 0; padding-left: 18px; }
.item .thumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.item .thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.item .thumbs .sub { flex-basis: 100%; margin: 0; }
.item .fields { margin: 12px 0 0; }
.item .fields dt { font-weight: 600; font-size: .8125rem; color: var(--muted); margin-top: 8px; }
.item .fields dd { margin: 2px 0 0; }
.item .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.rv-warn { background: #fdf0d5; color: #7a5a12; border-radius: 8px; padding: 8px 12px; font-size: .875rem; }
textarea { display: block; width: 100%; margin-top: 6px; padding: 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.radios { display: grid; gap: 6px; }
label.radio { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 0; }
label.radio input { width: auto; margin-top: 6px; }
label.radio select { margin-top: 6px; max-width: 100%; }
.actrow { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 8px; margin: 6px 0; align-items: center; }
@media (max-width: 560px) { .actrow { grid-template-columns: 1fr 1fr; } }
