main,dialog{overflow-wrap:anywhere}
main :where(.row,.row-actions,.section-head,.j-section-head,.clip-actions,.j-page-head),dialog :where(.row,.row-actions,.dialog-actions,.clip-actions){flex-wrap:wrap}
main :where(.row,.row-actions,.section-head,.j-section-head,.j-page-head,.trip-postcard,.fare-card-head,.stop-card)>*,
dialog :where(.row,.row-actions,.dialog-actions,.clip-actions)>*{min-width:0}
main :where(.chip,.primary,.secondary),dialog :where(.chip,.primary,.secondary){max-width:100%}
main :where(.chip,.primary,.secondary),dialog :where(.primary,.secondary){white-space:normal}
.fare-card-head>div:first-child{min-width:0;flex:1}
.fare-card-head .fare-amount{max-width:49%}
.fare-table th,.fare-table td{overflow-wrap:anywhere}
.stop-content,.stop-info,.trip-postcard-caption,.overview-stay span{min-width:0}
.stop-transit{width:fit-content;max-width:min(100%,490px)}
.stop-transit svg{flex-shrink:0}
.place-note-body :where(.row-actions,.secondary){min-width:0}
.trip-postcard{min-height:310px;padding-top:75px}
.trip-postcard-caption{width:100%}
.postbox-home .journal-hero{
 display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;
}
.postbox-home .journal-hero>div:first-child{max-width:none;min-width:0}
.postbox-home .journal-hero .hero-capture{
 position:relative;inset:auto;transform:none;justify-self:end;margin-right:10px;
}
.postbox-home .journal-hero .hero-capture .primary{white-space:nowrap}
.journal-header-actions{flex-shrink:0}
.j-section-head .j-shortcuts{max-width:100%;flex-wrap:wrap}
.j-section-head .j-shortcuts button{flex-shrink:0}
#dialog{overscroll-behavior:contain;scroll-padding-block:12px}
#dialog :where(.field,.form-grid) input,#dialog select,#dialog textarea{width:100%;min-width:0}
.route-board{display:flex;flex-direction:column}
.route-canvas{flex:none;width:100%}
.route-footer{
 display:flex;justify-content:space-between;align-items:center;gap:6px 10px;flex-wrap:wrap;
 min-width:0;padding:4px 3px 0;
}
.route-pages{display:flex;align-items:center;gap:4px;justify-content:flex-end;margin-left:auto;font-size:11px;white-space:nowrap}
.route-pages button{border:1px solid var(--line);border-radius:7px;background:var(--white);min-width:32px;min-height:33px}
.route-pages button:disabled{opacity:.44;cursor:default}
.route-marker{width:min(26%,128px);max-width:none}
.route-marker b{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.route-board.route-collapsed .route-canvas{height:0;visibility:hidden}
.route-board.route-collapsed .route-expand{position:static;align-self:flex-end}
@media(max-width:540px){
 .trip-postcard{min-height:231px;padding-top:62px}
 .postbox-home .journal-hero{gap:8px}
 .postbox-home .journal-hero .hero-capture{margin-right:0}
 .place-note-body .row-actions{gap:4px}
 #dialog{padding:16px;max-height:calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom))}
}
@media(max-width:420px){
 .places-grid{grid-template-columns:1fr}
 .places-grid .place-note img{height:132px}
}
@media(max-width:350px){
 .trip-overview .spot-grid,.workspace #main>.spot-grid{grid-template-columns:1fr}
 .fare-card-head .fare-amount{max-width:100%}
 .stop-card{gap:3px}
 .j-section-head .j-shortcuts{gap:3px}
}
.postbox-home .journal-hero .hero-capture .primary{width:max-content;max-width:none;justify-content:center}
.postbox-home .journal-hero .hero-capture svg{flex-shrink:0}
.day-tickets{scroll-snap-type:x proximity}
.day-ticket{scroll-snap-align:start}
@media(max-width:360px){
 [data-surface=trip] #nav .nav-link{padding-inline:6px;font-size:11px;flex:1 0 auto}
}
.postbox-home .journal-hero .hero-capture{max-width:none}

/* Native date controls can keep an intrinsic width in iOS WebKit. */
.field-native-date,.field-native-date input{min-inline-size:0;max-inline-size:100%}
.field-native-date input{
 display:block;inline-size:100%;box-sizing:border-box;margin:0;text-align:left;
 -webkit-appearance:none;appearance:none;
}
.field-native-date input::-webkit-date-and-time-value{min-inline-size:0;text-align:left}
.field-native-date input::-webkit-datetime-edit{min-inline-size:0;padding:0}
.offer-search-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,132px),1fr))}
.offer-search-grid .field{min-inline-size:0}
.offer-author{display:block}
.fare-card-head .stay-chosen{display:inline-block;margin-top:4px}
@media(max-width:540px){
 .offer-search-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .offer-search-grid .field-native-date,.offer-search-grid .offer-query{grid-column:1/-1}
 .form-grid>.field-native-date:has(input[type=datetime-local]){grid-column:1/-1}
}
.schedule-warning,.offline-note{
 color:var(--ink);background:var(--accent-soft);border-radius:8px;padding:6px 9px;margin:6px 0;font-size:12px;
}
.proposal-details{display:flex;flex-wrap:wrap;gap:5px 10px;margin:5px 0}
.proposal-details small{color:var(--muted)}
.expense-people{min-width:0;border:1px solid var(--line);border-radius:10px;padding:8px}
.expense-person{display:grid;grid-template-columns:auto 1fr minmax(0,75px);align-items:center;gap:8px;padding:5px}
.expense-person input[type=number]{width:100%;min-width:0}
.expense-person input:disabled{visibility:hidden}
.today-section{margin:0 0 16px}
.today-section>h2{font-size:20px;margin-bottom:8px}
.today-trip{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px}
.today-trip p{margin:2px 0 0}
.screenshot-picker{padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--white)}
.screenshot-picker summary{cursor:pointer;font-weight:750}
.screenshot-options{display:grid;gap:8px;margin-top:9px}
.screenshot-options p{margin:0;font-size:12px}
.screenshot-status:empty{display:none}
.screenshot-clues{margin-top:12px}
.screenshot-clues h3{font-size:15px}
.trip-header-tools{display:flex;align-items:center;gap:7px}
.trip-header-tools .j-icon{width:36px;height:36px}
.trip-header-tools .j-icon svg{width:18px;height:18px}
.overview-tools{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:10px}
[data-project-type=travel][data-surface=trip] #nav .nav-link{padding-inline:3px;min-width:0}
@media(max-width:390px){
 .trip-header-tools{gap:4px}
 .trip-header-tools .j-icon{width:30px;height:30px}
 .trip-header-tools .j-icon svg{width:16px;height:16px}
 .trip-header-tools .primary{padding-inline:7px;gap:3px}
 .trip-header-tools .primary svg{width:14px;height:14px}
 [data-project-type=travel][data-surface=trip] #nav .nav-link{font-size:11px}
}
[data-surface=journal] .journal-header-simple{justify-content:flex-end}
.journal-header-simple .secondary{height:36px;padding:5px 9px}
.journal-header-simple .secondary svg{width:16px;height:16px}
.overview-agenda ol{margin:0;padding:0;list-style:none;display:grid;gap:7px}
.overview-agenda li{display:grid;grid-template-columns:48px minmax(0,1fr);gap:8px;align-items:start}
.overview-agenda time,.overview-agenda small{font-size:12px;color:var(--muted)}
.overview-agenda li small{display:block}
.overview-choices{display:grid;gap:8px;grid-template-columns:repeat(2,minmax(0,1fr))}
.overview-choices .overview-stay{margin:0;box-shadow:none}
.overview-weather [data-weather-content]>p{margin-bottom:0}
.weather-meta{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px 10px;margin-top:10px}
.weather-meta a{text-decoration:underline}
@media(min-width:700px){
 .overview-bookings{grid-column:1/-1}
}
@media(max-width:375px){
 .overview-choices{grid-template-columns:1fr}
}
.in-motion,.travel-wallet,.trip-changes,.travel-memories{margin-block:12px}
.in-motion h3{font-size:21px}
.travel-wallet .ticket-entry{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;padding:12px 0;border-top:1px dashed var(--line)}
.ticket-entry p{margin:2px 0 8px}
.ticket-entry small,.memory-note small{color:var(--muted);font-size:11px}
.show-ticket-copy{font-size:22px;user-select:text}
.walking-map{width:100%;height:auto;min-height:138px;background:#e3eadd;border-radius:7px;margin:8px 0}
[data-walking-result]{margin-top:12px}
.memory-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,150px),1fr));gap:8px}
.memory-note{display:grid;gap:4px;padding:9px;border:1px solid var(--line);border-radius:8px}
.memory-note img{width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;border-radius:5px}
.weather-rain{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.weather-rain span{font-size:12px;background:var(--accent-soft);padding:3px 6px;border-radius:6px}
.trip-overview>.overview-weather{margin:0 0 12px}
[data-surface=trip][data-trip-role=view] :is(
 [data-action=edit],[data-action=add-spot],[data-action=add-expense],
 [data-action=add-offer],[data-personal=trip-offer-import],[data-action=edit-flight-offer],[data-action=edit-stay-offer],
 [data-action=choose-offer],[data-action=review-offer],[data-action=import-stop],[data-action=remove],
 [data-action=sort-stop-menu],[data-action=remove-stop],[data-action=mark-paid],[data-action=task-done],[data-action=vote-spot]
){display:none}
[data-surface=trip][data-trip-role=view] [data-action=bingo]{pointer-events:none}
.transit-plans{display:grid;gap:5px;margin-top:9px}
.transit-plans details{padding:8px;border:1px solid var(--line);border-radius:7px}
.transit-plans li small{display:block;color:var(--muted)}
.trip-progress-summary{font-size:12px;color:var(--muted);margin:4px 0 10px}
.trip-progress-summary span{font-weight:750;color:var(--accent-ink)}
.trip-progress-actions{margin:5px 0 10px}
.stop-progress-row{display:flex;margin-top:5px}
.stop-progress-chip{display:inline-flex;align-items:center;gap:3px;border:1px solid var(--line);border-radius:14px;padding:2px 9px;font-size:11px;color:var(--muted);background:var(--white)}
.stop-progress-chip.visited{color:var(--tag-place-ink);background:var(--tag-place)}
.stop-progress-chip.skipped{color:var(--tag-food-ink);background:var(--tag-food)}
button.stop-progress-chip{min-height:30px;cursor:pointer}
.prep-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:12px 0}
.prep-check-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 2px;border-bottom:1px solid var(--line)}
.prep-check-row:last-child{border-bottom:0}
.prep-check-row small,.prep-item small{color:var(--muted);font-size:12px}
.prep-check-status{color:var(--accent);font-weight:850}
.prep-item label{display:flex;align-items:flex-start;flex:1;min-width:0;gap:8px}
.prep-item input{accent-color:var(--accent);flex:none;margin-top:4px}
.packing-group h3{font-size:15px;margin-top:12px;color:var(--accent-ink)}
.shopping-check{display:flex;align-items:flex-start;gap:6px}
.shopping-check input{flex:none;margin-top:5px;accent-color:var(--accent)}
.shopping-check input:checked+b{color:var(--muted);text-decoration:line-through}
.shopping-status{align-items:center}
.shopping-status>span{font-size:12px;color:var(--muted)}
[data-trip-role=view] [data-action=edit-expense]{display:none}
.booking-attention time{font-size:13px;color:var(--accent-ink)}
.memory-note .row-actions{gap:4px}
.memory-note .row-actions>.secondary{padding-inline:6px}

/* Trip notebook header and two quiet reading surfaces. */
[data-project-type=travel][data-surface=trip] .topbar {
 padding:calc(9px + env(safe-area-inset-top)) 20px 5px;
 min-height:49px;
}
[data-project-type=travel][data-surface=trip] .sidebar {
 padding:4px max(20px,calc((100vw - 850px)/2)) 7px;
 border:0;
 box-shadow:none;
}
[data-project-type=travel][data-surface=trip] #nav {
 grid-template-columns:repeat(5,minmax(0,1fr));
 padding:2px;
}
[data-project-type=travel][data-surface=trip] #nav .nav-link {
 height:37px;
 width:min(100%,68px);
 justify-self:center;
 border:0;
 border-radius:999px;
 box-shadow:none;
 font-size:14px;
}
[data-project-type=travel][data-surface=trip] #nav .nav-link:not([aria-current=page]){
 background:transparent;
}
[data-project-type=travel][data-surface=trip] #nav .nav-link:not([aria-current=page]):hover{
 background:var(--accent-soft);
}
[data-project-type=travel][data-surface=trip] .project-switch {
 background:transparent;
 border:0;
 box-shadow:none;
 padding:4px 0;
 min-height:40px;
 min-width:0;
}
[data-project-type=travel][data-surface=trip] #back-to-journal{flex:none}
.trip-party{
 display:flex;
 align-items:center;
 gap:4px;
 min-height:38px;
 border-radius:999px;
 padding:3px 5px;
 background:var(--white);
 box-shadow:var(--paper-shadow);
}
.trip-party .avatars{padding:0}
.trip-party .avatar{width:25px;height:25px;font-size:10px;margin-left:-6px}
.trip-party .party-invite{display:grid;place-items:center;width:25px;height:25px;color:var(--sheet);border-radius:50%}
.trip-party .party-invite:hover{background:var(--accent-soft)}
.trip-party .party-invite svg{width:14px;height:14px}
.trip-header-tools .j-icon:disabled{opacity:.45}
#trip-header-action .primary{box-shadow:none}
.trip-overview{display:grid;gap:12px}
.trip-overview .trip-postcard{min-height:clamp(182px,43vw,275px);padding:51px 14px 14px;border-width:6px}
.trip-overview .overview-tape{width:72px;height:19px}
.trip-overview .overview-edit{padding:0;width:36px;height:36px;min-height:0}
.trip-overview .trip-overview-meta{margin-top:6px;gap:8px}
.trip-overview-meta .avatar{width:26px;height:26px;font-size:10px}
.trip-overview>.overview-weather,.trip-overview>.prep-links,.trip-overview>.overview-bookings{margin:0}
.overview-weather,.prep-summary-card,.overview-agenda li,.overview-extras{
 background:var(--white);
 border-radius:12px;
 box-shadow:var(--paper-shadow);
}
.overview-weather summary,.overview-extras>summary{cursor:pointer}
.weather-disclosure summary{
 display:flex;
 align-items:center;
 justify-content:space-between;
 gap:8px;
 min-height:45px;
 padding:8px 12px;
 list-style:none;
}
.weather-disclosure summary::-webkit-details-marker{display:none}
.weather-disclosure summary>span{display:flex;align-items:center;gap:7px;min-width:0;font-size:13px}
.weather-disclosure summary svg{color:var(--sheet);width:19px;height:19px;flex:none}
.weather-disclosure summary small{flex:none;color:var(--muted);font-size:12px}
.weather-detail{padding:0 12px 10px;font-size:12px;color:var(--muted)}
.overview-weather [data-weather-content]>p{padding:11px 12px;font-size:13px}
.overview-weather [data-action=weather-retry]{margin:0 12px 10px}
.prep-summary-card{display:grid;gap:9px;padding:11px 12px}
.prep-summary-card>span{display:flex;align-items:baseline;justify-content:space-between;gap:5px;font-size:14px}
.prep-summary-card small{color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.prep-summary-card progress{width:100%;height:4px;appearance:none;border:0;border-radius:8px;background:var(--accent-soft);color:var(--sheet)}
.prep-summary-card progress::-webkit-progress-bar{background:var(--accent-soft);border-radius:8px}
.prep-summary-card progress::-webkit-progress-value{background:var(--sheet);border-radius:8px}
.prep-summary-card progress::-moz-progress-bar{background:var(--sheet);border-radius:8px}
.overview-agenda .section-head{margin:0 0 7px}
.overview-agenda .section-head h2{font-size:18px;margin:0}
.overview-agenda li{
 grid-template-columns:42px 38px minmax(0,1fr);
 align-items:center;
 padding:8px 11px;
 overflow-wrap:anywhere;
}
.overview-agenda li .stop-thumb,.overview-agenda li .stop-thumb>*{width:38px;height:38px}
.overview-extras{padding:10px 12px}
.overview-extras>summary{font-size:14px;font-weight:750}
.itinerary .day-tickets{gap:4px;margin-bottom:12px}
.itinerary .day-ticket{min-height:48px;flex-basis:max(calc((100% - 16px)/5),53px);outline:none;box-shadow:none;border:0;border-radius:9px}
.itinerary .day-ticket:not([aria-pressed=true]){background:transparent;color:var(--muted)}
.itinerary .day-ticket b{font-size:17px}
.itinerary .day-ticket span{font-size:12px}
.itinerary .day-ticket:focus-visible{outline:2px solid var(--accent-ink);outline-offset:-2px}
.itinerary .route-board{top:48px}
.timeline-head{margin-bottom:8px}
.timeline-head h2{margin:0;font-size:20px}
.timeline-progress{font-size:12px;color:var(--muted);white-space:nowrap}
.timeline-stop{scroll-margin-top:145px}
.timeline-stop .stop-card{
 display:grid;
 grid-template-columns:42px 42px minmax(0,1fr);
 gap:8px;
 justify-content:initial;
 -webkit-tap-highlight-color:transparent;
}
.timeline-stop .stop-time{align-self:center;padding:0}
.timeline-stop .stop-info small{overflow-wrap:anywhere}
.timeline-stop .stop-thumb,.timeline-stop .stop-thumb>*{width:42px;height:42px}
#dialog.stop-sheet{
 inset:auto 0 0;
 margin:0 auto;
 width:min(100%,520px);
 max-height:85dvh;
 border-radius:18px 18px 0 0;
 padding-bottom:calc(16px + env(safe-area-inset-bottom));
}
.stop-sheet-actions{flex-wrap:wrap;margin-top:10px}
@media(max-width:540px){
 [data-project-type=travel][data-surface=trip] .topbar{padding-inline:14px}
 [data-project-type=travel][data-surface=trip] .sidebar{padding-inline:14px}
 .trip-header-tools .j-icon{width:38px;height:38px}
 .trip-overview .trip-postcard-caption h1{font-size:26px}
}
@media(max-width:350px){
 .trip-party .avatars .avatar:nth-child(n+4){display:none}
 .weather-disclosure summary>span{font-size:12px}
}
.route-dialog .route-board>.secondary{max-width:calc(100% - 24px)}

/* 規格色票：移除舊版紫色的焦點框、提示與空狀態 */
:root[data-surface] :is(button,a,input,select,textarea,summary):focus-visible{outline:2px solid var(--accent-ink,#405B70);outline-offset:2px}
:root[data-surface] :is(input,select,textarea):focus-visible{outline-offset:0}
:root[data-surface] #toast{
 left:50%;right:auto;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);
 bottom:calc(16px + env(safe-area-inset-bottom));
 background:#26323C;color:#FAF9F6;border:0;border-radius:999px;padding:10px 16px;box-shadow:0 6px 18px #26323c2e;text-align:center;z-index:30;
}
/* 個人區有底部工具列時，提示浮在工具列上方 */
:root[data-surface=journal] #toast{bottom:calc(96px + env(safe-area-inset-bottom))}
:root[data-surface] .j-empty{background:var(--paper,#EFECE6);border:1px dashed var(--line,#DEDAD2);color:var(--muted,#5C6B77)}
:root[data-surface] .empty{background:var(--accent-soft);color:var(--muted)}
.date-hint{display:block;margin-top:4px;color:#9a4a3a;font-size:12px;font-weight:650;line-height:1.4}
input[aria-invalid=true]{border-color:#c98a7b}

/* 日期列：手機露出下一張的一半，並在可捲動的一側加淡出，提示還有其他天 */
.itinerary .day-ticket{flex:0 0 max(calc((100% - 20px)/5.4),53px)}
.itinerary .day-tickets.more-after{-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 36px),transparent)}
.itinerary .day-tickets.more-before{-webkit-mask-image:linear-gradient(90deg,transparent,#000 36px);mask-image:linear-gradient(90deg,transparent,#000 36px)}
.itinerary .day-tickets.more-before.more-after{-webkit-mask-image:linear-gradient(90deg,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(90deg,transparent,#000 36px,#000 calc(100% - 36px),transparent)}
@media(min-width:700px){.itinerary .day-ticket{flex:1 0 84px}}

/* 旅行資訊：自訂展開箭頭，取代瀏覽器預設三角形 */
.overview-extras>summary{list-style:none;display:flex;align-items:center;gap:10px;font-weight:800}
.overview-extras>summary::-webkit-details-marker{display:none}
.overview-extras>summary small{flex:1;min-width:0;color:var(--muted);font-weight:500;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.overview-extras>summary svg{width:18px;height:18px;color:var(--muted);transition:transform .2s}
.overview-extras[open]>summary svg{transform:rotate(90deg)}
.trip-phrases-entry{display:flex;align-items:center;justify-content:space-between;gap:12px}
.trip-phrases-entry h2{font-size:16px}.trip-phrases-entry p{font-size:12px;color:var(--muted)}
