/* 기한지기 시제품.
   카드와 그림자 없이 선과 여백으로 묶는다. 굵기는 400과 700 두 가지, 둥글기는 6px 하나만 쓴다.
   강조색(호박색)은 마감과 확인 필요에만 쓴다. 색만으로 뜻을 전하지 않도록 늘 글로 함께 적는다. */

:root {
  --ink: #15171a;
  --ink-2: #464c55;   /* 흰 바탕 8.7:1 */
  --ink-3: #626975;   /* 흰 바탕 5.5:1 */
  --line: #d8dbe0;
  --field: #858c97;   /* 입력 칸 테두리, 흰 바탕 3.4:1 */
  --paper: #ffffff;
  --amber: #8a4f00;   /* 흰 바탕 6.6:1 */
  --r: 6px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.6 "Pretendard", "Pretendard GOV", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.wrap { max-width: 1040px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1:focus, main:focus { outline: none; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 10; background: var(--paper); padding: 8px 12px; }

/* 머리 */
.top { border-bottom: 2px solid var(--ink); }
.top-in { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 10px; }
.mark { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; text-decoration: none; }
.tag { margin: 0; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 다음 마감 줄 */
.due { padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 16px; }
.due:empty { display: none; }
.due p { margin: 2px 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
.due .label { color: var(--ink-2); }
.due strong { font-variant-numeric: tabular-nums; }
.due a { text-decoration: none; }
.due a:hover { text-decoration: underline; }
.due .left { margin-left: auto; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.amber, .due .left.amber { color: var(--amber); font-weight: 700; }
@media (max-width: 639px) {
  .due .left { order: 2; margin-left: 0; }
  .due a { order: 3; flex-basis: 100%; }
}

/* 화면 목록 */
.nav { display: flex; flex-wrap: wrap; gap: 0 18px; border-bottom: 1px solid var(--line); }
@media (max-width: 359px) { .nav { gap: 0 14px; } }
.nav a { display: inline-flex; align-items: center; min-height: 48px; color: var(--ink-2); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--ink); }
.nav .long { display: none; }

main { max-width: 720px; padding-bottom: 56px; }

@media (min-width: 900px) {
  .body { display: grid; grid-template-columns: 168px minmax(0, 1fr); column-gap: 56px; }
  .nav { flex-direction: column; border-bottom: 0; position: sticky; top: 0; align-self: start; padding-top: 30px; }
  .nav a { min-height: 44px; border-bottom: 0; margin: 0; padding-left: 14px; border-left: 2px solid var(--line); }
  .nav a[aria-current="page"] { border-left-color: var(--ink); }
  .nav .short { display: none; }
  .nav .long { display: inline; }
}

/* 글 */
h1 { font-size: 26px; line-height: 1.3; letter-spacing: -0.015em; margin: 28px 0 8px; }
h2 { font-size: 19px; line-height: 1.4; margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--ink); }
h3 { font-size: 17px; line-height: 1.4; margin: 28px 0 0; }
p { margin: 8px 0; }
ul, ol { padding-left: 22px; }
.lead { color: var(--ink-2); }
.muted { color: var(--ink-3); }
.hint { margin: 6px 0 0; font-size: 15px; color: var(--ink-3); }
.basis { font-size: 15px; color: var(--ink-2); margin: 6px 0 0; }
.flag-text { color: var(--amber); font-weight: 700; }
.notice { margin: 16px 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.count { color: var(--ink-2); font-size: 16px; margin-top: 20px; }
.sample { font-size: 16px; color: var(--ink-2); }
.sample p { margin: 4px 0; }
.sample-links { display: flex; flex-wrap: wrap; gap: 0 20px; }
@media (min-width: 900px) { h1 { font-size: 30px; margin-top: 34px; } }

/* 단추 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: var(--paper); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 15px; }
.link-btn {
  background: none; border: 0; padding: 0; min-height: 32px;
  font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.actions .hint { flex-basis: 100%; margin: 0; }

/* 줄 목록. 맨 위 줄은 바로 앞 제목의 선이 대신한다. */
.rows { list-style: none; margin: 4px 0 0; padding: 0; }
.rows > li { padding: 14px 0; border-top: 1px solid var(--line); }
.rows > li:first-child { border-top: 0; }
h3 + .rows > li:first-child { border-top: 1px solid var(--line); margin-top: 8px; }

/* 고르기 */
fieldset { border: 0; margin: 28px 0 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; font-size: 18px; font-weight: 700; }
.choice { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.choice:last-child { border-bottom: 1px solid var(--line); }
.choice input { flex: none; width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--ink); }
.choice:has(input:checked) { font-weight: 700; }
.result { margin-top: 8px; }
.result ul { margin: 12px 0 0; }

/* 입력 칸 */
.field { display: grid; gap: 6px; padding: 12px 0; }
.field > label { font-weight: 700; }
input[type="date"], input[type="text"], input[type="datetime-local"], select, textarea {
  width: 100%; max-width: 360px; min-height: 48px; padding: 0 12px;
  border: 1px solid var(--field); border-radius: var(--r);
  background: var(--paper); color: var(--ink); font: inherit; font-size: 17px;
}
textarea { max-width: none; padding: 10px 12px; line-height: 1.5; }
/* 파일 칸은 화면에서 감추고 이름표를 단추로 보인다. 키보드 초점은 그대로 받는다. */
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-input:focus-visible + label { outline: 2px solid var(--ink); outline-offset: 2px; }
.field > label.btn { font-weight: 700; justify-self: start; }
.nowrap { white-space: nowrap; }
input[type="checkbox"] { accent-color: var(--ink); }
.err { margin: 0; font-size: 15px; color: var(--amber); font-weight: 700; }
.err:empty { display: none; }
.check-label { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check-label input { width: 24px; height: 24px; margin: 0; }

/* 기한: 받은 날짜 */
.group h3 { margin-top: 24px; }
.group .hint { margin-top: 4px; }
.fields { margin-top: 6px; }
.field.date { border-top: 1px solid var(--line); grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 16px; }
.field.date > label { grid-column: 1 / -1; font-weight: 400; }
.field.date input { grid-column: 1; }
.field.date .link-btn { grid-column: 2; font-size: 15px; color: var(--ink-2); }
.field.date .err { grid-column: 1 / -1; }
.field.date .hint { grid-column: 1 / -1; margin: 0; }
@media (min-width: 640px) {
  .field.date { grid-template-columns: minmax(0, 1fr) 200px 4em; }
  .field.date > label { grid-column: 1; }
  .field.date input { grid-column: 2; }
  .field.date .link-btn { grid-column: 3; }
}

/* 기한: 계산 결과 */
.dl { display: grid; gap: 2px; }
.dl p { margin: 0; }
.dl-date { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.dl.is-due .dl-date { color: var(--amber); }
.dl-name { font-weight: 700; }
.dl-meta { color: var(--ink-2); font-size: 16px; font-variant-numeric: tabular-nums; }
.dl.is-due.is-past .dl-meta { color: var(--amber); font-weight: 700; }
@media (min-width: 640px) { .dl { grid-template-columns: 9.5em minmax(0, 1fr); column-gap: 24px; } }
details { margin-top: 6px; }
summary { cursor: pointer; padding: 6px 0; color: var(--ink-2); font-size: 15px; }
.steps, .notes { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.steps li + li, .notes li + li { margin-top: 2px; }
.law { margin: 10px 0 0; font-size: 15px; }
.law dt { font-weight: 700; }
.law dd { margin: 2px 0 8px; color: var(--ink-2); }
.na { margin-top: 28px; }
.rows > li > p { margin: 0; }
.rows > li > p + p { margin-top: 4px; }

/* 지금 할 일 */
.todo > li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 14px; }
.todo input[type="checkbox"] { width: 24px; height: 24px; margin: 2px 0 0; }
.todo-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 16px; }
.todo-title { font-size: 18px; font-weight: 700; cursor: pointer; }
.when { font-size: 15px; color: var(--ink-2); }
.todo-text { margin: 4px 0 0; }
.due-line { margin: 6px 0 0; color: var(--amber); font-weight: 700; font-variant-numeric: tabular-nums; }
.todo li.done .todo-title, .todo li.done .todo-text, .todo li.done .due-line { color: var(--ink-3); font-weight: 400; }
.todo li.done .todo-title { font-weight: 700; }

/* 사건 기록 */
.more { margin-top: 12px; border-top: 1px solid var(--line); }
.more > summary { padding: 12px 0; min-height: 48px; font-size: 16px; color: var(--ink); font-weight: 700; }
.filter { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin-top: 8px; }
.filter p { margin: 0; }
.rec { display: grid; gap: 2px; }
.rec:focus { outline: 2px solid var(--ink); outline-offset: 4px; }
.rec p { margin: 0; }
.rec-time { color: var(--ink-2); font-size: 15px; font-variant-numeric: tabular-nums; }
.rec-kind { color: var(--ink-2); font-size: 15px; }
.rec-text { white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.rec-facts { margin-top: 4px !important; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rec-src { color: var(--ink-3); font-size: 15px; }
.rec-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 8px; }
.edit { margin-top: 8px; padding-top: 4px; border-top: 1px dashed var(--line); }
@media (min-width: 640px) { .rec { grid-template-columns: 10.5em minmax(0, 1fr); column-gap: 20px; } }

/* 진행 현황 */
.stages > li { display: grid; grid-template-columns: 3.6em minmax(0, 1fr); column-gap: 16px; }
.stage p { margin: 0; }
.stage-state { font-size: 15px; color: var(--ink-3); padding-top: 2px; }
.stage-desc { font-size: 15px; color: var(--ink-2); margin-top: 2px !important; }
.stage-date { grid-column: 2; font-size: 15px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stage-date:empty { display: none; }
.stage.s-now .stage-state, .stage.s-now .stage-name { color: var(--ink); font-weight: 700; }
.stage.s-done .stage-state { color: var(--ink-2); }
.stage.s-later .stage-name { color: var(--ink-2); }
@media (min-width: 640px) {
  .stages > li { grid-template-columns: 3.6em minmax(0, 1fr) 9em; }
  .stage-date { grid-column: 3; grid-row: 1; text-align: right; }
}

/* 증거 목록 */
.switch { display: inline-flex; margin-top: 20px; border: 1px solid var(--ink); border-radius: var(--r); overflow: hidden; }
.switch button { min-height: 44px; padding: 0 16px; border: 0; background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; }
.switch button + button { border-left: 1px solid var(--ink); }
.switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); font-weight: 700; }
.doc { margin-top: 24px; border-top: 2px solid var(--ink); }
.doc h2 { margin-top: 0; padding-top: 14px; border-top: 0; font-size: 22px; }
.doc .meta { color: var(--ink-2); font-size: 15px; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 700; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink); white-space: nowrap; }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
td.nowrap { white-space: nowrap; }
.num { text-align: right; white-space: nowrap; padding-right: 0; }
tfoot td { border-top: 1px solid var(--ink); border-bottom: 0; font-weight: 700; }
/* 좁은 화면에서는 표의 한 줄을 위아래로 쌓는다 */
@media (max-width: 639px) {
  .doc thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc table, .doc tbody, .doc tfoot, .doc tr, .doc td { display: block; }
  .doc tbody tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .doc td { padding: 0; border: 0; }
  .doc td.nowrap { color: var(--ink-2); }
  .doc tbody td.num { text-align: left; font-weight: 700; margin-top: 2px; }
  .doc tbody td.num:empty { display: none; }
  .doc tfoot tr { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--ink); }
  .doc tfoot td { border-top: 0; }
}
.cell-kind { font-weight: 700; }
.cell-sub { display: block; color: var(--ink-2); overflow-wrap: anywhere; }
.pairs { display: grid; grid-template-columns: 5em minmax(0, 1fr); gap: 4px 12px; margin: 8px 0 0; font-size: 16px; }
.pairs dt { color: var(--ink-2); }
.pairs dd { margin: 0; overflow-wrap: anywhere; }
.attach { margin: 8px 0 0; padding: 0; list-style: none; font-size: 16px; }
.attach li { padding: 4px 0 4px 28px; position: relative; }
.attach li::before { content: ""; position: absolute; left: 0; top: 9px; width: 14px; height: 14px; border: 1px solid var(--ink); }

/* 바닥 */
.foot { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 40px; font-size: 15px; color: var(--ink-2); }
.foot p { margin: 4px 0; max-width: 720px; }

@media print {
  .skip, .top, .nav, .due, .foot, .no-print, .actions, .notice { display: none !important; }
  body { font-size: 11pt; }
  .wrap, main { max-width: none; padding: 0; }
  .body { display: block; }
  body[data-page="evidence"] main > h1 { display: none; }
  .doc { border-top: 0; margin-top: 0; }
  .table-wrap { overflow: visible; }
  a { text-decoration: none; }
  details > summary { display: none; }
}
