/* Knowledge lifecycle workspace shares the reviewed publication identity. */
#lifecycle{display:none;flex:1;min-height:0;overflow:auto;padding:20px 22px;font-size:var(--font-size-base)}
body.lifecycle-mode #sidebar,body.lifecycle-mode #composer-wrap,body.lifecycle-mode #chat,
body.lifecycle-mode #workbench,body.lifecycle-mode #newlaw,body.lifecycle-mode #chatlab,
body.lifecycle-mode #ontochat,body.lifecycle-mode #queue,body.lifecycle-mode #labeling,
body.lifecycle-mode #admin,body.lifecycle-mode #axioms,body.lifecycle-mode #currency{display:none!important}
body.lifecycle-mode #lifecycle{display:block}
#lifecycle [hidden]{display:none!important}
#lifecycle button,#lifecycle input,#lifecycle select,#lifecycle textarea{font:inherit}
#lifecycle button{border:1px solid var(--line);border-radius:9px;padding:8px 13px;background:var(--bg-card);color:var(--tx)}
#lifecycle button:hover{border-color:var(--accent)}
#lifecycle button:disabled{opacity:.5;cursor:default}
#lifecycle button.lc-primary{background:var(--accent);color:var(--accent-contrast);border-color:var(--accent)}
#lifecycle button.lc-nav-button{min-height:46px;padding:10px 17px;border-color:var(--accent);color:var(--accent);font-weight:650;cursor:pointer;}
#lifecycle button.lc-nav-button.lc-primary{color:var(--accent-contrast);}
#lifecycle button.lc-nav-button:focus-visible{outline:3px solid var(--accent);outline-offset:3px;}
.lc-head,.lc-row,.lc-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.lc-head{justify-content:space-between;margin-bottom:16px}
.lc-head h1{font-size:22px}.lc-muted{color:var(--tx-dim);overflow-wrap:anywhere}.lc-status{min-height:26px;margin:8px 0}.lc-status.error{color:var(--red)}
.lc-layout{display:grid;grid-template-columns:minmax(250px,310px) minmax(0,1fr);gap:20px;align-items:start}
.lc-list{display:grid;gap:10px;position:sticky;top:0;max-height:calc(100vh - 290px);overflow:auto}
#lifecycle .lc-item{text-align:left;display:grid;gap:7px;white-space:normal;overflow-wrap:anywhere}
#lifecycle .lc-item.selected{background:var(--accent-soft);border-color:var(--accent)}
.lc-item b{font-weight:650}.lc-item small{color:var(--tx-dim)}
.lc-content,.lc-card,.lc-section{min-width:0}.lc-card{padding:18px;border:1px solid var(--line);border-radius:12px;background:var(--bg-card);margin-bottom:14px}
.lc-card h2,.lc-card h3{font-size:var(--font-size-base);margin-bottom:10px}.lc-card p+p{margin-top:8px}
.lc-empty{padding:30px 20px;text-align:center;border:1px dashed var(--line);border-radius:12px;color:var(--tx-dim)}
.lc-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.lc-field{display:flex;flex-direction:column;gap:6px;min-width:0;margin-bottom:12px}
.lc-field>span{font-weight:600}.lc-field input,.lc-field select,.lc-field textarea{min-width:0;width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 11px;background:var(--bg-input);color:var(--tx)}
.lc-field textarea{resize:vertical;min-height:110px;line-height:1.65}.lc-field .lc-code{font-family:ui-monospace,Consolas,monospace;min-height:220px}
.lc-field input:focus,.lc-field textarea:focus,.lc-field select:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}
.lc-steps{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));list-style:none;gap:6px;padding:0;margin:14px 0 20px}
#lifecycle .lc-step{display:grid;gap:5px;width:100%;padding:10px 6px;height:100%;color:var(--tx-dim);font-size:var(--font-size-base)}
#lifecycle .lc-step.current{border-color:var(--accent);background:var(--accent-soft);color:var(--tx)}
.lc-step strong{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;background:var(--bg-chip);width:28px;height:28px;margin:auto;font-weight:600}
.lc-step.done strong{background:var(--green);color:#fff}.lc-chip{display:inline-flex;padding:2px 9px;border-radius:20px;background:var(--bg-chip);font-size:var(--font-size-base);color:var(--tx-dim)}
.lc-chip.ok{background:rgba(7,148,85,.1);color:var(--green)}.lc-chip.warn{background:var(--amber-bg);color:var(--amber)}
.lc-section>summary{cursor:pointer;font-weight:650;padding:5px 0}.lc-section[open]>summary{margin-bottom:14px}
.lc-source{white-space:pre-wrap;overflow-wrap:anywhere;max-height:360px;overflow:auto;padding:12px;border-radius:8px;background:var(--bg-soft)}
.lc-reasons{margin:8px 0 12px;padding-left:24px;color:var(--tx-dim)}.lc-reasons li+li{margin-top:5px}
.lc-timeline{list-style:none;padding:0}.lc-timeline li{padding:10px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}.lc-timeline time{color:var(--tx-dim)}
.lc-check{display:flex;gap:9px;align-items:flex-start;margin:10px 0}.lc-check input{margin-top:7px;width:18px;height:18px;flex:none}
.lc-issues{margin:12px 0;padding:12px 16px;border-radius:9px;background:var(--amber-bg)}.lc-issues ul{padding-left:22px}.lc-issues.ok{background:rgba(7,148,85,.08)}
.lc-comparison{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.lc-comparison h4{font-size:var(--font-size-base);margin-bottom:7px}
.lc-publish-box{border:1px solid var(--accent);background:var(--accent-soft);padding:16px;border-radius:10px;margin:12px 0}.lc-publish-box .lc-actions{margin-top:12px}
.lc-links{display:flex;flex-wrap:wrap;gap:12px}.lc-links a{color:var(--accent)}
@media(max-width:1150px){.lc-layout{grid-template-columns:1fr}.lc-list{position:static;grid-template-columns:repeat(2,minmax(0,1fr));max-height:280px}.lc-steps{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){#lifecycle{padding:14px 12px}.lc-grid,.lc-comparison,.lc-list{grid-template-columns:1fr}.lc-card{padding:13px}.lc-head h1{font-size:20px}.lc-steps{gap:5px}}



.lc-coverage-host,.lc-batches-host{min-width:0;margin-top:14px}
.lc-coverage-totals{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:16px 0}
.lc-coverage-totals>div{display:grid;gap:5px;border:1px solid var(--line);background:var(--bg-soft);border-radius:9px;padding:12px}
.lc-coverage-totals span{color:var(--tx-dim)}.lc-coverage-totals b{font-size:22px}
.lc-coverage-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(300px,1fr);gap:20px;align-items:start}
.lc-domain-table{max-width:100%;max-height:430px;overflow:auto;border:1px solid var(--line);border-radius:9px;margin-bottom:12px}
.lc-domain-table table{border-collapse:collapse;width:100%;white-space:nowrap}.lc-domain-table th,.lc-domain-table td{padding:10px 12px;text-align:left;border-bottom:1px solid var(--line)}
.lc-domain-table thead{position:sticky;top:0;background:var(--bg-soft);z-index:1}.lc-domain-table tbody tr.selected{background:var(--accent-soft)}.lc-domain-note{display:block;white-space:normal;font-weight:400;margin-top:5px}
#lifecycle .lc-domain-table button{padding:4px 7px;white-space:normal;min-width:135px;text-align:left}
.lc-batch-form{border:1px solid var(--line);border-radius:10px;padding:16px;background:var(--bg-soft);min-width:0}.lc-batch-form h3{margin-bottom:12px}
.lc-topic-list{max-height:270px;overflow:auto;margin:12px 0;border:1px solid var(--line);border-radius:9px;background:var(--bg-card);padding:8px}
.lc-topic-option{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:start;gap:9px;padding:9px 5px;cursor:pointer;border-bottom:1px solid var(--line)}
.lc-topic-option:last-child{border-bottom:none}.lc-topic-option input{width:18px;height:18px;margin-top:6px}.lc-topic-option span{overflow-wrap:anywhere}
.lc-batch-ai{margin-top:12px;padding:12px;border:1px solid var(--line);border-radius:8px;background:var(--bg-soft)}.lc-batch-ai .lc-actions{margin:10px 0}.lc-batch-error{color:var(--red);overflow-wrap:anywhere}.lc-batch-row>div{min-width:0;flex:1}
.lc-batch-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-bottom:1px solid var(--line)}
@media(max-width:1150px){.lc-coverage-totals{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:1280px){.lc-coverage-layout{grid-template-columns:1fr}.lc-domain-table{max-height:320px}}
@media(max-width:720px){.lc-coverage-totals{grid-template-columns:repeat(2,minmax(0,1fr))}.lc-topic-option{grid-template-columns:20px minmax(0,1fr)}.lc-topic-option>.lc-muted{grid-column:2}.lc-batch-row{align-items:stretch;flex-direction:column}}


.lc-workspace-intro{line-height:1.7;margin:0 0 16px}.lc-head h1{margin:0 0 7px;font-size:1.4em}
.lc-flow.lc-steps{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
#lifecycle .lc-flow .lc-step{display:flex;align-items:center;justify-content:center;gap:9px;min-height:58px;padding:10px}
.lc-flow .lc-step strong{margin:0;flex:none}.lc-flow li{min-width:0}
.lc-next{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;border:1px solid var(--accent);border-left-width:5px;border-radius:12px;background:var(--accent-soft);padding:20px;margin:16px 0}
.lc-next-copy{flex:1;min-width:210px}.lc-next h2,.lc-next h3{margin:0 0 8px}.lc-next p{line-height:1.7}.lc-next button{min-height:44px}
.lc-subnav{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}#lifecycle .lc-subnav .current{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.lc-inline-alert{border:1px solid var(--amber);border-radius:9px;padding:13px 16px;background:var(--amber-bg);line-height:1.7;margin:10px 0;overflow-wrap:anywhere}
.lc-handoff{border:1px solid var(--line);border-left:4px solid var(--amber);border-radius:10px;padding:16px;margin:16px 0;background:var(--bg-soft);line-height:1.7}
.lc-handoff.ready{border-left-color:var(--green)}.lc-handoff button{margin-top:10px}
.lc-admin-inbox{border:1px solid var(--line);border-radius:12px;background:var(--bg-card);padding:20px;margin:14px auto 20px;overflow-wrap:anywhere}
.lc-admin-inbox h2,.lc-admin-inbox h3{margin:0 0 8px;font-size:1.05em}.lc-admin-inbox p{line-height:1.65;margin:5px 0}
.lc-inbox-head,.lc-inbox-item{display:flex;justify-content:space-between;align-items:center;gap:18px}.lc-inbox-head>div,.lc-inbox-item>div{min-width:0}
.lc-inbox-items{max-height:340px;overflow:auto;margin:14px 0}.lc-inbox-item{border-top:1px solid var(--line);padding:14px 0}.lc-inbox-item .lc-actions{flex-shrink:0;max-width:340px}
@media(max-width:1150px){.lc-flow.lc-steps{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:720px){.lc-flow.lc-steps{grid-template-columns:1fr}.lc-inbox-head,.lc-inbox-item{align-items:stretch;flex-direction:column}.lc-admin-inbox{padding:14px}.lc-inbox-item .lc-actions{max-width:100%}}

.lc-list{display:block;max-height:none;overflow:visible}.lc-case-list{display:grid;gap:10px;max-height:56vh;overflow:auto;padding:3px}.lc-list .lc-field{margin-bottom:10px}.lc-list .lc-list-heading{margin:0 0 12px}
.lc-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:16px 0 12px}

.lc-summary>div{grid-template-columns:minmax(0,1fr) auto;align-items:center;min-height:80px}.lc-summary a{color:var(--accent);text-decoration:none}.lc-summary a:hover{text-decoration:underline}.lc-status:empty{display:none}.lc-summary-note{margin:3px 0 6px}

@media(max-width:1150px){.lc-case-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:220px}.lc-list-heading{grid-column:1/-1}}

@media(max-width:720px){.lc-case-list{grid-template-columns:1fr;max-height:210px}.lc-list .lc-grid{grid-template-columns:1fr}.lc-summary{grid-template-columns:repeat(2,minmax(0,1fr))}.lc-summary>div{grid-template-columns:1fr;min-height:80px}.lc-summary>div:last-of-type{grid-column:1/-1;grid-template-columns:minmax(0,1fr) auto;min-height:64px}}

/* ───────── UI 감사 2026-09-07 반영 ─────────
   1) 처리 결과·오류 한 줄이 긴 화면에서 스크롤 밖으로 사라지지 않게 상단 고정
   2) 카드 안 제목이 본문과 같은 13pt 라 굵기로만 나뉘던 문제 — 상대 배율로 4단계 위계
   3) 필수 입력 표시 · 제외한 조문 표시 · 완료한 단계 표시
   4) 로그인 바(.ax-mini)가 lifecycle 버튼 규칙에 덮여 입력칸과 높이가 어긋나던 문제 */

/* 1) 상태 줄 고정 — 스크롤 컨테이너(#lifecycle) 위쪽 여백은 헤더로 옮긴다 */
#lifecycle{padding-top:0}
#lifecycle>.lc-head{padding-top:20px}
@media(max-width:720px){#lifecycle>.lc-head{padding-top:14px}}
.lc-status{position:sticky;top:0;z-index:6;background:var(--bg);padding:7px 0;margin:6px 0}
.lc-status.error{color:var(--red);font-weight:600;border-bottom:1px solid var(--red)}
.lc-status.error::before{content:'⚠ '}

/* 2) 정보 위계 — 기본 글꼴 13pt 는 그대로 두고 상대 배율만 쓴다 */
.lc-head h2{font-size:1.25em;line-height:1.4}
.lc-workspace-intro>h2{font-size:1.15em}
.lc-next h3{font-size:1.15em}
.lc-editor>.lc-card>h2{font-size:1.1em;padding-bottom:8px;border-bottom:1px solid var(--line);margin-bottom:14px}
.lc-section>h3,.lc-batch-form>h3{font-size:1.02em}
.lc-head h2:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:6px}

/* 3-1) 필수 입력 표시 */
.lc-req{font-style:normal;font-weight:600;font-size:.85em;color:var(--red);margin-left:5px}

/* 3-2) 제외한 조문 — 지우지 않고 되돌릴 수 있게 표시만 한다 */
.lc-unit[data-removed]{border-style:dashed;border-color:var(--amber);background:var(--amber-bg)}
.lc-unit[data-removed]::before{content:'제외한 조문 — 저장하면 목록에서 빠집니다';display:block;color:var(--amber);font-weight:650;margin-bottom:10px}
.lc-unit[data-removed] input,.lc-unit[data-removed] textarea{text-decoration:line-through;opacity:.7}

/* 3-3) 끝난 단계 — 색만이 아니라 ✓ 와 글자로도. 밝은 테마의 --green 은 흰 글자 대비가
   3.9:1 이라 13pt 본문 기준(4.5:1)에 못 미친다 — 이 화면에서만 진한 초록을 쓴다 */
#lifecycle{--lc-done:#0a6b3d;--lc-done-tx:#fff}
[data-theme="dark"] #lifecycle{--lc-done:var(--green);--lc-done-tx:#0f1117}
#lifecycle .lc-step.done{border-color:var(--lc-done);color:var(--tx)}
#lifecycle .lc-step.done strong{background:var(--lc-done);color:var(--lc-done-tx)}
.lc-step-done-tx{color:var(--lc-done);font-size:.85em;margin-left:5px}

/* 3-4) 로딩·오류·빈 결과를 구분해 그린 자리 */
.lc-empty .lc-actions{justify-content:center;margin-top:12px}
.lc-case-list .state{padding:22px 12px}

/* 4) 로그인 바 버튼이 입력칸과 같은 높이가 되도록 공통 .ax-mini 규칙을 되돌린다 */
#lifecycle .ax-mini{padding:4px 10px;border-radius:8px;font-size:.92em;color:var(--tx-dim)}
#lifecycle .ax-mini:hover{background:var(--bg-hover);color:var(--tx)}
#lifecycle .ax-mini.on{color:var(--tx)}

/* 5) 다크 테마 주요 버튼 글자 대비 — --accent(#7c8cf8) 위 흰 글자는 3.0:1 로 AA 미달 */
[data-theme="dark"] #lifecycle button.lc-primary{color:#0f1117}

/* Keep the list and detail in one bounded row. Expanding supporting sections
   may scroll the page, but must never stretch the detail or pin the list over it. */
#lifecycle .lc-status{position:static}
.lc-coverage-layout>*{min-width:0}
@media(min-width:1151px){
  body.lifecycle-mode #lifecycle{display:flex;flex-direction:column}
  #lifecycle>*{flex-shrink:0}
  #lifecycle>.lc-layout{flex:1 0 420px;min-height:420px;align-items:stretch;grid-template-rows:minmax(0,1fr);margin-bottom:14px}
  .lc-layout>.lc-list,.lc-layout>.lc-content{min-width:0;min-height:0;border:1px solid var(--line);border-radius:12px;background:var(--bg-card);padding:14px}
  .lc-layout>.lc-list{position:static;display:flex;flex-direction:column;gap:0;max-height:none;overflow:hidden}
  .lc-list>:not(.lc-case-list){flex-shrink:0}
  .lc-layout .lc-case-list{flex:1;min-height:0;max-height:none;grid-template-columns:1fr;grid-auto-rows:max-content;align-content:start;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .lc-layout>.lc-content{overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
  .lc-content>.lc-card:last-child,.lc-content>.lc-empty:last-child{margin-bottom:0}
}
