:root {
  --ink: #14213d;
  --ink-2: #4a5568;
  --muted: #7a8394;
  --line: #e3e6ec;
  --bg: #f6f5f1;
  --card: #ffffff;
  --accent: #e8a33d;
  --accent-ink: #7a4a00;
  --ok: #2f855a;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", "Noto Sans KR", system-ui, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 64px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--ink); color: #fff;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.logo { font-weight: 700; letter-spacing: .18em; font-size: 18px; }
.logo::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 4px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.sub { font-size: 12px; opacity: .7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 6px; flex-shrink: 0; }
.chip {
  border: 1px solid rgba(255,255,255,.35); background: transparent; color: inherit;
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; text-decoration: none;
}
.wrap .chip { border-color: var(--line); color: var(--ink); background: var(--card); }
.chip.ghost { opacity: .8; }

/* blocks */
.hero { padding: 20px 4px 8px; }
.hero h1 { margin: 4px 0; font-size: 26px; line-height: 1.25; }
.hero .meta { margin: 4px 0; color: var(--ink-2); }
.label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 16px 0 6px; }
.sec { margin: 24px 4px 10px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 12px 0;
}
.card.focus { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); }
.card.done { border-color: var(--ok); }
.big { font-size: 18px; font-weight: 600; margin: 6px 0 12px; }
.notice { background: #fdf6e8; border-radius: 10px; padding: 10px 12px; color: var(--accent-ink); }
.notice-card { border-color: var(--accent); }
.back { display: inline-block; margin: 12px 4px 0; text-decoration: none; color: var(--ink-2); }
.or { text-align: center; color: var(--muted); margin: 10px 0; }

/* forms */
.form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 14px; font-weight: 500; }
label.inline { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
label.inline input { margin-top: 4px; }
input, textarea, select {
  font: inherit; font-size: 16px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; width: 100%;
}
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--ink); flex-shrink: 0; }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
legend { font-size: 14px; font-weight: 500; padding: 0 4px; }
.consent { font-size: 13px; color: var(--ink-2); }
.task { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row input:not([type=radio]):not([type=checkbox]) { flex: 1; min-width: 140px; width: auto; }
.btn {
  font: inherit; font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid var(--ink); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 10px 16px; text-decoration: none; display: inline-block; text-align: center;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.ghost { border-color: var(--line); color: var(--ink-2); }
.btn:disabled { opacity: .5; }

/* curriculum */
.topics { list-style: none; padding: 0; margin: 0; }
.topics li { display: grid; grid-template-columns: 70px 1fr; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.topics li:last-child { border-bottom: 0; }
.topics .wk { font-weight: 600; font-size: 13px; color: var(--accent-ink); }
.topics .dt { grid-column: 2; font-size: 12px; color: var(--muted); }

/* weeks */
.weeks { display: grid; gap: 10px; }
.week {
  display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px;
}
.week .wk { font-size: 13px; font-weight: 600; }
.week .tp { margin-top: 2px; font-weight: 500; }
.week.current { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--accent); }
.week.locked { opacity: .55; }
.badges { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef0f4; color: var(--ink-2); }
.badge.ok { background: #e6f4ec; color: var(--ok); }

.progress { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.progress > div { display: grid; }
.progress b { font-size: 20px; }
.progress .chip { margin-left: auto; }

.video { position: relative; padding-top: 56.25%; border-radius: 10px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.qs { display: grid; gap: 10px; margin-top: 14px; }
.q { border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.q p { margin: 6px 0; }
.q-head { display: flex; gap: 6px; align-items: center; }
.a { background: #f3f5f9; border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.a p { margin: 4px 0 0; }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.scroll { overflow-x: auto; }
.att td, .att th { text-align: center; white-space: nowrap; }
.att td:first-child, .att th:first-child { text-align: left; }
.dot { font-size: 11px; margin-left: 2px; color: var(--accent-ink); }

/* admin */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 8px 0; }
.tabs button {
  font: inherit; font-size: 14px; border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 14px; cursor: pointer; white-space: nowrap;
}
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.applicant.st-pending { box-shadow: inset 4px 0 0 var(--accent); }
.applicant.st-hold { opacity: .7; }
.applicant .mem { max-width: 160px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 20;
}

.status-box { border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; display: grid; gap: 6px; justify-items: start; }
.status-box.is-open { background: #e6f4ec; border: 1px solid #9fd3b5; }
.status-box.is-closed { background: #fdecec; border: 1px solid #f0b4b4; }
.status-title { font-weight: 700; font-size: 16px; }
.is-open .status-title { color: #22704a; }
.is-closed .status-title { color: #b42318; }
.status-sub { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }

.ok-badge { display: inline-block; margin-top: 6px; background: #e6f4ec; color: #22704a; border: 1px solid #9fd3b5; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 600; }
.sec-hint { margin: -4px 4px 10px; }
.st-badge { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.st-badge.st-pending { background: #fff4e0; color: #9a5b00; }
.st-badge.st-approved { background: #e6f4ec; color: #22704a; }
.st-badge.st-hold { background: #eef0f4; color: #5b6475; }
.applicant.st-pending { border-left: 5px solid #e8a33d; box-shadow: none; }
.applicant.st-approved { border-left: 5px solid #2f855a; background: #f6fbf8; }
.applicant.st-hold { border-left: 5px solid #b0b7c3; opacity: .8; }
.cnt { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cnt-pending { background: #fff4e0; color: #9a5b00; }
.cnt-approved { background: #e6f4ec; color: #22704a; }
.cnt-hold { background: #eef0f4; color: #5b6475; }

.prov { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }
.prov-google { background: #e8f0fe; color: #1a56c4; }
.prov-email { background: #f3e8fd; color: #6b2fb3; }
.prov-none { background: #eef0f4; color: #7a8394; }

.btn.danger { background: #b42318; border-color: #b42318; color: #fff; }
.btn.danger-ghost { border-color: #f0b4b4; color: #b42318; background: #fff; margin-left: auto; }
.del-confirm { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #fdecec; border: 1px solid #f0b4b4; color: #7a1c14; }
.del-confirm p { margin: 4px 0 10px; }

.count-card { margin: 4px 0 14px; padding: 18px 20px; border-radius: var(--radius); background: var(--ink); color: #fff; display: grid; justify-items: center; text-align: center; gap: 2px; }
.count-num { font-size: 56px; font-weight: 800; line-height: 1; color: var(--accent); letter-spacing: -1px; }
.count-label { font-size: 16px; font-weight: 600; }
.count-few { font-size: 18px; font-weight: 700; color: #fff; }
.count-prev { margin-top: 6px; font-size: 13px; opacity: .75; }

.checkin { border: 2px solid var(--accent); background: #fffaf0; }
.checkin.done { border-color: #9fd3b5; background: #f3fbf6; }
.checkin-title { font-size: 20px; font-weight: 800; }
.ci-input { font-size: 26px !important; letter-spacing: 8px; text-align: center; max-width: 170px; font-weight: 700; }
.streak { margin-top: 6px; font-weight: 700; color: #b45309; }
.code-panel h2 { margin: 0; }
.code-panel select { width: auto; }
.code-big { font-size: 64px; font-weight: 800; letter-spacing: 12px; text-align: center; color: var(--ink); margin: 8px 0; }
.code-big.closed { color: #b0b7c3; text-decoration: line-through; }
.ci-tag { display: inline-grid; justify-items: center; font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 6px; line-height: 1.2; }
.ci-tag small { font-weight: 500; font-size: 10.5px; }
.ci-tag.ok { background: #e6f4ec; color: #22704a; }
.ci-tag.late { background: #fff4e0; color: #9a5b00; }

.task-card { border: 1px solid var(--line); border-left: 5px solid #b0b7c3; border-radius: 10px; padding: 12px; margin: 10px 0; display: grid; gap: 8px; }
.task-card.st-done { border-left-color: #2f855a; background: #f6fbf8; }
.task-card.st-late { border-left-color: #e8a33d; background: #fffaf0; }
.task-card.st-ret { border-left-color: #b42318; background: #fdf3f2; }
.tchip { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tchip.todo { background: #eef0f4; color: #5b6475; }
.tchip.done { background: #e6f4ec; color: #22704a; }
.tchip.late { background: #fff4e0; color: #9a5b00; }
.tchip.ret { background: #fdecec; color: #b42318; }
.star-note { font-weight: 700; color: #9a5b00; }
.file-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px dashed var(--ink-2); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 600; justify-content: center; }
.photo-prev { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-prev img { max-width: 48%; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); object-fit: contain; background: #fafafa; }
.shared { display: grid; gap: 10px; }
.task-editor { border: 1px dashed var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.task-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 6px; align-items: center; }
.task-row select, .task-row input { padding: 8px; font-size: 14px; }
.adm-task { border-top: 1px solid var(--line); padding: 8px 0; display: grid; gap: 6px; }
.adm-task .cmt { flex: 1; min-width: 140px; padding: 6px 10px; font-size: 14px; }
@media (max-width: 480px) { .task-row { grid-template-columns: 1fr auto; } .task-row select { grid-column: 1 / -1; } }

.notices { border-left: 5px solid var(--accent); }
.notices h2 { margin: 0; }
.notice-item { border-top: 1px solid var(--line); padding: 10px 0 4px; }
.notice-item:first-of-type { border-top: 0; }
.notice-item p { margin: 6px 0; white-space: normal; }
.new { background: #b42318; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; margin: 8px 0; }
.push-card { background: #f3f6ff; border-color: #c9d6ff; }
.push-on { color: #22704a; margin: 4px 4px 8px; }

.plink { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; font-weight: 600; }
.search-box { position: sticky; top: 52px; z-index: 4; background: var(--bg); padding: 8px 0; display: grid; gap: 4px; }
.search-box input { font-size: 16px; }
.btn.wa.sm { margin: 0; padding: 6px 12px; }

.team-card { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; text-decoration: none; border-color: var(--ink); }
.sp-list { display: grid; gap: 6px; margin: 8px 0; max-height: 320px; overflow-y: auto; }
.sp-item { text-align: left; font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.sp-item:hover { border-color: var(--ink); }
#invUrl { font-size: 13px; }
.sp-card { margin: 8px 0; }
.sp-card details ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.8; }
.sp-groups { display: grid; gap: 6px; margin: 8px 0; }
.sp-group { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; background: #fff; }
.sp-group:has(input:checked) { border-color: var(--ink); background: #f3f6fb; }
.sp-group input { margin-top: 4px; width: auto; }
.sp-linkbar { position: sticky; bottom: 0; background: #fff; border-top: 2px solid var(--ink); padding: 10px 0 4px; }
.x-btn { border: 0; background: none; cursor: pointer; font-weight: 700; padding: 0 2px; color: inherit; }
[hidden] { display: none !important; }
.sp-pick { display: grid; gap: 4px; }
.sp-pick .sp-suggest { display: grid; gap: 4px; }
.sp-pick .sp-suggest:empty { display: none; }
.sp-picked { color: #22704a; font-weight: 700; }
.sp-actions { display: grid; gap: 10px; margin-top: 8px; }
.sp-actions .row input { flex: 1; min-width: 120px; }
.sp-manage { margin-top: 6px; }
.sp-manage > * + * { margin-top: 6px; }
.sp-manage .row input, .sp-manage select { flex: 1; min-width: 120px; }
.sp-linkbar { max-height: 60vh; overflow-y: auto; }
/* Partnerlerim 계보 나무 */
ul.tree { list-style: none; margin: 0; padding: 0; }
ul.tree ul.tree { padding-left: 26px; border-left: 2px solid var(--line); margin-left: 13px; }
.tree-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid #f0f1f4; }
.tree-row.hit { background: #fff8e1; }
.tree-tg { width: 26px; height: 26px; flex: none; border: 1px solid var(--ink); border-radius: 6px; background: #fff; font: inherit; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; }
.tree-tg.empty { border: 0; cursor: default; }
.tree-cnt { font-size: 12px; font-weight: 700; background: #eef0f4; color: #5b6475; border-radius: 999px; padding: 1px 8px; }
.tree-info { font-size: 13px; color: var(--muted, #5b6475); flex-basis: 100%; padding-left: 34px; margin-top: -4px; }
.dup-group { margin: 8px 0; padding: 4px 12px; }
.dup-row { padding: 8px 0; border-bottom: 1px solid var(--line); }
.dup-row:last-child { border-bottom: 0; }
.dup-row.no-rec { background: #fffaf0; }
.del-account { border-color: #f3c4c4; }
