:root {
  --ink: #17233b; --muted: #66708a; --line: #e2e6ef; --bg: #f5f7fb; --panel: #fff;
  --brand: #1f3a8a; --brand-soft: #e8edfb; --danger: #c62828;
  --todo: #9aa3b5; --doing: #e19b16; --ready: #1f8a5b; --submitted: #2c5bd6; --open: #c62828; --resolved: #1f8a5b;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--danger); }
.pad { padding: 24px; }
.click { cursor: pointer; }
.grow { flex: 1; }
.button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.button.quiet:hover { background: var(--brand-soft); }
.button.danger { color: var(--danger); border-color: #f1c4c4; }
input, select, textarea { font: inherit; font-size: 14px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); min-width: 0; }
textarea { resize: vertical; }

/* ---------- landing ---------- */
.landing { background: #fff; }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 16px clamp(16px, 5vw, 64px); border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(255,255,255,.96); z-index: 5; }
.site-logo img { height: 40px; display: block; }
.site-nav { display: flex; gap: 20px; flex-wrap: wrap; font-weight: 500; }
.site-nav a { text-decoration: none; color: #374151; }
.site-nav a.accent { color: var(--brand); font-weight: 700; }
.hero { padding: 88px clamp(16px, 5vw, 64px) 64px; background: linear-gradient(135deg, #14244f, #1f3a8a 60%, #2d55c9); color: #fff; text-align: center; }
.hero .eyebrow { letter-spacing: .2em; font-size: 13px; opacity: .8; margin: 0 0 12px; }
.hero h1 { font-size: clamp(34px, 6vw, 54px); margin: 0 0 18px; }
.hero .lead { font-size: clamp(16px, 2.2vw, 20px); opacity: .92; margin: 0; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; padding: 56px clamp(16px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.points article { border: 1px solid var(--line); border-radius: 14px; padding: 26px; background: #fff; }
.points .num { color: var(--brand); font-weight: 800; font-size: 14px; }
.points h2 { font-size: 19px; margin: 8px 0 10px; }
.points p { color: #4b5563; margin: 0; font-size: 15px; }
.flow { max-width: 1240px; margin: 0 auto; padding: 8px clamp(16px, 5vw, 64px) 48px; }
.flow h2 { font-size: 22px; }
.flow ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; counter-reset: s; }
.flow li { background: var(--bg); border-radius: 12px; padding: 18px; counter-increment: s; }
.flow li b { display: block; margin-bottom: 4px; }
.flow li b::before { content: counter(s) ". "; color: var(--brand); }
.flow li span { color: #4b5563; font-size: 14px; }
.login-section { background: var(--bg); padding: 56px 16px 72px; display: flex; justify-content: center; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 30px rgba(20,36,79,.08); }
.login-card h2 { margin: 0; }
.login-card p { margin: 0 0 8px; }
.login-card label { font-size: 13px; color: var(--muted); margin-top: 6px; }
.login-card .button { margin-top: 12px; padding: 11px; }
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; border-top: 1px solid var(--line); }

/* ---------- board ---------- */
.board-header { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; }
.brand .mark { background: var(--brand); color: #fff; border-radius: 6px; padding: 2px 7px; font-size: 13px; }
.tabs { display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto; order: 3; flex: 1 1 100%; }
.tabs a { white-space: nowrap; }
.who { margin-left: auto; }
.tabs a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs a.on, .tabs a:hover { background: var(--brand-soft); color: var(--brand); }
.who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.who input { width: 96px; padding: 5px 8px; }
.view { padding: 18px 20px 48px; max-width: 1680px; margin: 0 auto; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.panel h3 { margin: 0 0 12px; font-size: 15px; }
.panel h3 + h3, .panel ul + h3 { margin-top: 18px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1; }
.filters input[type=search] { width: 200px; }
.check { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--brand); color: #fff; }
.seg small { margin-left: 4px; opacity: .8; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; border-top: 4px solid var(--line); }
.kpi b { display: block; font-size: 24px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi.st-todo { border-top-color: var(--todo); } .kpi.st-doing { border-top-color: var(--doing); }
.kpi.st-ready { border-top-color: var(--ready); } .kpi.st-submitted { border-top-color: var(--submitted); }
.kpi.late { border-top-color: var(--danger); } .kpi.late b { color: var(--danger); }
.kpi.issue { border-top-color: #7c3aed; }
.bar { height: 6px; background: #edf0f6; border-radius: 3px; overflow: hidden; margin-top: 6px; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--ready); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th { background: #f8f9fc; color: var(--muted); font-weight: 600; white-space: nowrap; position: sticky; top: 0; }
td.n { text-align: center; font-variant-numeric: tabular-nums; }
td.c { text-align: center; }
.matrix tbody tr:hover, table.std tbody tr:hover { background: #fafbff; }
.matrix th small { color: var(--muted); font-weight: 400; }
td.st-todo { color: #5b6477; } td.st-doing { color: #a36b00; } td.st-ready { color: var(--ready); } td.st-submitted { color: var(--submitted); }
.late-text { color: var(--danger); font-weight: 700; }
table.std td.no { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); }
table.std td.title { min-width: 260px; }
table.std td.note { color: var(--muted); max-width: 240px; font-size: 12px; }
table.std select, table.std input { padding: 4px 6px; font-size: 12px; }
table.std tr.st-na { opacity: .5; }
table.std tr.late td.title { color: var(--danger); }

.timeline, .list, .log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.timeline li, .list li { display: flex; gap: 10px; align-items: baseline; }
.timeline li b, .list li b { min-width: 52px; font-variant-numeric: tabular-nums; }
.timeline li.past { opacity: .5; }
.list li small { margin-left: auto; color: var(--muted); white-space: nowrap; }
.log li { display: grid; grid-template-columns: 128px 130px 1fr; gap: 8px; }
.log time { white-space: nowrap; }
.log time { color: var(--muted); }
.log-lock { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.log-lock p { margin: 0; }
.log-lock input { flex: 1; }

.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-head h3 { margin: 0 6px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-w { text-align: center; font-size: 12px; color: var(--muted); padding: 4px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8f9fc; }
.cal-d { min-height: 104px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-d.out { background: #fafbfd; }
.cal-d.out .cal-n { opacity: .4; }
.cal-d.now { background: #f2f6ff; }
.cal-d.now .cal-n { color: #fff; background: var(--brand); border-radius: 10px; padding: 0 6px; }
.cal-d.over, .col.over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.cal-n { font-size: 12px; font-weight: 700; align-self: flex-start; }
.chip { font-size: 11px; padding: 2px 6px; border-radius: 5px; background: #eef1f6; border-left: 3px solid var(--todo); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; }
.chip.st-doing { border-left-color: var(--doing); background: #fff6e3; }
.chip.st-ready { border-left-color: var(--ready); background: #e7f6ee; }
.chip.st-submitted { border-left-color: var(--submitted); background: #e8eefc; }
.chip.late { color: var(--danger); font-weight: 600; }
.more { font-size: 11px; color: var(--brand); }
.nodate { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.nodate .card { width: 220px; }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.kanban.owners { grid-auto-columns: minmax(250px, 280px); }
.col { background: #eef1f7; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; border-top: 4px solid var(--todo); }
.col.st-doing { border-top-color: var(--doing); } .col.st-ready { border-top-color: var(--ready); } .col.st-submitted { border-top-color: var(--submitted); }
.col.st-open { border-top-color: var(--open); } .col.st-resolved { border-top-color: var(--resolved); }
.col.owner { border-top-color: var(--brand); }
.col-head { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 14px; }
.col-head small:last-child { margin-left: auto; color: var(--muted); font-weight: 500; }
.card { background: #fff; border-radius: 9px; padding: 9px 10px; border: 1px solid var(--line); border-left: 4px solid var(--todo); cursor: grab; font-size: 13px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card:hover { border-color: #c6cfe2; }
.card.lift { opacity: .45; }
.card.st-doing { border-left-color: var(--doing); } .card.st-ready { border-left-color: var(--ready); }
.card.st-submitted { border-left-color: var(--submitted); } .card.st-open { border-left-color: var(--open); } .card.st-resolved { border-left-color: var(--resolved); }
.card.late { background: #fff7f7; }
.card-title { font-weight: 600; margin: 2px 0 4px; word-break: keep-all; overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: 12px; align-items: center; }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #eef1f6; color: #4b5563; }
.tag.customs { background: #fde8e8; color: #a61b1b; } .tag.agent { background: #e8eefc; color: #1f3a8a; } .tag.team { background: #ede7fb; color: #5b21b6; }
.tag.std { background: #f1f3f7; } .tag.hot, .tag.sev-high { background: #c62828; color: #fff; } .tag.sev-normal { background: #fff3d6; color: #8a5a00; }
.tag.internal { background: #fff3d6; color: #8a5a00; }
.tag.org { font-weight: 600; }
.tag.org-0 { background: #e7f6ee; color: #1f6b47; } .tag.org-1 { background: #e8eefc; color: #1f3a8a; } .tag.org-2 { background: #ede7fb; color: #5b21b6; }
.org-chip:empty { display: none; }
.org-chip { background: var(--brand-soft); color: var(--brand); font-weight: 700; border-radius: 6px; padding: 3px 8px; }
.internal-memo span { color: #8a5a00; font-weight: 600; }
.internal-memo textarea { background: #fffaf0; border-color: #f1dcae; }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: #eef1f6; }
.pill.st-doing { background: #fff1d1; } .pill.st-ready { background: #dcf3e7; } .pill.st-submitted { background: #e0e8fd; }
.pill.st-open { background: #fde2e2; } .pill.st-resolved { background: #dcf3e7; }

.editor { border: 0; border-radius: 14px; padding: 0; width: min(720px, 94vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.editor::backdrop { background: rgba(15, 23, 42, .4); }
.editor form { padding: 20px; display: flex; flex-direction: column; gap: 14px; max-height: 88vh; overflow: auto; }
.editor h2 { margin: 0; font-size: 18px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.f span { color: var(--muted); }
.wide { grid-column: 1 / -1; }
.editor-actions { display: flex; gap: 8px; align-items: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #17233b; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 50; }
.toast.bad { background: var(--danger); }

@media (max-width: 960px) {
  .grid2 { grid-template-columns: 1fr; }
  .cal-d { min-height: 70px; }
  .chip { font-size: 10px; }
  .fields { grid-template-columns: 1fr; }
  .who input { width: 80px; }
}
