/* 合約範本（kit.css 之上只加版面）；.ct-doc 是範本原文，填寫頁、列印、回簽頁共用 */
.ct-top { padding-bottom: 4px; }
.ct-grid { max-width: 1180px; margin: 0 auto; }
.ct-box { border: 0; margin: 0 0 14px; padding: 0; min-width: 0; }
.ct-box > legend { float: left; width: 100%; font: 800 1.12rem/1.3 var(--font-head); padding: 0; margin: 0 0 10px; }
.ct-box > legend + * { clear: both; }

/* 選範本：一張一卡，選中深藍框 */
.ct-picks { display: grid; gap: 8px; }
.ct-pick { position: relative; display: block; cursor: pointer; }
.ct-pick input { position: absolute; opacity: 0; pointer-events: none; }
.ct-pick-in { display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--card); }
.ct-pick-in b { font-size: 1rem; color: var(--ink); }
.ct-pick-in span { font-size: .88rem; color: var(--ink); }
.ct-pick-in small { font-size: .8rem; color: var(--ink-soft); }
.ct-pick input:checked + .ct-pick-in { border-color: var(--band); box-shadow: inset 0 0 0 1px var(--band); background: var(--accent-soft); }
.ct-pick input:focus-visible + .ct-pick-in { outline: 3px solid var(--band); outline-offset: 2px; }

/* 範本來源 */
.ct-source { padding: 6px 0 6px 14px; margin-top: 6px; border-left: 3px solid var(--band); background: none; }   /* 範本說明是「目前選的這份」的註記，不做成卡片（分數表第二輪：灰底卡看起來像第 4 個選項） */
.ct-src-who { margin: 0 0 8px; font-weight: 400; font-size: .9rem; color: var(--ink-soft); line-height: 1.6; }   /* 上面選項卡已經有範本名，這裡只當補充說明，不再粗體一次（分數表第三輪：同一件事寫兩次） */
.ct-src-dl { margin: 0; display: grid; gap: 6px; font-size: .86rem; }
.ct-src-dl div { display: grid; grid-template-columns: 4.5em 1fr; gap: 8px; }
.ct-src-dl dt { color: var(--ink-soft); }
.ct-src-dl dd { margin: 0; color: var(--ink); }
.ct-src-dl a { color: var(--accent); }
.ct-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 10px; }

/* 文件：原文的換行、縮排照留 */
.ct-out { padding-top: 0; }
.ct-hint { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--paper); font-size: .9rem; color: var(--ink); }
.ct-paper, .ct-paper-doc { background: #fff; color: #1b2430; border-radius: 6px; box-shadow: var(--shadow); padding: 26px 22px; }
.ct-doc { white-space: pre-wrap; overflow-wrap: anywhere; font: 400 15px/2 var(--font-body); tab-size: 4; }
.ct-doc .ct-h { font: 900 1.3em/1.5 var(--font-head); color: var(--band); display: inline-block; margin-top: .5em; }   /* 章名比條文大一階、上面多留空（分數表第三輪：只大 2px）；（engine.js renderDoc 包的）；列印也照印 */
/* 條文裡的空格：行內輸入框（蓋掉 kit 的全寬表單輸入框樣式，選擇器要比 input[type=text] 更具體） */
.ct-doc input.ct-fill[type=text] { display: inline-block; width: auto; min-width: 0; max-width: 100%; height: auto; min-height: 0; margin: 0 2px; padding: 0 6px; vertical-align: baseline; font: inherit; font-size: 16px; line-height: 1.7; color: var(--band); background: #EEF4FA; border: 0; border-bottom: 2px solid var(--band); border-radius: 4px 4px 0 0; box-shadow: none; }
.ct-doc input.ct-fill[type=text]::placeholder { color: #5B6B7D; }
.ct-doc input.ct-fill[type=text]:focus { background: #fff; box-shadow: 0 0 0 2px var(--band); }
.ct-doc input.ct-fill.ct-line[type=text] { max-width: min(100%, 30em); }
input.ct-check { width: 20px; height: 20px; margin: 0 6px 0 10px;   /* 左邊多留 10px：勾選框不再貼著前一個選項的字（分數表第二輪） */
  vertical-align: -4px; accent-color: var(--band); }
.ct-val { color: #1b2430; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.ct-blank { color: #1b2430; }
.ct-mark { font-family: var(--font-body); }
.ct-attr { margin: 22px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: .78rem; line-height: 1.7; color: var(--ink-soft); }
.ct-src { margin: 6px 0 0; font-size: .78rem; line-height: 1.7; color: var(--ink-soft); }
.ct-src a { color: var(--accent); }
.ct-free { margin: 10px 0 0; font-size: .78rem; color: var(--ink-soft); }
.ct-frozen { margin: 0; }

/* 回簽紀錄（回簽頁與列印共用） */
.ct-record { margin: 22px 0 0; padding: 14px 16px; border: 1.5px solid var(--band); border-radius: var(--radius-sm); background: var(--paper); }
.ct-record h3 { margin: 0 0 6px; font: 800 1rem var(--font-head); }
.ct-record p { margin: 4px 0; font-size: .9rem; line-height: 1.7; }
.ct-digest code { font-size: .74rem; overflow-wrap: anywhere; }

/* 付費區（同報價單） */
.ct-pro { margin-top: 18px; }
.ct-pro h2 { font: 800 1.1rem var(--font-head); margin: 0 0 10px; }
.ct-pro h3 { font: 700 .98rem var(--font-body); margin: 18px 0 8px; }
.ct-pro-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.ct-tease { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.ct-tease a { color: var(--accent); font-weight: 700; }
.ct-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ct-list li { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ct-list .t { margin: 0; font-weight: 700; }
.ct-list .s, .ct-list .m { margin: 2px 0; font-size: .84rem; color: var(--ink-soft); }
.ct-list .st-signed .s { color: var(--ok); font-weight: 700; }
.ct-list .b { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ct-newlink { margin: 10px 0; padding: 12px; border-radius: var(--radius-sm); background: var(--ok-bg); }
.ct-newlink input { width: 100%; margin: 6px 0; }

/* 回簽頁 */
.cs-wrap { max-width: 860px; }
.cs-who { margin: 0 0 12px; font-weight: 700; }
.cs-actions { margin: 14px 0; }
.cs-form { margin-top: 18px; padding: 18px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.cs-form h2 { font: 800 1.1rem var(--font-head); margin: 0 0 12px; }
.cs-agree { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 14px; font-weight: 700; }
.cs-agree input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--band); }
.cs-done { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok); font-weight: 700; }

@media (max-width: 959px) {
  /* 手機：範本卡只留短標題與機關，完整名稱與版本在下面的來源框 */
  .ct-pick-in span, .ct-pick-in small { display: none; }
  .ct-pick-in { padding: 10px 12px; }
  .ct-pick-in b::after { content: attr(data-agency); display: block; font-weight: 400; font-size: .8rem; color: var(--ink-soft); }
}
@media (max-width: 600px) {
  .ct-paper, .ct-paper-doc { padding: 18px 14px; }
  .ct-doc { font-size: 14.5px; tab-size: 2; }
}
@media print {
  @page { size: A4; margin: 14mm; }
  .ct-top, .ct-side, .ct-hint, #ct-paper, .cs-who, .cs-actions, .cs-form, .cs-done, .cs-disclaim { display: none !important; }
  .ct-grid { display: block !important; }
  .ct-out { padding: 0 !important; box-shadow: none !important; background: none !important; }
  .ct-paper-doc { box-shadow: none; padding: 0; }
  .ct-doc { font-size: 11.5pt; line-height: 1.85; }
}
/* 依章摺疊（填寫頁；engine.js renderDoc edit 模式）：桌機全部展開、章名看起來就是標題；手機收起第一章以外的章，點章名打開。列印用 #ct-print，不受影響 */
.ct-doc .ct-fold { all: unset; font: 900 1.3em/1.5 var(--font-head); color: var(--band); cursor: default; display: inline-block; margin-top: .5em; }
@media (max-width: 959px) {
  .ct-doc .ct-fold { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
  .ct-doc .ct-fold::after { content: '▸'; font-size: .8em; transition: transform .15s; }
  .ct-doc .ct-fold[aria-expanded="true"]::after { transform: rotate(90deg); }
  .ct-doc .ct-fold:focus-visible { outline: 2px solid var(--band); outline-offset: 2px; border-radius: 4px; }
  .ct-doc .ct-body:not(.open) { display: none; }
}
.ct-doc .ct-opt { white-space: nowrap; }   /* 勾選框＋選項名不拆開（engine.js renderDoc） */

/* 萬用輸入（Atlas 10/18）：講一句或貼 LINE 對話就填好範本；自己選範本收進下面這格（跟 severance「核對我聽到的」同一個做法） */
#ct-un { margin-bottom: 14px; }
#ct-un:empty { min-height: 276px; }
@media (min-width: 960px) { #ct-un:empty { min-height: 264px; } }
.ct-check { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.ct-check > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; font-weight: 700; color: var(--band); }
.ct-check > summary::-webkit-details-marker { display: none; }
.ct-check > summary::after { content: "＋"; font-weight: 900; }
.ct-check[open] > summary::after { content: "－"; }
.ct-check .ct-picks { padding: 0 12px 12px; }

/* 分期補充約定（Atlas 10/18，annex.js）：主約後面另起一頁；報酬那條旁邊的註記用琥珀小字，看得出是標示不是條文 */
.ct-annex { margin-top: 28px; padding-top: 22px; border-top: 2px dashed var(--line-strong); }
.ct-annex-fine { margin: 10px 0 0; font-size: .82rem; color: var(--ink-soft); }
.ct-annot { display: inline-block; margin: 0 .3em; padding: 0 .4em; border-radius: 6px; background: #FBEBD2; color: #6b3d00; font-size: .85em; font-weight: 700; }
@media print { .ct-annex { break-before: page; border-top: 0; margin-top: 0; padding-top: 0; } .ct-annot { background: none; border: 1px solid #999; color: #000; } }
