/* 指標資料庫卡片與通用指標詳細頁；色彩沿用現有儀表板 */

/* ---------- 儀表板卡片 ---------- */
.ph-wh-group-title {
  font-size: 20px;
  font-weight: 700;
  color: #25313A;
  margin: 32px 0 12px;
  padding-left: 10px;
  border-left: 4px solid #0072B2;
}
.ph-wh-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  width: 100%;
  min-width: 0;
}
.ph-wh-card {
  display: flex;
  flex-direction: column;
  background: #FFFFFF;
  border: 1px solid #DCE3E7;
  border-radius: 18px;
  padding: 18px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.ph-wh-card:hover,
.ph-wh-card:focus-visible {
  border-color: #0072B2;
  box-shadow: 0 6px 18px rgba(0, 114, 178, .10);
  transform: translateY(-1px);
}
.ph-wh-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.ph-wh-card-name { font-size: 18px; font-weight: 700; color: #25313A; line-height: 1.35; }
.ph-wh-card-sub { font-size: 15px; color: #7C8891; line-height: 1.35; margin-top: 2px; }
.ph-wh-chip {
  font-size: 15px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ph-wh-change { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; min-width: 0; }
.ph-wh-change-label { font-size: 14px; color: #7C8891; }
.ph-wh-change .ph-wh-chip { white-space: normal; }
.ph-wh-card-value { display: flex; align-items: flex-end; gap: 6px; margin-top: 14px; min-width: 0; }
.ph-wh-num {
  font-family: 'Chiron GoRound TC', sans-serif;
  font-size: 34px;
  font-weight: 700;
  color: #25313A;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.ph-wh-unit { font-size: 16px; color: #7C8891; margin-bottom: 3px; }
.ph-wh-spark { width: 100%; height: 34px; margin-top: 12px; overflow: visible; }
.ph-wh-spark--empty { border-bottom: 1px dashed #E8ECEE; height: 22px; }
.ph-wh-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #E8ECEE;
  font-size: 15px;
  color: #64717A;
}
.ph-wh-card .ph-wh-spark, .ph-wh-card .ph-wh-spark--empty { margin-bottom: 12px; }
.ph-wh-cta { font-weight: 700; color: #0072B2; white-space: nowrap; }
.ph-wh-card-src { font-size: 13px; color: #92A0A8; margin-top: 6px; }

/* 我的縣市 / 全國 切換 */
.ph-wh-region-switch { display: inline-flex; gap: 4px; padding: 4px; margin-top: 8px; border-radius: 999px; background: #EEF2F4; }
.ph-wh-region-switch a { padding: 6px 16px; border-radius: 999px; font-size: 15px; font-weight: 600; color: #4A5963; text-decoration: none; }
.ph-wh-region-switch a.is-current { background: #FFFFFF; color: #0072B2; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.ph-wh-region-switch a:focus-visible { outline: 2px solid #0072B2; outline-offset: 2px; }
.ph-wh-region-note { margin: 8px 0 0; font-size: 14px; color: #7C8891; }
.ph-wh-region-tag { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; color: #7C8891; background: #EEF2F4; vertical-align: middle; }

/* ---------- 指標詳細頁 ---------- */
.ph-ind-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 20px; }
.ph-ind-badge {
  font-size: 15px;
  color: #64717A;
  background: #F2ECE0;
  padding: 4px 11px;
  border-radius: 999px;
}
.ph-ind-badge--blue { color: #1C6EA4; background: #E9F5FC; font-weight: 700; }
.ph-ind-badge--green { color: #00785A; background: #E4F1EC; }
.ph-ind-def { font-size: 17px; line-height: 1.7; color: #4A565F; margin: 0 0 8px; max-width: 900px; }

.ph-ind-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: flex-end;
  background: #F7FAFB;
  border: 1px solid #DCE3E7;
  border-radius: 16px;
  padding: 14px 16px;
  margin: 18px 0;
}
.ph-ind-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 0 1 220px; }
.ph-ind-field label { font-size: 14px; font-weight: 700; color: #64717A; }
.ph-ind-field select {
  font: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border: 1px solid #C9D3D9;
  border-radius: 10px;
  background: #FFFFFF;
  color: #25313A;
  min-width: 0;
  max-width: 100%;
}
.ph-ind-field select:focus-visible { outline: 2px solid #0072B2; outline-offset: 1px; }

.ph-ind-panel {
  background: #FFFFFF;
  border: 1px solid #DCE3E7;
  border-radius: 20px;
  padding: 20px 20px 12px;
  margin-bottom: 20px;
  min-width: 0;
  overflow: hidden;
}
.ph-ind-panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ph-ind-panel-title { font-size: 20px; font-weight: 700; color: #25313A; margin: 0; }
.ph-ind-panel-note { font-size: 14px; color: #7C8891; }
.ph-ind-chart { width: 100%; height: 360px; margin-top: 8px; }
.ph-ind-chart--tall { height: 560px; }
.ph-ind-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  color: #7C8891;
  font-size: 16px;
  text-align: center;
  padding: 16px;
}
.ph-ind-latest { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 6px 0 4px; }
.ph-ind-latest-item { min-width: 0; }
.ph-ind-latest-label { font-size: 14px; color: #7C8891; }
.ph-ind-latest-value { font-size: 26px; font-weight: 700; color: #25313A; font-variant-numeric: tabular-nums; }
.ph-ind-error { color: #B23A48; background: #FBEDEF; border-radius: 12px; padding: 12px 14px; }

@media (max-width: 640px) {
  .ph-ind-field { flex: 1 1 100%; }
  .ph-ind-chart { height: 300px; }
  .ph-ind-chart--tall { height: 520px; }
  .ph-wh-num { font-size: 30px; }
}

/* ---------- 指標頁：AI 解讀 ---------- */
.ph-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.ph-ai { padding-bottom: 16px; }
.ph-ai-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 14px 0 4px; }
.ph-ai-audience { display: inline-flex; background: #EDF3F5; border-radius: 12px; padding: 4px; gap: 4px; }
.ph-ai-aud {
  border: none; border-radius: 9px; padding: 7px 14px; background: transparent;
  font: inherit; font-size: 16px; font-weight: 700; color: #64717A; cursor: pointer;
}
.ph-ai-aud.is-active { background: #FFFFFF; color: #0072B2; box-shadow: 0 1px 4px rgba(37, 49, 58, 0.12); }
.ph-ai-go, .ph-ai-ask button {
  border: none; border-radius: 12px; padding: 9px 18px;
  background: #0072B2; color: #FFFFFF; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
}
.ph-ai-go:hover, .ph-ai-ask button:hover { background: #005A8C; }
.ph-ai-go:disabled, .ph-ai-ask button:disabled, .ph-ai-chip:disabled { opacity: 0.5; cursor: not-allowed; }
.ph-ai-aud:focus-visible, .ph-ai-go:focus-visible, .ph-ai-chip:focus-visible,
.ph-ai-ask button:focus-visible, .ph-ai-ask input:focus-visible { outline: 2px solid #0072B2; outline-offset: 2px; }
.ph-ai-off { margin-top: 12px; color: #9A6200; background: #FDF3E1; border-radius: 12px; padding: 12px 14px; font-size: 15px; }
.ph-ai-log { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.ph-ai-log:empty { display: none; }
.ph-ai-msg { border-radius: 14px; padding: 14px 16px; font-size: 16px; line-height: 1.75; color: #25313A; min-width: 0; overflow-wrap: anywhere; }
.ph-ai-msg--bot { background: #F2F8FB; border: 1px solid #D6E8F2; }
.ph-ai-msg--user { background: #FFFFFF; border: 1px solid #DCE3E7; align-self: flex-end; max-width: 85%; color: #4A565F; }
.ph-ai-msg--error { background: #FBEDEF; border: 1px solid #F1CBD1; color: #B23A48; }
.ph-ai-msg--pending { color: #7C8891; }
.ph-ai-msg p { margin: 0 0 8px; }
.ph-ai-msg p:last-child { margin-bottom: 0; }
.ph-ai-msg-head { font-size: 13px; font-weight: 700; color: #009E73; margin-bottom: 6px; }
.ph-ai-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ph-ai-chip {
  border: 1px solid #BFDCD3; background: #E4F1EC; color: #0B6E54; border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 15px; cursor: pointer;
}
.ph-ai-chip:hover { background: #D3EAE1; }
.ph-ai-ask { display: flex; gap: 8px; margin-top: 12px; }
.ph-ai-ask input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px;
  border: 1px solid #C9D3D9; border-radius: 12px; color: #25313A; background: #FFFFFF;
}
.ph-ai-note { font-size: 13px; color: #7C8891; margin: 10px 0 0; line-height: 1.6; }
@media (max-width: 640px) {
  .ph-ai-toolbar { align-items: stretch; }
  .ph-ai-audience, .ph-ai-go { flex: 1 1 100%; }
  .ph-ai-aud { flex: 1 1 50%; }
  .ph-ai-msg--user { max-width: 100%; }
}

/* hidden 屬性要蓋過上面的 display 設定 */
#ph-indicator [hidden] { display: none !important; }

/* 平台簡介：尚未完成的目標標籤 */
.ph-about-wip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: #FDF3E1;
  color: #9A6200;
  font-size: 14px;
  font-weight: 700;
  vertical-align: 2px;
}
.ph-about-goals li:nth-child(4) { border-left-color: #E69F00; }
.ph-about-goals li:nth-child(5) { border-left-color: #CC79A7; }
.ph-about-goals li:nth-child(6) { border-left-color: #92A0A8; }

/* ---------- 後台管理 ---------- */
#ph-admin [hidden] { display: none !important; }
.ph-adm-tabs { display: flex; gap: 6px; border-bottom: 1px solid #DCE3E7; margin: 8px 0 20px; flex-wrap: wrap; }
.ph-adm-tab {
  border: none; background: none; padding: 10px 14px; margin-bottom: -1px;
  font: inherit; font-size: 18px; font-weight: 700; color: #7C8891; cursor: pointer;
  border-bottom: 2.5px solid transparent;
}
.ph-adm-tab.is-active { color: #0072B2; border-bottom-color: #0072B2; }
.ph-adm-tab:focus-visible { outline: 2px solid #0072B2; outline-offset: 2px; border-radius: 6px; }
.ph-adm-hint { font-size: 15px; color: #7C8891; line-height: 1.6; margin: 10px 0 14px; }

.ph-adm-summary { display: flex; gap: 12px; flex-wrap: wrap; }
.ph-adm-stat {
  display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; border-radius: 14px;
  border: 1px solid #DCE3E7; background: #FFFFFF; font-size: 15px; color: #4A565F; min-width: 140px;
}
.ph-adm-stat-n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ph-adm-stat--danger .ph-adm-stat-n { color: #B23A48; }
.ph-adm-stat--warn .ph-adm-stat-n { color: #9A6200; }
.ph-adm-stat--ok .ph-adm-stat-n { color: #00785A; }
.ph-adm-stat--muted .ph-adm-stat-n { color: #7C8891; }

.ph-adm-table-wrap { overflow-x: auto; border: 1px solid #DCE3E7; border-radius: 16px; background: #FFFFFF; }
.ph-adm-table { width: 100%; border-collapse: collapse; font-size: 15px; color: #25313A; }
.ph-adm-table th {
  text-align: left; font-size: 14px; color: #64717A; font-weight: 700; background: #F7FAFB;
  padding: 10px 12px; border-bottom: 1px solid #DCE3E7; white-space: nowrap;
}
.ph-adm-table td { padding: 10px 12px; border-bottom: 1px solid #EEF1F3; vertical-align: top; }
.ph-adm-table tr:last-child td { border-bottom: none; }
.ph-adm-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ph-adm-row { cursor: pointer; }
.ph-adm-row:hover td, .ph-adm-row:focus-visible td { background: #F4F9FC; }
.ph-adm-row:focus-visible { outline: 2px solid #0072B2; outline-offset: -2px; }
.ph-adm-name { font-weight: 700; }
.ph-adm-sub { font-size: 13px; color: #7C8891; margin-top: 2px; }
.ph-adm-reason { color: #4A565F; min-width: 220px; overflow-wrap: anywhere; }
.ph-adm-empty { text-align: center; color: #7C8891; padding: 28px 12px !important; }

.ph-adm-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.ph-adm-badge--danger { background: #FBEDEF; color: #B23A48; }
.ph-adm-badge--warn { background: #FDF3E1; color: #9A6200; }
.ph-adm-badge--ok { background: #E4F1EC; color: #00785A; }
.ph-adm-badge--muted { background: #EEF1F3; color: #64717A; }
.ph-adm-badge--admin { background: #E3F0F8; color: #005A8C; }
.ph-adm-temp-pwd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-adm-temp-pwd code {
  font-size: 22px; letter-spacing: .08em; padding: 8px 14px; border-radius: 10px;
  background: #EDF3F5; color: #25313A; user-select: all;
}
.ph-adm-user-actions { display: flex; flex-wrap: wrap; gap: 6px 8px; }
/* 使用者管理的操作按鈕：同一尺寸的外框按鈕，停用用紅色、核准／啟用用實心藍色 */
.ph-adm-act {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 12px; min-height: 32px; box-sizing: border-box;
  border: 1px solid #C9D6DE; border-radius: 8px; background: #FFFFFF;
  font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; color: #0072B2;
  white-space: nowrap; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.ph-adm-act:hover { background: #E3F0F8; border-color: #0072B2; }
.ph-adm-act:focus-visible { outline: 2px solid #0072B2; outline-offset: 2px; }
.ph-adm-act:disabled { opacity: .45; cursor: not-allowed; }
.ph-adm-act--danger { color: #B23A48; border-color: #E8C4CA; }
.ph-adm-act--danger:hover { background: #FBEDEF; border-color: #B23A48; }
.ph-adm-act--primary { background: #0072B2; border-color: #0072B2; color: #FFFFFF; }
.ph-adm-act--primary:hover { background: #005A8C; border-color: #005A8C; }
.ph-adm-table tr.is-disabled td { color: #92A0A8; }
.ph-adm-count {
  display: inline-block; min-width: 22px; padding: 0 7px; margin-left: 4px; border-radius: 999px;
  background: #B23A48; color: #fff; font-size: 14px; line-height: 22px; text-align: center;
}
.ph-adm-message { white-space: pre-wrap; word-break: break-word; max-width: 46em; }
.ph-adm-detail { font-size: 14px; color: #64717A; word-break: break-all; max-width: 32em; }

.ph-adm-history > td { background: #F7FAFB; padding: 12px 16px !important; }
.ph-adm-subtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ph-adm-subtable th, .ph-adm-subtable td { padding: 6px 8px; border-bottom: 1px solid #E6EEF2; text-align: left; }
.ph-adm-subtable .num { text-align: right; }
.ph-adm-subtable tr.is-failed td { color: #B23A48; }

.ph-adm-filters { display: flex; gap: 12px 16px; flex-wrap: wrap; align-items: flex-end; }
.ph-adm-filters input, .ph-adm-form-grid input, .ph-adm-form-grid textarea {
  font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #C9D3D9; border-radius: 10px;
  background: #FFFFFF; color: #25313A; min-width: 0; width: 100%; box-sizing: border-box;
}
.ph-adm-form-grid textarea { resize: vertical; line-height: 1.6; }

.ph-adm-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.ph-adm-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.ph-adm-switch span { position: absolute; inset: 0; border-radius: 999px; background: #C9D3D9; transition: background .15s; }
.ph-adm-switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #FFFFFF; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s;
}
.ph-adm-switch input:checked + span { background: #009E73; }
.ph-adm-switch input:checked + span::after { transform: translateX(18px); }
.ph-adm-switch input:disabled { cursor: not-allowed; }
.ph-adm-switch input:disabled + span { opacity: .45; }
.ph-adm-switch input:focus-visible + span { outline: 2px solid #0072B2; outline-offset: 2px; }

.ph-adm-dialog {
  border: none; border-radius: 20px; padding: 24px; width: min(720px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(37, 49, 58, .25); color: #25313A;
}
.ph-adm-dialog::backdrop { background: rgba(37, 49, 58, .35); }
.ph-adm-dialog h2 { margin: 0; font-size: 22px; }
.ph-adm-code { margin: 4px 0 16px; color: #7C8891; font-size: 14px; }
.ph-adm-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.ph-adm-form-grid .ph-ind-field { flex: none; }
.ph-adm-wide { grid-column: 1 / -1; }
.ph-adm-check { justify-content: flex-end; padding-bottom: 8px; }
.ph-adm-check label { font-size: 16px; font-weight: 400; color: #25313A; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ph-adm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

@media (max-width: 640px) {
  .ph-adm-form-grid { grid-template-columns: 1fr; }
  .ph-adm-stat { min-width: 0; flex: 1 1 40%; }
}
.ph-adm-table .nowrap { white-space: nowrap; }

/* 窄螢幕：分頁列改成可左右滑動的單列，不換行 */
@media (max-width: 599px) {
  .ph-adm-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .ph-adm-tabs::-webkit-scrollbar { display: none; }
  .ph-adm-tab { flex: 0 0 auto; white-space: nowrap; font-size: 16px; padding: 10px 12px; }
}

/* 意見回饋：回覆內容與回覆對話框 */
.ph-adm-reply { margin-top: 10px; padding: 8px 12px; border-left: 3px solid #009E73; background: #F2F8F5; border-radius: 0 10px 10px 0; max-width: 46em; }
.ph-adm-reply-head { font-size: 13px; color: #3E7F66; font-weight: 700; margin-bottom: 4px; }
.ph-adm-row-actions { white-space: nowrap; }
.ph-adm-row-actions .ph-btn-link { display: block; margin-bottom: 4px; }
.ph-adm-quote { white-space: pre-wrap; word-break: break-word; background: #F7FAFB; border: 1px solid #E8ECEE; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; max-height: 180px; overflow: auto; font-size: 15px; color: #445059; }
.ph-adm-dialog textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #DCE3E7; border-radius: 10px; resize: vertical; }
.ph-adm-dialog .ph-adm-actions a.ph-btn-secondary { text-decoration: none; margin-right: auto; display: inline-flex; align-items: center; }

/* ---------- 儀表板快速導覽：類別跳轉＋指標篩選（dashboard-nav.js 會把 top 設成頁首高度） ---------- */
.ph-wh-quicknav {
  position: sticky;
  top: var(--ph-wh-nav-top, 72px);
  z-index: 30;
  margin: 16px 0 0;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #DCE3E7;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(37, 49, 58, 0.06);
}
.ph-wh-quicknav-search { display: flex; align-items: center; gap: 8px; flex: 0 1 260px; min-width: 0; }
.ph-wh-quicknav-search input {
  width: 100%;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #C9D3D9;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  color: #25313A;
  background: #F7FAFB;
}
.ph-wh-quicknav-search input:focus { outline: 2px solid #0072B2; outline-offset: 1px; background: #FFFFFF; }
.ph-wh-quicknav-count { font-size: 13px; color: #7C8891; white-space: nowrap; }
.ph-wh-quicknav-count:empty { display: none; }
.ph-wh-quicknav-cats { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 400px; min-width: 0; }
.ph-wh-quicknav-cats a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #4A5963;
  background: #EEF2F4;
  text-decoration: none;
  white-space: nowrap;
}
.ph-wh-quicknav-cats a:hover { background: #E1EAEF; color: #0072B2; }
.ph-wh-quicknav-cats a.is-current { background: #0072B2; color: #FFFFFF; }
.ph-wh-quicknav-cats a:focus-visible { outline: 2px solid #0072B2; outline-offset: 2px; }
.ph-wh-quicknav-cats a.is-empty { opacity: 0.4; }
.ph-wh-quicknav-n { font-size: 12px; font-weight: 500; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.7); color: inherit; }
.ph-wh-quicknav-cats a.is-current .ph-wh-quicknav-n { background: rgba(255, 255, 255, 0.25); }
.ph-wh-group-title { scroll-margin-top: var(--ph-wh-anchor-offset, 150px); }
.ph-wh-filter-empty { margin: 24px 0; color: #7C8891; font-size: 15px; }
@media (max-width: 640px) {
  .ph-wh-quicknav { padding: 8px; border-radius: 12px; }
  .ph-wh-quicknav-search { flex: 1 1 100%; }
  /* 手機：類別改成單行左右滑動，避免導覽列佔掉太多畫面 */
  .ph-wh-quicknav-cats { flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ph-wh-quicknav-cats::-webkit-scrollbar { display: none; }
}
/* 篩選用 class 隱藏（頁面渲染時 hidden 屬性會被清掉，且 .ph-wh-card 的 display:flex 會蓋過它） */
.ph-wh-card.is-filtered-out, .ph-wh-group.is-filtered-out { display: none !important; }
.ph-wh-filter-empty:not(.is-visible) { display: none; }

/* ===== 提案與覆議（proposals.jsp） ===== */
#ph-proposals [hidden] { display: none !important; }
.ph-pp-error { margin: 12px 0; }
.ph-pp-toolbar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "tabs cta" "filters filters";
  align-items: center; gap: 14px 20px; margin: 20px 0 12px;
  background: #FFFFFF; border: 1px solid #DCE3E7; border-radius: 16px; padding: 16px 20px;
}
.ph-pp-tabs { display: inline-flex; flex-wrap: wrap; background: #EDF3F5; border-radius: 12px; padding: 4px; gap: 4px; }
.ph-pp-tab {
  border: none; border-radius: 9px; padding: 7px 14px; background: transparent;
  font: inherit; font-size: 16px; font-weight: 700; color: #64717A; cursor: pointer;
}
.ph-pp-tab.is-active { background: #FFFFFF; color: #0072B2; box-shadow: 0 1px 4px rgba(37, 49, 58, 0.12); }
.ph-pp-tabs { grid-area: tabs; justify-self: start; }
.ph-pp-filters { grid-area: filters; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.ph-pp-filters .ph-ind-field { flex: none; }
.ph-pp-filters select, .ph-pp-filters input { width: 100%; height: 42px; box-sizing: border-box; padding: 0 10px; }
.ph-pp-cta { grid-area: cta; justify-self: end; text-align: right; }
.ph-pp-login { margin: 0; font-size: 16px; color: #4A565F; }
.ph-pp-login a { color: #0072B2; font-weight: 700; }
.ph-pp-count { font-size: 14px; color: #7C8891; margin: 4px 0 8px; }

.ph-pp-form, .ph-pp-admin {
  display: flex; flex-direction: column; gap: 8px;
  background: #FFFFFF; border: 1px solid #DCE3E7; border-radius: 16px; padding: 20px 22px; margin: 8px 0 20px;
}
.ph-pp-form .ph-subhead, .ph-pp-admin .ph-subhead { margin: 0 0 4px; }
.ph-pp-kind, .ph-pp-stance { border: none; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.ph-pp-kind legend, .ph-pp-stance legend { padding: 0; margin-bottom: 4px; }
.ph-pp-kind label, .ph-pp-stance label { font-size: 16px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ph-pp-note { font-size: 13px; color: #7C8891; margin: 4px 0 0; line-height: 1.6; }
.ph-pp-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.ph-pp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ph-pp-item {
  display: flex; gap: 16px; align-items: flex-start;
  background: #FFFFFF; border: 1px solid #DCE3E7; border-radius: 16px; padding: 16px 20px;
}
.ph-pp-item.is-hidden, .ph-pp-citem.is-hidden { opacity: 0.6; border-style: dashed; }
.ph-pp-main { flex: 1 1 auto; min-width: 0; }
.ph-pp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.ph-pp-badge { font-size: 13px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.ph-pp-badge--open { background: #E6F1F8; color: #005A8C; }
.ph-pp-badge--reviewing { background: #FDF3E1; color: #9A6200; }
.ph-pp-badge--accepted { background: #E4F1EC; color: #0B6E54; }
.ph-pp-badge--done { background: #D3EAE1; color: #07533F; }
.ph-pp-badge--rejected { background: #F0F2F4; color: #5B6770; }
.ph-pp-badge--hidden { background: #FBEDEF; color: #B23A48; }
.ph-pp-kind-tag { font-size: 13px; color: #64717A; border: 1px solid #DCE3E7; border-radius: 999px; padding: 1px 9px; }
.ph-pp-mine { font-size: 13px; color: #0072B2; font-weight: 700; }
.ph-pp-title { display: block; font-size: 19px; font-weight: 700; color: #25313A; text-decoration: none; line-height: 1.5; overflow-wrap: anywhere; }
.ph-pp-title:hover { color: #0072B2; text-decoration: underline; }
.ph-pp-excerpt { margin: 6px 0 8px; font-size: 16px; color: #4A565F; line-height: 1.7; overflow-wrap: anywhere; }
.ph-pp-foot { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; color: #7C8891; overflow-wrap: anywhere; }

.ph-pp-vote {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 68px; min-height: 76px; border: 1px solid #BFDCD3; border-radius: 14px; background: #F4FAF7;
  color: #0B6E54; font: inherit; cursor: pointer; padding: 6px 4px; line-height: 1.2;
}
.ph-pp-vote:hover:not(:disabled) { background: #E4F1EC; }
.ph-pp-vote.is-on { background: #009E73; border-color: #009E73; color: #FFFFFF; }
.ph-pp-vote:disabled { cursor: default; opacity: 0.75; }
.ph-pp-vote-icon { font-size: 14px; }
.ph-pp-vote-num { font-size: 22px; font-weight: 700; }
.ph-pp-vote-label { font-size: 12px; }

.ph-pp-back { display: inline-block; margin: 16px 0 12px; color: #0072B2; font-weight: 700; text-decoration: none; }
.ph-pp-back:hover { text-decoration: underline; }
.ph-pp-detail { background: #FFFFFF; border: 1px solid #DCE3E7; border-radius: 16px; padding: 20px 22px; }
.ph-pp-dhead { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.ph-pp-dtitle { font-size: 22px; margin: 0 0 4px; color: #25313A; overflow-wrap: anywhere; }
.ph-pp-body { margin: 0 0 8px; font-size: 17px; line-height: 1.8; color: #25313A; white-space: pre-wrap; overflow-wrap: anywhere; }
.ph-pp-source { font-size: 16px; color: #4A565F; background: #F7FAFB; border-radius: 10px; padding: 10px 14px; overflow-wrap: anywhere; }
.ph-pp-decision { margin-top: 14px; border-radius: 12px; padding: 12px 16px; background: #F2F8FB; border: 1px solid #D6E8F2; }
.ph-pp-decision--accepted, .ph-pp-decision--done { background: #EEF7F3; border-color: #BFDCD3; }
.ph-pp-decision--rejected { background: #F5F6F7; border-color: #DCE3E7; }
.ph-pp-decision-head { font-weight: 700; font-size: 15px; color: #25313A; margin-bottom: 6px; }
.ph-pp-decision .ph-pp-body:last-child { margin-bottom: 0; }

.ph-pp-admin { margin-top: 20px; border-color: #F1D9A8; background: #FFFCF5; }
.ph-pp-admin-grid { display: grid; grid-template-columns: 200px 1fr; gap: 12px; }
.ph-pp-admin textarea { font: inherit; font-size: 16px; padding: 8px 10px; border: 1px solid #C9D3D9; border-radius: 10px; width: 100%; box-sizing: border-box; }

.ph-pp-comments { margin-top: 28px; }
.ph-pp-clist { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ph-pp-citem { background: #FFFFFF; border: 1px solid #DCE3E7; border-radius: 14px; padding: 12px 16px; }
.ph-pp-cmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 14px; color: #7C8891; margin-bottom: 4px; }
.ph-pp-cempty { color: #7C8891; font-size: 16px; }
.ph-pp-stance { font-size: 13px; font-weight: 700; padding: 1px 9px; border-radius: 999px; }
.ph-pp-stance--support { background: #E4F1EC; color: #0B6E54; }
.ph-pp-stance--concern { background: #FDF3E1; color: #9A6200; }
.ph-pp-stance--other { background: #E6F1F8; color: #005A8C; }
.ph-pp-chide { margin-left: auto; font-size: 14px; }
.ph-pp-cform { display: flex; flex-direction: column; gap: 8px; background: #FFFFFF; border: 1px solid #DCE3E7; border-radius: 16px; padding: 16px 18px; }

.ph-pp-tab:focus-visible, .ph-pp-vote:focus-visible, .ph-pp-title:focus-visible, .ph-pp-back:focus-visible { outline: 2px solid #0072B2; outline-offset: 2px; }

@media (max-width: 640px) {
  .ph-pp-toolbar { grid-template-columns: minmax(0, 1fr); grid-template-areas: "tabs" "filters" "cta"; padding: 14px; }
  .ph-pp-filters { grid-template-columns: minmax(0, 1fr); }
  .ph-pp-cta { justify-self: stretch; text-align: left; }
  .ph-pp-cta .ph-btn-primary { width: 100%; }
  .ph-pp-item, .ph-pp-detail, .ph-pp-form, .ph-pp-admin { padding: 14px; }
  .ph-pp-item { gap: 12px; }
  .ph-pp-vote { width: 56px; min-height: 66px; }
  .ph-pp-admin-grid { grid-template-columns: 1fr; }
}

.ph-ind-table-scroll { overflow: auto; max-height: 24rem; margin: .75rem 0; }
.ph-reading-table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.ph-reading-table td, .ph-reading-table th { text-align: start; padding: .45rem .7rem; border-bottom: 1px solid #d6e1e5; }
.ph-reading-table th { position: sticky; top: 0; background: #f2f7f8; }
.ph-ind-panel details > summary { cursor: pointer; padding: .5rem 0; }

.ph-wh-region-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin-bottom: 1rem; }
.ph-wh-region-picker select, .ph-wh-region-picker button { font: inherit; padding: .4rem .7rem; }
