/* Claude Code 權限設定產生器本頁樣式。
   嵌在 /workflows/claude-code-permissions-generator.html 的 article.post 裡(sitegen/perm_gen.py)。
   只用 site.css 的 token,深色主題跟著 token 自動反轉;class 一律 pg- 前綴。
   文章的 article.post p/li(優先權 0,1,2)會蓋掉單層 class,卡片內規則一律寫成 .pg .pg-xxx 兩層,li 明寫字級。 */
.pg {
  margin: 32px 0 40px;
}
.pg p,
.pg li {
  font-size: var(--fs-ui);
  line-height: 1.8;
}
.pg .pg-card {
  border-top: 2px solid var(--line-strong);
  padding: 20px 0 28px;
}
.pg .pg-card h3 {
  font-family: var(--font-h);
  font-size: var(--fs-h4);
  font-weight: 900;
  margin: 0 0 8px;
}
.pg .pg-card p {
  margin: 6px 0;
}
.pg .pg-card a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pg code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  overflow-wrap: anywhere;
}
.pg .pg-note,
.pg .pg-explain {
  color: var(--text-2);
}
.pg .pg-items,
.pg .pg-custom {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
}
.pg .pg-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px 0;
  margin: 0;
  border-top: 1px solid var(--line);
  font-size: inherit;
}
.pg .pg-item:first-child {
  border-top: 0;
}
.pg .pg-name {
  font-weight: 700;
}
.pg .pg-item .pg-explain,
.pg .pg-item .pg-rules {
  grid-column: 1 / -1;
  margin: 0;
}
.pg .pg-rules {
  font-size: var(--fs-meta);
  color: var(--text-2);
}
.pg select,
.pg input[type='text'] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  padding: 6px 8px;
  font: inherit;
  font-size: var(--fs-ui);
  min-width: 0;
  max-width: 100%;
}
.pg .pg-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 4px;
}
.pg .pg-add input[type='text'] {
  flex: 1 1 200px;
  font-family: var(--font-mono);
}
.pg .pg-msg:empty,
.pg .pg-conflict:empty {
  display: none;
}
.pg .pg-msg.pg-err,
.pg .pg-conflict {
  color: var(--accent-ink);
  font-weight: 700;
}
.pg .pg-custom li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin: 0;
  padding: 6px 0;
  font-size: inherit;
}
.pg .pg-tag {
  font-size: var(--fs-label);
  font-weight: 700;
  border: 1px solid var(--line-strong);
  padding: 0 6px;
}
.pg .pg-del {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-ink);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-meta);
}
.pg .pg-scopes {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pg .pg-scope {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  cursor: pointer;
}
.pg .pg-scope input {
  accent-color: var(--accent);
  margin-top: 0.45em;
}
.pg .pg-scope span {
  grid-column: 2;
  color: var(--text-2);
  font-size: var(--fs-meta);
  line-height: 1.7;
}
.pg .pg-out pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: var(--fs-meta);
  line-height: 1.6;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 12px 14px;
  margin: 8px 0 10px;
  max-height: 420px;
  overflow: auto;
}
.pg .pg-out pre code {
  font-size: inherit;
}
/* 線上工具頁(article.tool-page,2026-11-27):1180px 以上(工具區往右伸,最寬 1024)勾選在左、
   產出的設定在右並跟著捲動,改哪一項都看得到 JSON 變化。窄螢幕維持原本由上往下。
   黏住的位置讓開頂欄(--nav-h),面板超過一個畫面高時在面板裡捲,複製鈕才不會掉到畫面外。 */
@media (min-width: 1180px) {
  .tool-page .pg {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    column-gap: 40px;
    align-items: start;
  }
  .tool-page .pg > * {
    grid-column: 1;
  }
  .tool-page .pg > .pg-out {
    grid-column: 2;
    grid-row: 1 / span 20;
    position: sticky;
    top: calc(var(--nav-h, 64px) + 16px);
    max-height: calc(100vh - var(--nav-h, 64px) - 32px);
    overflow: auto;
  }
}
