/* 워크레저 화면 공통 스타일.
   색·글꼴·둥글기는 :root 값만 바꾸면 전체가 바뀐다. 모듈은 여기 있는 클래스만 쓰고 자기 CSS를 만들지 않는다. */
@font-face {
  font-family: "Pretendard Variable";
  font-weight: 45 920;
  font-display: swap;
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
}

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --line: #dde2e8;
  --input-line: #7d8794;
  --ink: #18202b;
  --ink-2: #566170;
  --accent: #1f5fd1;
  --accent-ink: #ffffff;
  --accent-soft: #e6eefc;
  --ok: #17794b;
  --ok-soft: #e4f4ec;
  --warn: #8a5a00;
  --warn-soft: #fdf1d6;
  --bad: #b42318;
  --bad-soft: #fde8e6;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgb(24 32 43 / 6%), 0 6px 20px rgb(24 32 43 / 5%);
  --font: "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  --font-head: var(--font);
}

/* 글자 크기: 모든 치수가 rem이라 이 한 줄로 화면 전체가 커진다 */
html { font-size: 17px; color-scheme: light; }  /* 어두운 화면 설정에서도 스크롤 막대가 밝은 바탕에 맞게 나온다 */
html.fs-large { font-size: 19.5px; }
html.fs-xlarge { font-size: 22px; }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); line-height: 1.65; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.3; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; font-weight: 750; }
h2 { font-size: 1.22rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 10; background: var(--surface); padding: .6rem 1rem; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.nowrap { white-space: nowrap; }

/* ── 틀 ─────────────────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; min-height: 44px; font-weight: 800; font-size: 1.12rem; color: var(--ink); text-decoration: none; white-space: nowrap; flex: none; }
.top-right { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: flex-end; }
.top-right form { margin: 0; display: flex; gap: .4rem; align-items: center; }
.top-right a, .top-right .btn { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
.where { color: var(--ink-2); font-size: .92rem; }
.shell { display: grid; grid-template-columns: 15.5rem minmax(0, 1fr); min-height: calc(100vh - 3.6rem); }
.side {
  padding: 1.1rem .8rem 2rem; border-right: 1px solid var(--line); background: var(--surface);
  align-self: stretch;
}
.side h2 { font-size: .9rem; font-weight: 700; color: var(--ink-2); padding: 1rem .7rem .3rem; }
.side a {
  display: block; padding: .62rem .7rem; border-radius: var(--radius-s); color: var(--ink);
  text-decoration: none; font-weight: 550; min-height: 2.75rem;
}
.side a:hover { background: var(--surface-2); }
.side a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.main { padding: 1.9rem clamp(1rem, 3.5vw, 2.75rem) 4rem; max-width: 66rem; width: 100%; }
.main p, .solo p { max-width: 42rem; }
.main a:not(.btn):not(.card), .solo p > a:not(.btn), .list a:not(.btn), .table a:not(.btn) { display: inline-block; min-height: 44px; padding-block: max(0px, calc((44px - 1lh) / 2)); vertical-align: middle; }

@media (max-width: 860px) {
  .shell { display: block; }
  .side {
    display: flex; flex-wrap: wrap; gap: .35rem; padding: .55rem .75rem; border-right: 0; border-bottom: 1px solid var(--line);
    position: static; height: auto;
  }
  .side h2 { display: none; }
  .side a { white-space: nowrap; display: flex; align-items: center; background: var(--surface-2); }
  .main { padding-top: 1.3rem; }
  .top { padding: .55rem .9rem; flex-wrap: wrap; }
  .top-right { gap: .4rem; }
  .top .where { display: none; }
}

/* ── 묶음과 간격 ─────────────────────────────── */
.stack > * + * { margin-top: 1.15rem; }
.stack-s > * + * { margin-top: .55rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head p { color: var(--ink-2); margin-top: .45rem; max-width: 44rem; }
.row { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
/* 글자를 키우면 rem 칸이 화면보다 넓어질 수 있어서, 칸의 최소 너비가 화면을 넘지 않게 한다 */
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); }
.grid-3 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(14rem, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.4rem; box-shadow: var(--shadow); }
.card > h2 + *, .card > h3 + * { margin-top: .6rem; }
.tile { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); }
.tile .go { margin-top: auto; color: var(--accent); font-weight: 700; }

/* ── 버튼 ───────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.9rem; padding: .55rem 1.15rem; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.quiet { background: transparent; border-color: var(--input-line); }
.btn.small { min-height: max(44px, 2.4rem); padding: .3rem .8rem; font-size: .9rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.3rem; }
form.inline { display: inline; margin: 0; }

/* ── 입력 ───────────────────────────────────── */
.field { display: block; }
.field > span, .field > legend, .field > label { display: block; font-weight: 650; margin-bottom: .35rem; }
.field .hint { display: block; color: var(--ink-2); font-size: .9rem; margin-top: .3rem; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="month"],
input[type="url"], input[type="number"], input[type="file"], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--input-line); border-radius: var(--radius-s); padding: .65rem .8rem; min-height: 2.9rem;
}
input[type="file"]::file-selector-button { min-height: 44px; padding: .45rem .8rem; margin-right: .7rem; border: 1px solid var(--input-line); border-radius: var(--radius-s); background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; }
.password-field { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.password-field > input { flex: 1 1 12rem; min-width: 0; }
textarea { line-height: 1.6; resize: vertical; min-height: calc(8em + 1.3rem + 3px); field-sizing: content; }
textarea.short { min-height: calc(4.8em + 1.3rem + 3px); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--accent); outline-offset: 2px; }
fieldset { border: 0; padding: 0; margin: 0; }
.choice { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem .2rem; min-height: 2.75rem; cursor: pointer; }
.choice input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; accent-color: var(--accent); flex: none; }
.choices-row { display: flex; gap: .3rem 1.4rem; flex-wrap: wrap; }
.field .field-error { color: var(--bad); font-size: .9rem; margin-top: .3rem; }
.req { color: var(--bad); font-size: .9rem; font-weight: 650; }
.error-summary { border: 2px solid var(--bad); border-radius: var(--radius-s); background: var(--surface); padding: 1rem; margin-bottom: 1.15rem; }
.error-summary:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
[aria-invalid="true"] { border-color: var(--bad); }

/* ── 알림과 표시 ─────────────────────────────── */
.notice { border-radius: var(--radius-s); padding: .85rem 1.05rem; border: 1px solid transparent; }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.bad { background: var(--bad-soft); color: var(--bad); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.badge { display: inline-block; max-width: 100%; padding: .12rem .6rem; border-radius: 99rem; font-size: .9rem; font-weight: 700; white-space: normal; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.muted { background: var(--surface-2); color: var(--ink-2); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.empty { text-align: center; padding: 2.6rem 1.2rem; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty p { color: var(--ink-2); margin: .45rem auto 1.1rem; max-width: 30rem; }

/* ── 표와 목록 ───────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; min-width: 34rem; border-collapse: collapse; background: var(--surface); }
table.table.stack > * + * { margin-top: 0; }
.table th, .table td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .9rem; color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.table td:first-child { min-width: 9rem; }
.kv { display: grid; grid-template-columns: minmax(6.5rem, max-content) 1fr; gap: .4rem 1.1rem; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 0; }
.list.card { padding-inline: 1.4rem; }
.list > .row > div { flex: 1 1 18rem; min-width: 0; }
.list > .row > form, .list > .row > .btn { flex: 0 1 auto; max-width: 100%; }
.list h3 { overflow-wrap: anywhere; }
.list > li { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 1.2rem 2.9rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); font-weight: 750;
}
.steps > li.done::before { content: "끝냄"; content: "✓" / "끝냄"; background: var(--ok-soft); color: var(--ok); }
.steps > li.now::before { background: var(--accent); color: var(--accent-ink); }

@media (max-width: 600px) {
  table.table.stack { min-width: 0; display: block; }
  .table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table.stack tbody, .table.stack tr { display: block; width: 100%; }
  .table.stack tr { padding-block: .55rem; border-bottom: 1px solid var(--line); }
  .table.stack td { display: grid; grid-template-columns: minmax(0, 1fr); gap: .15rem; min-width: 0; border: 0; padding: .4rem .8rem; white-space: normal; }
  .table.stack td::before { content: attr(data-label); color: var(--ink-2); font-size: .9rem; font-weight: 700; }
  .table.stack td[data-label=""]::before { display: none; }
}

/* ── 검사 결과 ───────────────────────────────── */
.findings { list-style: none; padding: 0; margin: 0; }
.finding { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--warn); border-radius: var(--radius-s); padding: 1rem 1.15rem; }
.finding + .finding { margin-top: .75rem; }
.finding.leak { border-left-color: var(--bad); }
.finding .where { font-size: .9rem; color: var(--ink-2); font-weight: 700; }
.finding .what { display: block; font-size: 1.05rem; margin: .1rem 0 .3rem; }
.finding .why { color: var(--ink-2); }
.finding .fix { margin-top: .45rem; }
.finding .fix b { color: var(--ok); margin-right: .4rem; }
.finding .src { margin: .6rem 0 0; padding: .5rem .8rem; background: var(--surface-2); border-radius: 6px; font-size: .93rem; }
.doc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem 1.8rem; }
.doc h1 { font-size: 1.4rem; } .doc h2 { margin-top: 1.4rem; } .doc h3 { margin-top: 1.1rem; }
.doc p, .doc ul, .doc ol, .doc table { margin-top: .6rem; }
.doc table { border-collapse: collapse; } .doc th, .doc td { border: 1px solid var(--line); padding: .4rem .7rem; text-align: left; }
.copybox { white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius-s); padding: 1rem 1.1rem; font: inherit; margin: 0; }
blockquote { margin: 0; padding: .55rem .9rem; background: var(--surface-2); border-left: 4px solid var(--line); border-radius: 6px; }
details > summary { cursor: pointer; font-weight: 650; color: var(--accent); min-height: 2.4rem; display: flex; align-items: center; }
details[open] > summary { margin-bottom: .6rem; }
details.more > summary { min-height: max(48px, 2.85rem); }

/* ── 로그인 전 화면 ───────────────────────────── */
.solo { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.solo .card { width: min(27rem, 100%); }
.solo .brand { font-size: 1.35rem; margin-bottom: 1.2rem; }

/* ── 인쇄: PDF로 저장할 때 본문만 남긴다 ───────── */
.print-only { display: none; }
@media print {
  html { font-size: 12pt; }
  body { background: #fff; }
  .no-print, .top, .side, .actions { display: none !important; }
  .print-only { display: block; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
  .card, .doc, .finding { box-shadow: none; break-inside: avoid; }
}
