.workspace-card-flow { border-color: rgba(237, 109, 44, .42); background: linear-gradient(135deg, rgba(255, 250, 244, .98), rgba(255, 241, 227, .9)); }
.workspace-card-flow b { color: #bd4f20; }
.flow-hub-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 24px; background: rgba(29, 42, 57, .36); }
/*
 * A managed branch editor is a real navigation layer, not a card inside the
 * legacy planner. If an older planner layer survives a branch transition it
 * must never sit above the branch controls and swallow their clicks.
 */
.trip-workspace[data-flow-managed="true"] { z-index: 80; }
.flow-hub-shell { width: min(960px, 100%); max-height: min(840px, calc(100vh - 48px)); overflow: hidden; border-radius: 28px; background: #fffdf9; box-shadow: 0 28px 80px rgba(20, 35, 52, .28); }
.flow-hub-scroll { max-height: min(840px, calc(100vh - 48px)); overflow: auto; padding: 34px; }
.flow-hub-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.flow-hub-head h2 { margin: 5px 0 10px; font-size: clamp(1.6rem, 3vw, 2.4rem); color: #273a4d; }
.flow-hub-head p:not(.eyebrow) { max-width: 690px; margin: 0; color: #667486; line-height: 1.7; }
.flow-hub-head .x { flex: 0 0 auto; }
.flow-progress { display: flex; align-items: center; gap: 18px; margin: 28px 0 16px; padding: 16px 18px; border: 1px solid #e9e3d9; border-radius: 17px; background: #faf8f2; }
.flow-progress b, .flow-progress span { display: block; }
.flow-progress b { font-size: 1.2rem; color: #273a4d; }
.flow-progress span { font-size: .78rem; color: #7e8994; }
.flow-progress-bar { flex: 1; height: 9px; overflow: hidden; border-radius: 99px; background: #e5e0d8; }
.flow-progress-bar i { display: block; height: 100%; border-radius: inherit; background: #ed6d2c; transition: width .25s ease; }
.flow-impact-note { display: flex; gap: 9px; flex-direction: column; margin: 14px 0; padding: 13px 15px; border-left: 4px solid #e19b2f; background: #fff7e6; color: #705224; }
.flow-impact-note span { line-height: 1.5; font-size: .9rem; }
.flow-impact-note--planner { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 28px 12px; border: 1px solid #efd8a7; border-left: 4px solid #e19b2f; border-radius: 12px; }
.flow-impact-note--planner > div:first-child { display: grid; gap: 3px; min-width: 0; flex: 1 1 200px; }
.flow-impact-note--planner > div:first-child span { color: #80663b; font-size: 11px; }
.flow-impact-actions { display: flex; flex: 0 1 auto; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.flow-impact-actions button { padding: 6px 9px; border: 1px solid #e2bd73; border-radius: 999px; background: #fffdf6; color: #805d20; font: 700 11px inherit; cursor: pointer; white-space: nowrap; }
.flow-impact-actions button:hover, .flow-impact-actions button:focus-visible { border-color: #c68b26; background: #fff2ce; outline: none; }
.flow-branch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flow-branch-card { display: grid; grid-template-columns: 32px 1fr 24px; gap: 11px; align-items: start; min-height: 118px; padding: 17px; text-align: left; border: 1px solid #e8e3db; border-radius: 18px; background: #fff; color: #273a4d; cursor: pointer; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.flow-branch-card:hover, .flow-branch-card:focus-visible { transform: translateY(-2px); border-color: #ed6d2c; box-shadow: 0 12px 25px rgba(38, 57, 77, .1); outline: none; }
.flow-branch-number { color: #b0a99f; font: 700 .78rem/1.3 ui-monospace, SFMono-Regular, Menlo, monospace; }
.flow-branch-copy { display: grid; gap: 6px; }
.flow-branch-copy b { font-size: 1rem; }
.flow-branch-copy small { color: #718091; line-height: 1.5; }
.flow-branch-copy em { width: fit-content; padding: 3px 8px; border-radius: 99px; background: #f1eee8; color: #7b766f; font-size: .75rem; font-style: normal; }
.flow-branch-card.is-complete .flow-branch-copy em { background: #e8f5eb; color: #367344; }
.flow-branch-card.is-review .flow-branch-copy em { background: #fff1d8; color: #8b6017; }
.flow-branch-arrow { color: #b6afa5; font-size: 1.2rem; }
.flow-hub-footnote { margin: 20px 0; color: #7c858e; font-size: .82rem; line-height: 1.6; }
.flow-hub-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flow-planner-link { color: #ed6d2c !important; }
.flow-branch-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 14px 0 18px; padding: 13px 14px; border: 1px solid rgba(237, 109, 44, .28); border-radius: 15px; background: linear-gradient(135deg, #fff8f0, #fffdf9); }
.flow-branch-bar-kicker { display: block; color: #bd4f20; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.flow-branch-bar b { display: block; margin-top: 2px; color: #273a4d; font-size: .98rem; }
.flow-branch-bar small { display: block; margin-top: 3px; color: #7a8590; font-size: .74rem; line-height: 1.4; }
.flow-branch-bar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.flow-branch-bar-actions button { margin: 0; padding: 8px 11px; font-size: .78rem; white-space: nowrap; }
.flow-planner-bar { display: inline-flex; gap: 3px; align-items: center; margin-right: 3px; }
.flow-planner-bar .planner-top-link { color: #bd4f20; }
.flow-workspace-bar { margin-right: 0; }
.flow-workspace-bar .planner-top-link { padding-top: 7px; padding-bottom: 7px; }
.planner-drawer-head .planner-drawer-return { margin-left: auto; padding: 7px 10px; border: 1px solid #e8c8b4; border-radius: 999px; background: #fff8f3; color: #955334; font: 700 12px inherit; white-space: nowrap; }
.planner-drawer-head .planner-drawer-return:hover, .planner-drawer-head .planner-drawer-return:focus-visible { border-color: #e39d72; background: #fff1e8; outline: none; }
.journey-document-capture { margin: 12px 0 16px; padding: 14px; border: 1px solid #eadfd5; border-radius: 16px; background: #fffaf5; }
.journey-document-file-source { display: grid; gap: 7px; }
.journey-document-capture-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.journey-document-capture-head b, .journey-document-capture-head small { display: block; }
.journey-document-capture-head b { color: #4d4037; }
.journey-document-capture-head small { margin-top: 3px; color: #8b8178; font-size: 12px; line-height: 1.45; }
.journey-document-capture-empty { margin: 0; padding: 13px; border: 1px dashed #dbcfc3; border-radius: 11px; color: #8b8178; font-size: 12px; line-height: 1.5; }
/* 縮圖必須看得出上傳的是什麼，58px 只是個圖示；改成中圖尺寸。 */
.journey-document-capture-item { display: grid; grid-template-columns: 112px 1fr; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid #eee5dc; }
.journey-document-capture-preview { display: grid; place-items: center; width: 112px; height: 140px; overflow: hidden; border-radius: 11px; background: #eee7df; color: #8c6d59; font-size: 11px; font-weight: 800; }
.journey-document-capture-preview img { width: 100%; height: 100%; object-fit: cover; }
.journey-document-capture-copy { min-width: 0; }
.journey-document-capture-copy b, .journey-document-capture-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journey-document-capture-copy b { color: #4d4037; font-size: 13px; }
.journey-document-capture-copy small { margin-top: 3px; color: #8b8178; font-size: 11px; }
.journey-document-capture-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
/* 觸控目標：原本 padding:0 + 11px 讓每顆只有約 15px 高，五頁就是 35 個密集小目標，
   而且破壞性的移除和無害的上移大小、間距完全一樣。同檔案的
   .journey-private-document-actions 早就有 40/44px，唯獨拍照流程漏掉。 */
.journey-document-capture-actions button {
  min-height: 40px; padding: 9px 12px; font-size: 12px;
  border: 1px solid #e6d2be; border-radius: 10px; background: #fff;
  line-height: 1.2;
}
.journey-document-capture-actions button:hover:not(:disabled) { background: #fff3e6; border-color: #d98a55; }
.journey-document-capture-actions button:disabled { opacity: .4; cursor: not-allowed; }
/* 破壞性動作要有自己的視覺重量。 */
.journey-document-capture-actions .is-danger { color: #a3341f; border-color: #e6c3ba; }
.journey-document-capture-actions .is-danger:hover:not(:disabled) { background: #fdeee9; border-color: #c8705c; }
@media (max-width: 700px) {
  .journey-document-capture-actions button { min-height: 44px; }
}
.journey-document-capture-edit { grid-column: 1 / -1; margin-top: 7px; padding-top: 7px; border-top: 1px dashed #eadfd5; }
.journey-document-capture-edit summary { color: #9a5d3d; font-size: 11px; cursor: pointer; }
.journey-document-capture-edit > small { display: block; margin: 8px 0 5px; color: #8b8178; font-size: 10px; line-height: 1.45; }
.journey-document-capture-crop { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 7px; align-items: center; color: #806e61; font-size: 10px; }
.journey-document-capture-crop input { width: 100%; accent-color: #ed702d; }
/* 這頁的重點記錄：現在一直可見（不再藏在收合區），字級跟著提高。 */
.journey-document-capture-ocr { display: grid; gap: 5px; margin-top: 10px; color: #705f52; font-size: 12px; font-weight: 600; line-height: 1.45; }
.journey-document-capture-ocr textarea { min-height: 52px; margin: 0; font-size: 13px; font-weight: 400; }
.journey-document-capture-ocr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin-top: 6px; }
.journey-document-capture-ocr-actions button { padding: 0; font-size: 12px; }
.journey-document-capture-ocr-actions small { color: #8b8178; font-size: 12px; }
/* 直接在照片上拖曳裁切：四邊各一個可拖控制點，深色遮罩即時顯示會被
   裁掉的範圍，取代四條百分比滑桿。 */
.capture-crop-editor { grid-column: 1 / -1; margin-top: 12px; }
.capture-crop-stage { position: relative; width: 100%; overflow: hidden; border-radius: 12px; background: #eee7df; touch-action: none; }
.capture-crop-stage img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.capture-crop-mask { position: absolute; background: rgba(20, 14, 8, .58); pointer-events: none; }
.capture-crop-mask-top { top: 0; left: 0; right: 0; height: 0%; }
.capture-crop-mask-bottom { bottom: 0; left: 0; right: 0; height: 0%; }
.capture-crop-mask-left { left: 0; top: 0; bottom: 0; width: 0%; }
.capture-crop-mask-right { right: 0; top: 0; bottom: 0; width: 0%; }
.capture-crop-handle { position: absolute; touch-action: none; cursor: grab; }
.capture-crop-handle:active { cursor: grabbing; }
.capture-crop-handle::after { content: ""; position: absolute; top: 50%; left: 50%; background: #fff; border: 2px solid #ed6d2c; border-radius: 999px; box-shadow: 0 1px 5px rgba(0, 0, 0, .35); }
.capture-crop-handle-top { top: 0%; left: 0; right: 0; height: 30px; margin-top: -15px; }
.capture-crop-handle-bottom { bottom: 0%; left: 0; right: 0; height: 30px; margin-bottom: -15px; }
.capture-crop-handle-left { left: 0%; top: 0; bottom: 0; width: 30px; margin-left: -15px; }
.capture-crop-handle-right { right: 0%; top: 0; bottom: 0; width: 30px; margin-right: -15px; }
.capture-crop-handle-top::after, .capture-crop-handle-bottom::after { width: 36px; height: 14px; transform: translate(-50%, -50%); }
.capture-crop-handle-left::after, .capture-crop-handle-right::after { width: 14px; height: 36px; transform: translate(-50%, -50%); }
.capture-crop-hint { display: block; margin-top: 9px; color: #8b8178; font-size: 12px; line-height: 1.5; }
@media (max-width: 700px) {
  .capture-crop-handle-top, .capture-crop-handle-bottom { height: 38px; margin-top: -19px; }
  .capture-crop-handle-bottom { margin-top: 0; margin-bottom: -19px; }
  .capture-crop-handle-left, .capture-crop-handle-right { width: 38px; margin-left: -19px; }
  .capture-crop-handle-right { margin-left: 0; margin-right: -19px; }
  .capture-crop-handle-top::after, .capture-crop-handle-bottom::after { width: 44px; height: 18px; }
  .capture-crop-handle-left::after, .capture-crop-handle-right::after { width: 18px; height: 44px; }
}
.journey-private-document-list { display: grid; gap: 9px; margin: 16px 0; }
.journey-private-document-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid #eadfd5; border-radius: 14px; background: #fffdfb; }
.journey-private-document-copy { min-width: 0; }
.journey-private-document-copy b, .journey-private-document-copy small { display: block; }
.journey-private-document-copy b { color: #4d4037; line-height: 1.35; }
.journey-private-document-copy small { margin-top: 4px; color: #8b8178; font-size: 12px; line-height: 1.45; }
.journey-private-document-actions { flex: 0 0 auto; }
.journey-private-document-empty { margin: 0; padding: 16px; border: 1px dashed #dbcfc3; border-radius: 13px; color: #8b8178; line-height: 1.55; }
.journey-private-document-legacy { color: #a06443 !important; }
.journey-private-document-existing { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: #fff7ed; color: #815e47; font-size: 12px; line-height: 1.5; }
.journey-document-saved-pages { margin: 14px 0 16px; padding: 14px; border: 1px solid #eadfd5; border-radius: 16px; background: #fffdfb; }
.journey-document-saved-pages-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.journey-document-saved-pages-head b, .journey-document-saved-pages-head small { display: block; }
.journey-document-saved-pages-head b { color: #4d4037; }
.journey-document-saved-pages-head small { max-width: 620px; margin-top: 3px; color: #8b8178; font-size: 11px; line-height: 1.45; }
.journey-document-saved-pages-head > span { flex: 0 0 auto; color: #a85b36; font-size: 11px; font-weight: 800; }
.journey-document-saved-page { padding: 10px 0; border-top: 1px solid #eee5dc; }
.journey-document-saved-page:first-child { border-top: 0; }
.journey-document-saved-page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.journey-document-saved-page-head b, .journey-document-saved-page-head small { display: block; }
.journey-document-saved-page-head b { color: #4d4037; font-size: 13px; }
.journey-document-saved-page-head small { margin-top: 3px; color: #8b8178; font-size: 11px; line-height: 1.45; }
.journey-document-saved-page-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 4px 10px; }
.journey-document-saved-page-actions button { padding: 0; font-size: 11px; }
.journey-document-saved-page-actions button:disabled { opacity: .4; cursor: not-allowed; }
.journey-document-saved-page-edit { display: grid; gap: 7px; margin-top: 8px; padding: 10px 0 2px; border-top: 1px dashed #eadfd5; }
.journey-document-saved-page-edit label { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 8px; align-items: center; color: #806e61; font-size: 10px; }
.journey-document-saved-page-edit input[type="range"] { width: 100%; accent-color: #ed702d; }
.journey-document-saved-page-edit > button { justify-self: start; }
.journey-document-saved-page-edit > small { color: #8b8178; font-size: 10px; line-height: 1.45; }
.journey-document-retake { display: grid !important; grid-template-columns: 1fr !important; gap: 5px !important; margin-top: 3px; padding-top: 8px; border-top: 1px dashed #eee5dc; }
.journey-document-retake input[type="file"] { width: 100%; font-size: 11px; }
.journey-booking-row { align-items: center; }
.journey-booking-row-copy { display: grid; min-width: 0; gap: 2px; }
.journey-booking-row-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.journey-booking-row-actions button { padding: 3px 0; font-size: 11px; }
.travel-planner .planner-shell { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.travel-planner .planner-top { grid-row: 1; }
.travel-planner .planner-copy-status { grid-row: 3; min-height: 0; }
.travel-planner .planner-body { grid-row: 4; height: auto; min-height: 0; }
/* 分支頁不是另一張浮在摘要上面的卡。切換到同行人／交通／文件等分支後，
   隱藏摘要底層，把同一個 planner drawer 放進工作區內容列；固定導覽仍留在
   上方，所以使用者可以直接跳到任何分支，也不會看到兩套互相搶位的外殼。 */
.travel-planner.is-branch-mode .planner-body { display: none; }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page { position: static; grid-row: 4; width: auto; height: auto; max-height: none; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 24px 30px 42px; border: 0; border-radius: 0; box-shadow: none; }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page > * { width: min(100%, 940px); margin-right: auto; margin-left: auto; }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page > .planner-drawer-head { position: sticky; z-index: 3; top: -24px; padding-top: 24px; margin-bottom: 16px; background: rgba(255, 253, 250, .97); }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page.is-entering { animation: none; }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page > .planner-drawer-head { align-items: flex-end; padding: 22px 23px; border: 1px solid #ecd9ca; border-radius: 18px; background: linear-gradient(120deg, #fff9f4, #fffefd); }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page > .planner-drawer-head h3 { font-size: 25px; letter-spacing: -.055em; }
.travel-planner.is-branch-mode .planner-drawer.is-branch-page > .planner-drawer-head .planner-drawer-return { order: 2; }
.planner-branch-context { display: flex; align-items: baseline; gap: 9px; margin: 0 auto 10px; padding: 8px 11px; border: 1px solid #eadbd1; border-radius: 10px; background: #fff8f2; color: #8d7768; font-size: 11px; line-height: 1.45; }
.planner-branch-context span { color: #a85b36; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.planner-branch-context strong { color: #644f42; font-size: 12px; }
.planner-branch-context small { margin-left: auto; color: #9b8d82; }
@media (min-width: 761px) {
  .travel-planner .planner-drawer { top: 121px; max-height: calc(100% - 121px); }
  /* 固定分支導覽開啟的表單是目前工作區，不是另一張窄側欄。完整寬度讓
     同行人、交通、文件與住宿看起來都屬於同一個 planner；子表單仍由
     app.js 的 drawer layer 管理，因此「返回上一層」不會改變工作區。 */
  .travel-planner .planner-drawer.is-branch-page { left: 0; right: 0; width: 100%; padding: 24px 30px 42px; border-left: 0; box-shadow: none; }
  .travel-planner .planner-drawer.is-branch-page > * { width: min(100%, 940px); margin-right: auto; margin-left: auto; }
  .travel-planner .planner-drawer.is-branch-page > .planner-drawer-head { margin-bottom: 14px; }
}
.flow-branch-nav { grid-row: 2; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 28px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .98); }
.flow-branch-nav-head { display: flex; flex: 0 0 auto; align-items: baseline; gap: 8px; }
.flow-branch-nav-label { flex: 0 0 auto; color: #9a8e83; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
.flow-branch-nav-head strong { color: #bd4f20; font-size: 11px; white-space: nowrap; }
.flow-branch-nav-jump { display: inline-flex; align-items: center; gap: 6px; min-width: 0; margin: 0; color: #8b7c70; font-size: 11px; white-space: nowrap; }
.flow-branch-nav-jump select { min-width: 168px; padding: 7px 28px 7px 10px; border: 1px solid #e8c8b4; border-radius: 999px; background: #fff8f3; color: #955334; font: 700 11px inherit; cursor: pointer; }
.flow-branch-nav-jump select:hover, .flow-branch-nav-jump select:focus-visible { border-color: #e39d72; outline: 2px solid rgba(237, 109, 44, .18); outline-offset: 1px; }
.flow-branch-nav-actions { display: flex; flex: 0 0 auto; gap: 5px; margin-left: auto; }
.flow-branch-nav-actions button { padding: 7px 10px; border: 1px solid #e8c8b4; border-radius: 999px; background: #fff8f3; color: #955334; font: 700 11px inherit; cursor: pointer; white-space: nowrap; }
.flow-branch-nav-actions button:hover, .flow-branch-nav-actions button:focus-visible { border-color: #e39d72; background: #fff1e8; outline: none; }
.flow-branch-nav-actions button:disabled { border-color: #eee8e1; background: #faf8f5; color: #b8aea4; cursor: not-allowed; }
.journey-member-row .journey-member-gap { display: block; margin-top: 5px; color: #a34f29; font-size: 11px; line-height: 1.45; }
.journey-member-impact ul { margin: 10px 0 16px; padding-left: 20px; color: #755f51; font-size: 12px; line-height: 1.7; }
.journey-member-impact li::marker { color: #ed6d2c; }
.flow-workspace-jump { display: inline-flex; align-items: center; gap: 5px; margin: 0; color: #8b7c70; font-size: 11px; white-space: nowrap; }
.flow-workspace-jump select { max-width: 150px; padding: 6px 25px 6px 8px; border: 1px solid #e8c8b4; border-radius: 999px; background: #fff8f3; color: #955334; font: 700 11px inherit; }
.flow-workspace-jump select:focus-visible { outline: 2px solid rgba(237, 109, 44, .45); outline-offset: 2px; }
.journey-flow-progress-step { display: grid; justify-items: start; gap: 7px; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.journey-flow-progress-step:hover span, .journey-flow-progress-step:focus-visible span { color: #9d4a21; text-decoration: underline; text-underline-offset: 3px; }
.journey-flow-progress-step:focus-visible { outline: 2px solid rgba(239, 110, 42, .5); outline-offset: 4px; border-radius: 5px; }
.journey-flow-progress-note { margin: 0 0 -18px; color: #9a897d; font-size: 11px; line-height: 1.5; }
.planner-summary-screen { max-width: 1100px; margin: 0 auto; padding-bottom: 28px; }
.planner-summary-date { flex: 0 0 auto; margin: 0; color: #a85b36; font-size: 12px; font-weight: 800; white-space: nowrap; }
.planner-summary-note { display: grid; gap: 4px; margin: 15px 0; padding: 14px 17px; border: 1px solid #efd8c7; border-radius: 15px; background: #fff8f2; color: #755f51; }
.planner-summary-note b { color: #a84e26; font-size: 13px; }
.planner-summary-note span { font-size: 13px; font-weight: 700; }
.planner-summary-note small { color: #9a897d; font-size: 11px; line-height: 1.5; }
.planner-summary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.planner-summary-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 14px; align-items: center; min-width: 0; padding: 16px 17px; border: 1px solid #eadbd1; border-radius: 16px; background: rgba(255, 253, 250, .9); color: #5e5147; text-align: left; cursor: pointer; }
.planner-summary-card:hover, .planner-summary-card:focus-visible { border-color: #e8a179; background: #fff5ed; outline: none; box-shadow: 0 8px 20px rgba(170, 92, 48, .08); }
.planner-summary-card span, .planner-summary-card em { min-width: 0; }
.planner-summary-card span { display: grid; gap: 4px; }
.planner-summary-card b { color: #4d4037; font-size: 14px; }
.planner-summary-card small, .planner-summary-card em { color: #94857a; font-size: 11px; line-height: 1.45; }
.planner-summary-card em { grid-column: 1; font-style: normal; }
.planner-summary-card i { grid-column: 2; grid-row: 1 / span 2; color: #d56a31; font-size: 18px; font-style: normal; }
.trip-workspace[data-flow-managed="true"] .sheet { width: min(960px, 100%); max-height: min(840px, calc(100vh - 48px)); }
.trip-workspace[data-flow-managed="true"] .sheet-scroll { max-height: min(840px, calc(100vh - 48px)); padding: 24px 34px 34px; }
.trip-workspace[data-flow-managed="true"] { display: grid; place-items: center; padding: 24px; overflow: hidden; background: rgba(31, 25, 18, .46); }
.trip-workspace[data-flow-managed="true"] .sheet { position: relative; width: min(1500px, calc(100vw - 48px)); height: min(860px, calc(100vh - 48px)); max-height: none; overflow: hidden; border: 1px solid rgba(232, 225, 216, .92); border-radius: 26px; background: var(--bg); box-shadow: 0 26px 80px rgba(26, 19, 12, .27); }
.trip-workspace[data-flow-managed="true"] .sheet-scroll { height: 100%; max-height: none; padding: 20px 34px 28px; background: radial-gradient(ellipse at 84% 19%, rgba(247, 188, 142, .13), transparent 42%), linear-gradient(90deg, rgba(255, 250, 246, .5), rgba(255, 253, 251, .82)); }
.trip-workspace[data-flow-managed="true"] .handle { display: none; }
.trip-workspace[data-flow-managed="true"] .sheet-head { position: sticky; top: -20px; z-index: 5; min-height: 72px; margin: -20px -34px 0; padding: 13px 28px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 250, .94); box-shadow: none; }
.trip-workspace[data-flow-managed="true"] .sheet-head h2 { max-width: min(680px, 55vw); overflow: hidden; font-size: 20px; letter-spacing: -.05em; text-overflow: ellipsis; white-space: nowrap; }
.trip-workspace[data-flow-managed="true"] .sheet-head .header-action { border: 1px solid #e8c8b4; border-radius: 999px; background: #fff8f3; padding: 7px 10px; color: #955334; font: 700 12px inherit; text-decoration: none; }
.trip-workspace[data-flow-managed="true"] .sheet-head .header-action:hover { border-color: #e39d72; background: #fff1e8; }
.trip-workspace[data-flow-managed="true"] .sheet-intro { max-width: 920px; margin-right: auto; margin-left: auto; }
.flow-pretrip-screen { max-width: 960px; margin: 0 auto; padding-bottom: 28px; }
.flow-pretrip-screen > .planner-overview-head { margin-bottom: 8px; }
@media (max-width: 700px) {
  .flow-hub-overlay { padding: 0; place-items: end center; }
  .flow-hub-shell { max-height: calc(100vh - 10px); border-radius: 24px 24px 0 0; }
  .flow-hub-scroll { max-height: calc(100vh - 10px); padding: 25px 18px 28px; }
  .flow-branch-grid { grid-template-columns: 1fr; }
  .flow-progress { align-items: stretch; flex-direction: column; gap: 9px; }
  .flow-branch-bar { align-items: stretch; flex-direction: column; }
  .flow-branch-bar-actions { justify-content: stretch; }
  .flow-branch-bar-actions button { flex: 1; }
  .flow-planner-bar { order: -1; }
  .flow-branch-nav { align-items: stretch; flex-direction: column; gap: 7px; padding: 9px 15px; }
  .flow-branch-nav-head { justify-content: space-between; }
  .journey-document-capture-head { align-items: stretch; flex-direction: column; }
  /* 手機寬度縮圖直接全寬顯示，比並排的小圖更容易看清剛拍的證件內容。 */
  .journey-document-capture-item { grid-template-columns: 1fr; }
  .journey-document-capture-preview { width: 100%; height: 180px; }
  .flow-branch-nav-actions { width: 100%; margin-left: 0; }
  .flow-branch-nav-actions button { flex: 1; }
  .flow-impact-note--planner { align-items: stretch; flex-direction: column; margin: 12px 18px 10px; }
  /* 直向排列時 flex-basis 會變成高度，必須重設，否則提示會被撐高。 */
  .flow-impact-note--planner > div:first-child { flex: 0 0 auto; }
  .flow-impact-actions { justify-content: flex-start; }
  .planner-branch-context { align-items: flex-start; flex-wrap: wrap; gap: 4px 8px; }
  .planner-branch-context small { flex-basis: 100%; margin-left: 0; }
  .travel-planner.is-branch-mode .planner-drawer.is-branch-page { position: static; height: auto; max-height: none; min-height: 0; padding: 14px 15px 30px; border-radius: 0; overflow-y: auto; }
  .travel-planner.is-branch-mode .planner-drawer.is-branch-page > * { width: 100%; }
  .travel-planner.is-branch-mode .planner-drawer.is-branch-page > .planner-drawer-head { top: -14px; margin: 0 -15px 14px; padding: 14px 15px 12px; }
  .planner-summary-screen { padding-bottom: 18px; }
  .planner-summary-head, .planner-summary-screen .planner-overview-head { display: grid; align-items: start; }
  .planner-summary-date { white-space: normal; }
  .planner-summary-grid { grid-template-columns: 1fr; }
  .flow-branch-nav-jump { flex: 1; justify-content: space-between; }
  .flow-branch-nav-jump select { min-width: 0; width: min(230px, 62vw); }
  .trip-workspace[data-flow-managed="true"] { display: block; padding: 0; }
  .trip-workspace[data-flow-managed="true"] .sheet { width: 100%; height: 100dvh; max-height: 100dvh; border: 0; border-radius: 0; }
  .trip-workspace[data-flow-managed="true"] .sheet-scroll { height: 100%; max-height: 100dvh; padding: 14px 18px 28px; }
  .trip-workspace[data-flow-managed="true"] .sheet-head { top: -14px; margin: -14px -18px 0; min-height: 64px; padding: 11px 15px; }
  .trip-workspace[data-flow-managed="true"] .sheet-head h2 { max-width: none; font-size: 17px; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-bar .planner-top-link { min-width: 34px; min-height: 34px; padding: 6px 3px; font-size: 0; text-decoration: none; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-bar .planner-top-link::after { font-size: 10px; line-height: 1; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-bar [data-flow-workspace-prev]::after { content: '上一步'; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-bar [data-flow-workspace-hub]::after { content: '分支'; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-bar [data-flow-workspace-next]::after { content: '下一步'; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-jump { flex: 1; justify-content: center; }
  .trip-workspace[data-flow-managed="true"] .flow-workspace-jump select { max-width: 122px; }
  /* 手機字級與觸控：導覽、影響提示與摘要卡不得小於 12px；
     主要操作點擊面積至少 44px，避免肥手指誤觸。 */
  .flow-branch-nav-label { font-size: 12px; }
  .flow-branch-nav-head strong { font-size: 13px; }
  .flow-branch-nav-jump { gap: 8px; font-size: 13px; }
  .flow-branch-nav-jump select { min-height: 44px; padding: 11px 30px 11px 14px; font-size: 14px; }
  .flow-branch-nav-actions { gap: 8px; }
  .flow-branch-nav-actions button { min-height: 44px; padding: 10px 12px; font-size: 14px; }
  .flow-impact-note--planner > div:first-child span { font-size: 13px; }
  .flow-impact-actions { gap: 8px; }
  .flow-impact-actions button { min-height: 40px; padding: 9px 13px; font-size: 13px; }
  .journey-member-row .journey-member-gap { font-size: 13px; }
  .planner-summary-note small { font-size: 13px; }
  .planner-summary-card b { font-size: 15px; }
  .planner-summary-card small, .planner-summary-card em { font-size: 12px; }
  .planner-branch-context { font-size: 12px; }
  .planner-branch-context strong { font-size: 13px; }
  .planner-drawer-head .planner-drawer-return { min-height: 42px; padding: 9px 14px; font-size: 13px; }
  .travel-planner.is-branch-mode .planner-drawer.is-branch-page > .planner-drawer-head h3 { font-size: 21px; }
  .journey-document-capture-head small, .journey-document-capture-empty, .journey-document-capture-copy small { font-size: 12px; }
  .journey-document-capture-actions button, .journey-document-capture-ocr-actions button, .journey-document-saved-page-actions button { min-height: 40px; padding: 8px 6px; font-size: 13px; }
  .journey-document-capture-edit summary { padding: 8px 0; font-size: 12px; }
  .journey-document-capture-crop, .journey-document-capture-ocr, .journey-document-capture-edit > small, .journey-document-saved-page-edit label { font-size: 12px; }
  .journey-booking-row-actions button { min-height: 40px; padding: 8px 6px; font-size: 13px; }
}
