/* T023：沿用 portal LANDING_CSS 的淺底、lcard、modal-sub、topbar、scope-banner、chip。 */
body { background: #f4f7f9; }
.lcard { background: #fff; border-radius: 16px; padding: 34px 30px; box-shadow: 0 14px 40px rgba(16,50,70,.13); border: 1px solid #e3ebef; display: flex; flex-direction: column; }
.lcard .btn { width: 100%; padding: 13px 20px; border-radius: 10px; font-size: 15px; font-weight: 700; color: #fff; border: 0; }
.lcard.consult .btn { background: #0067a9; }
.lcard.consult .btn:hover { background: #004c80; color: #fff; }
.modal-sub { color: #5d6f79; font-size: 13px; margin-bottom: 16px; }
.topbar { background: #fff; border-bottom: 1px solid #e3ebef; padding: 12px 22px; display: flex; align-items: center; gap: 14px; margin: -16px -16px 18px; }
.topbar img { height: 28px; }
.scope-banner { border-radius: 12px; padding: 14px 18px; margin-bottom: 16px; font-size: 14px; border: 1px solid; background: #eef2f4; border-color: #d5dde1; color: #16323f; }
.muted { color: #5d6f79; font-size: 13px; }
.chips { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); padding: 6px 14px; border-radius: 20px; font-size: 13px; }
/* 計畫頁容器：維持 portal 的 16px 頁距；寬表只在表格區捲動。 */
body > .container-fluid { padding: 16px; }
.plan-login { min-height: calc(100vh - 32px); display: flex; align-items: center; justify-content: center; }
.plan-login-card { width: 100%; max-width: 420px; }
.plan-login-logo { height: 30px; max-width: 100%; object-fit: contain; align-self: center; margin-bottom: 22px; }
.plan-login-card h1 { font-size: 23px; font-weight: 800; margin-bottom: 10px; color: #0067a9; text-align: center; }
.plan-login-card .modal-sub { text-align: center; }
.plan-login-card .shiny-input-container { width: 100%; }
.plan-login-card .text-danger { font-size: 13px; }
.topbar { flex-wrap: wrap; }
.topbar > * { min-width: 0; overflow-wrap: anywhere; }
.plan-logout { margin-left: auto; }
.plan-selector-card { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 18px 26px; background: #fff; border: 1px solid #e3ebef; border-radius: 12px; margin-bottom: 16px; }
.plan-selector-card > .shiny-input-container, .plan-selector-card > .shiny-html-output { flex: 1 1 240px; min-width: 0; }
.plan-selector-card .shiny-input-container { width: 100%; margin-bottom: 0; }
.plan-selector-card > .btn { margin-bottom: 0; }
.plan-feedback { margin-bottom: 16px; }
.plan-minimum-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 18px; }
.plan-minimum-chips .chip { background: #fff; border-color: #e3ebef; color: #16323f; overflow-wrap: anywhere; }
#draft_panels, .card, .card-body, .tab-content, .tab-pane, .datatables, .dataTables_wrapper { min-width: 0; max-width: 100%; }
#draft_panels > p { color: #5d6f79; font-size: 13px; margin-bottom: 16px; }
#draft_panels h4 { font-size: 20px; font-weight: 800; margin-bottom: 16px; }
#draft_panels h5 { margin-top: 18px; margin-bottom: 12px; }
#draft_panels .card { margin-bottom: 18px; }
#draft_panels .nav-link { font-size: 14px; padding: 12px 16px; }
#draft_panels .btn { margin: 8px 8px 8px 0; }
#draft_panels .datatables { margin-bottom: 18px; font-size: 13px; }
#draft_panels table thead { background: #eef2f4; color: #16323f; }
#draft_panels table th, #draft_panels table td { padding: 10px 12px; }
#draft_panels .shiny-html-output.shiny-bound-output { max-width: 100%; overflow-x: auto; }
.scope-banner, #feedback { overflow-wrap: anywhere; }
/* T024：沿用 T023 品牌色，表單在窄螢幕改為單欄。 */
.plan-form-card { background: #fff; border: 1px solid #e3ebef; border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.plan-form-grid, .plan-minimum-grid, .plan-master-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.plan-form-field, .plan-master-grid > div { min-width: 0; }
.plan-form-field .shiny-input-container, .plan-minimum-card .shiny-input-container, .plan-trigger-row .shiny-input-container { width: 100%; }
.plan-form-field fieldset:disabled { opacity: .8; }
.plan-form-error { white-space: pre-wrap; overflow-wrap: anywhere; }
.plan-form-section { border-top: 1px solid #e3ebef; margin-top: 14px; padding-top: 4px; }
.plan-trigger-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid #e3ebef; }
.plan-task-editor { padding: 16px; margin-top: 14px; background: #f4f7f9; border-radius: 12px; }
@media (max-width: 1000px) { .plan-master-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .plan-form-grid, .plan-minimum-grid, .plan-trigger-row { grid-template-columns: 1fr; } }

/* T029：長法源／旗標保留換行；識別與結論不被長文擠成逐字直排。 */
#obligation_table table.dataTable th,
#obligation_table table.dataTable td { min-width: 72px; vertical-align: top; }
#obligation_table table.dataTable td:nth-child(-n+15) { white-space: nowrap; }
#obligation_table table.dataTable th:nth-child(n+16),
#obligation_table table.dataTable td:nth-child(n+16) { min-width: 320px; max-width: 400px; white-space: normal; }
