:root { color-scheme: light; font-family: "Microsoft JhengHei", "Noto Sans TC", sans-serif; color: #26302c; background: #f4f6f5; letter-spacing: 0; --teal: #146859; --line: #d5ddd8; --muted: #59675f; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.65; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; background: var(--teal); color: #fff; border: 1px solid var(--teal); border-radius: 5px; min-height: 44px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover { filter: brightness(.94); }
button:disabled { opacity: .48; cursor: default; }
.secondary, .icon-button { background: #fff; color: #34463c; border-color: #b7c6bd; }
.icon-button { width: 44px; padding: 10px; flex-shrink: 0; }
a { color: #155b85; text-underline-offset: 3px; }
svg { width: 19px; height: 19px; flex-shrink: 0; vertical-align: middle; }
:focus-visible { outline: 3px solid #246ec5; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 19px; line-height: 1.5; }
h2 { font-size: 23px; } h3 { font-size: 19px; } h4 { font-size: 16px; }
.site-header { min-height: 82px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 14px max(24px, calc((100% - 1360px) / 2)); gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand > svg { width: 32px; height: 32px; color: var(--teal); }
.brand span { font-size: 12px; color: var(--muted); }
.site-header > a { font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
main { max-width: 1440px; padding: 24px 24px 56px; margin: auto; }
.overview { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.overview p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.privacy { color: #53635a; font-size: 13px; margin: 16px 0; max-width: 1040px; }
.privacy svg { margin-right: 5px; width: 15px; height: 15px; }
.privacy summary { color: #53635a; }
.privacy p { margin-top: 8px; }
.workspace { display: grid; grid-template-columns: minmax(360px, .95fr) minmax(0, 1.05fr); background: #fff; border-top: 1px solid var(--line); }
.editor { padding: 24px 28px 32px 0; min-width: 0; background: #f4f6f5; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 17px; margin-bottom: 24px; }
.steps button { border: 0; border-radius: 0; font-size: 13px; padding: 8px 3px; color: var(--muted); background: transparent; flex-direction: column; gap: 4px; }
.steps span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e3e9e5; font-size: 13px; }
.steps [aria-current="step"] { color: var(--teal); font-weight: bold; box-shadow: 0 2px 0 var(--teal); }
.steps [aria-current="step"] span { background: var(--teal); color: #fff; }
form h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
form h3 svg { color: var(--teal); }
#address { min-height: 58px; font-size: 17px; padding: 14px; }
#scenarios { margin-top: 24px; }
.coverage-details { margin-top: 12px; }
.coverage-details summary { color: #476780; }
.generation-command { margin-top: 16px; }
.generation-command button { width: 100%; min-height: 50px; font-weight: 600; }
label, legend { font-size: 14px; font-weight: 600; }
form > section > label, .field-pair label, .need-detail label { display: block; margin: 17px 0 6px; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { display: block; width: 100%; min-height: 46px; background: #fff; color: #26302c; border: 1px solid #adbcb3; border-radius: 4px; padding: 10px 11px; }
input::placeholder, textarea::placeholder { color: #718076; font-size: 13px; }
textarea { resize: vertical; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.scenario-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 10px 0 4px; }
.scenario-options label { display: flex; gap: 9px; align-items: center; min-height: 54px; border: 1px solid #b8c7be; padding: 10px 12px; border-radius: 5px; background: #fff; cursor: pointer; }
.scenario-options label:has(:checked) { background: #e5f1ea; border-color: var(--teal); color: #135e4f; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--teal); flex-shrink: 0; }
.field-note { font-size: 13px; color: var(--muted); margin-top: 7px; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-pair > div { min-width: 0; }
.field-error, .error { color: #a1232f; font-size: 13px; }
.error { border-left: 3px solid #ad2935; padding: 10px 14px; background: #fff0f0; margin-bottom: 12px; }
[aria-invalid="true"] { border-color: #a1232f !important; }
.evidence-note { margin-top: 24px; border-left: 3px solid #6495ba; padding: 12px 14px; background: #edf3f8; color: #31516b; font-size: 13px; }
.site-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; margin-top: 16px; }
.site-controls > div { flex: 1; min-width: 120px; }
.site-controls label { display: block; margin-bottom: 6px; }
#site-map { width: 100%; height: 310px; margin-top: 16px; background: #e5eaed; border: 1px solid var(--line); z-index: 0; }
.site-confirm { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; }
.site-confirm input { margin-top: 4px; }
.site-findings { border-left: 3px solid #a4b6c5; padding-left: 12px; margin-top: 14px; font-size: 13px; }
.site-findings p { margin: 8px 0; }
#clear-site { margin-top: 8px; font-size: 13px; }
#site-map svg { width: auto; height: auto; }
.point-picker { margin-top: 16px; padding: 16px 0; border-top: 2px solid #56758e; border-bottom: 1px solid var(--line); }
#open-point-picker { margin-top: 8px; }
#point-map { width: 100%; height: 320px; margin: 12px 0; background: #e5eaed; border: 1px solid var(--line); z-index: 0; }
#point-map svg { width: auto; height: auto; }
.point-picker .actions { margin-top: 12px; }
.public-directory { margin-top: 20px; border-top: 2px solid #56758e; padding-top: 12px; overflow-wrap: anywhere; }
.directory-row { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.directory-row strong { display: block; font-size: 14px; }
.directory-row a { display: inline-block; min-height: 32px; padding-top: 4px; }
.resource-warning { color: #865b16; margin-top: 6px; }
#meeting-manual label, #backup_meeting-manual label { display: block; margin: 14px 0 6px; }
.need-row { border-bottom: 1px solid var(--line); padding: 18px 0; }
.need-heading { display: grid; grid-template-columns: minmax(0, 1fr) 125px; gap: 12px; align-items: center; }
.need-heading small { display: block; color: var(--muted); font-weight: normal; font-size: 12px; }
.need-heading select { min-height: 42px; padding: 7px; }
.need-detail { margin-top: 10px; border-left: 3px solid #92b7a5; padding-left: 14px; }
.generated-arrangement { font-size: 13px; color: #295848; }
.generated-review { border-top: 3px solid #537cad; padding-top: 12px; overflow-wrap: anywhere; }
.generated-review button { margin: 10px 8px 0 0; font-size: 13px; }
.purpose-meeting, .purpose-shelter { font-size: 13px; padding: 10px 12px; margin-top: 10px; border-left: 3px solid #537cad; background: #edf3f8; }
.purpose-shelter { border-color: #18745a; background: #eaf3ee; }
.plan-section dl.action-row { margin: 12px 0 18px; border-top: 2px solid #92b7a5; }
.plan-section dl.action-row > div { grid-template-columns: 88px minmax(0, 1fr); }
.optional-editor { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 16px; }
.optional-editor > label { display: block; margin: 17px 0 6px; }
.source-label.mixed { color: #785609; }
#generation-status { font-size: 13px; color: #31516b; margin: 8px 0; }
.step-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 28px; gap: 8px; }
.step-footer span { font-size: 13px; color: var(--muted); }
.preview-pane { min-width: 0; border-left: 1px solid var(--line); padding: 24px; }
.preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-heading h3 { display: flex; gap: 8px; align-items: center; }
#preview-state { font-size: 12px; color: var(--muted); }
.missing-summary { margin-top: 16px; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.missing-heading { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#progress-text { font-size: 12px; color: var(--muted); }
progress { width: 100%; height: 7px; accent-color: var(--teal); display: block; margin-top: 10px; }
details { margin-top: 10px; font-size: 13px; }
summary { color: #815e10; cursor: pointer; padding: 4px 0; }
#missing-list { max-height: 210px; overflow: auto; margin: 8px 0 0; padding-left: 20px; }
#missing-list button { background: transparent; color: #785609; min-height: 34px; padding: 3px 2px; border: none; text-align: left; justify-content: start; text-decoration: underline; }
.document-preview { padding-top: 24px; overflow-wrap: anywhere; }
.document-preview > h2 { font-size: 21px; line-height: 1.55; margin-bottom: 4px; }
.document-preview .draft-state { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.plan-section { margin: 22px 0 0; }
.plan-section h3 { font-size: 16px; margin-bottom: 8px; }
.source-label { display: inline-block; font-size: 12px; color: #295f86; margin-bottom: 8px; }
.source-label.suggestion { color: #176549; }.source-label.check { color: #865b16; }
.plan-section dl { margin: 0; font-size: 14px; }
.plan-section dl > div { display: grid; grid-template-columns: 135px minmax(0, 1fr); border-bottom: 1px solid #e7ece8; padding: 7px 0; gap: 12px; }
dt { color: #647168; } dd { margin: 0; white-space: pre-wrap; }
.plan-section li { margin-bottom: 9px; font-size: 14px; }
.plan-section ul { padding-left: 19px; margin: 6px 0; }
.plan-section a { font-size: 13px; }
.plan-section p { font-size: 13px; color: var(--muted); }
.pending { color: #865b16; }
.mobile-view { display: none; }
#export-status { font-size: 13px; color: #495b50; margin: 8px 0; }
#file-status { font-size: 13px; color: #31516b; margin: 8px 0; }
#knowledge-status { font-size: 13px; color: #684e80; margin: 8px 0; }
.source-label.private { color: #684e80; }
#download-result { border-left: 3px solid var(--teal); padding: 8px 12px; margin: 12px 0; overflow-wrap: anywhere; }
dialog { max-width: min(440px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 6px; padding: 26px; }
dialog::backdrop { background: #101d1766; } dialog p { margin: 12px 0 20px; }
.preview-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-top: 18px; }
.preview-tabs button { background: transparent; border: 0; border-radius: 0; color: var(--muted); padding: 11px 8px; }
.preview-tabs [aria-selected="true"] { color: #145e52; font-weight: 600; box-shadow: inset 0 -3px #146859; background: #f0f7f3; }
.basis-notice { border-left: 3px solid #b78423; padding: 10px 12px; background: #fff9e9; font-size: 13px; color: #755213; margin-top: 16px; overflow-wrap: anywhere; }
.basis-title { margin: 22px 0 14px; }
.basis-row { padding: 0 0 16px 14px; margin-top: 18px; border-left: 3px solid #497996; border-bottom: 1px solid #e7ece8; }
.basis-local_plan { border-left-color: #bd8a22; }
.basis-private { border-left-color: #876693; }
.basis-household { border-left-color: #298574; }
.basis-row-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.basis-row h4 { font-size: 15px; }
.basis-row p { margin-top: 7px; font-size: 13px; color: var(--muted); }
.basis-status { font-size: 12px; color: #785609; }
.basis-status[data-state="provided"] { color: #176549; }
.basis-status[data-state="pending"] { color: #59675f; }
#planning-basis[aria-busy="true"] { opacity: .55; }
.basis-resources, .private-retrieval, .basis-guidance { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.basis-resources dl { margin: 12px 0; font-size: 13px; }
.basis-resources dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid #e7ece8; }
.basis-resources dd, .basis-guidance { overflow-wrap: anywhere; }
.basis-guidance ul { padding-left: 20px; font-size: 13px; }
.basis-guidance li { margin-top: 10px; }
.private-retrieval button, .basis-resources button { font-size: 13px; }
.basis-local-sources { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.basis-local-sources p { font-size: 13px; margin-top: 10px; }
.local-document { border-left: 3px solid #ac7a18; padding: 5px 0 5px 12px; }
.local-document small { display: block; color: var(--muted); margin-top: 5px; }
.local-citation { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.local-citation blockquote { margin: 12px 0; padding: 10px 14px; border-left: 3px solid #638d7c; background: #f0f6f3; }
.local-citation a { display: inline-block; padding: 6px 0; }
.local-jurisdiction { font-weight: 600; }
.source-label.local_plan { color: #846010; }
@media (min-width: 851px) {
  .preview-pane { position: sticky; top: 12px; align-self: start; }
  .document-preview, #basis-panel { max-height: 640px; overflow-y: auto; scrollbar-gutter: stable; padding-right: 12px; }
}
@media (max-width: 850px) {
  .site-header { padding: 12px 16px; } .site-header > a { max-width: 116px; font-size: 12px; }
  h1 { font-size: 17px; } main { padding: 20px 16px 36px; } h2 { font-size: 21px; }
  .overview { align-items: flex-start; flex-direction: column; } .privacy { margin: 16px 0; }
  .mobile-view { display: flex; margin: 18px 0 0; border-bottom: 1px solid var(--line); }
  .mobile-view button { width: 50%; border: 0; border-radius: 0; background: #e9eeeb; color: var(--muted); }
  .mobile-view [aria-pressed="true"] { background: #fff; color: var(--teal); box-shadow: inset 0 -3px var(--teal); }
  .workspace { display: block; } .editor { padding: 20px 0; } .preview-pane { padding: 20px 16px; border: none; display: none; }
  body[data-view="preview"] .editor { display: none; } body[data-view="preview"] .preview-pane { display: block; }
  .preview-heading { align-items: flex-start; } .preview-heading h3 { font-size: 17px; }
  .preview-pane { padding: 20px 14px; }
  .overview .actions { width: 100%; }
  .overview #export-plan { margin-left: auto; }
  .preview-tabs button { font-size: 14px; }
  .basis-resources dl > div { grid-template-columns: 80px minmax(0, 1fr); }
}
@media (max-width: 370px) { .field-pair { grid-template-columns: 1fr; } .actions { gap: 6px; } .actions button { padding: 8px; font-size: 13px; } .plan-section dl > div { grid-template-columns: 1fr; gap: 0; } }
@media print {
  @page { size: A4; margin: 16mm; }
  body, main, .workspace { background: white; margin: 0; padding: 0; display: block; }
  .site-header, .overview, .privacy, .mobile-view, .editor, .preview-heading, .missing-summary, .preview-tabs, .basis-notice, #basis-panel, #network-error, #export-status, #generation-status, #file-status, #download-result, dialog { display: none !important; }
  #plan-panel[hidden] { display: block !important; }
  .preview-pane, body[data-view="input"] .preview-pane { display: block !important; border: none; padding: 0; }
  .preview-pane { position: static; }
  .document-preview { max-height: none; overflow: visible; padding: 0; }
  .plan-section h3 { break-after: avoid; } .plan-section li, .plan-section dl > div { break-inside: avoid; }
  .document-preview a::after { content: " (" attr(href) ")"; font-size: 10px; }
  button, progress, #knowledge-status { display: none !important; }
  body[data-print-ready="false"] .document-preview { display: none !important; }
  body[data-print-ready="false"] .preview-pane::before { content: "目前資料尚未完成更新或仍在生成，未列印舊計畫。請返回網頁，待預覽更新完成後再列印。"; display: block; color: #000; padding: 12px 0; }
}
