/* EatPlan MTP Skin — AppKit ep14 look for Member Travel Planner. Scoped to body.epmtp-app. */
body.epmtp-app {
	/* Everything maps onto MTP 1.1.0's --mtp-* tokens (which themselves follow AppKit ep14). */
	--epmtp-shadow-sheet: 0 -10px 40px rgba(20, 45, 35, .22);
	--epmtp-bar-h: calc(56px + env(safe-area-inset-top, 0px));
	--epmtp-nav-h: var(--mtp-tabbar-h, calc(65px + env(safe-area-inset-bottom, 0px)));
	--epmtp-col: 720px;
	--epmtp-ease: cubic-bezier(.2, .8, .2, 1);
	background: var(--mtp-sand, #f5f8f6) !important;
	color: var(--mtp-text, #3f5149);
	overflow-x: hidden;
	overflow-x: clip;
}
/* Standalone ?mtp_app=1 screen: no theme bottom nav, only the home-indicator inset. */
body.epmtp-app.epmtp-standalone { --epmtp-nav-h: env(safe-area-inset-bottom, 0px); }
body.epmtp-app.epmtp-standalone.epmtp-has-tabs { --epmtp-nav-h: calc(64px + env(safe-area-inset-bottom, 0px)); }
/* App bottom tab bar on the standalone screen (mirrors AppKit .eatplan-bottom-nav) */
.epmtp-tabs {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 97; display: flex; box-sizing: border-box;
	padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
	background: rgba(247, 250, 248, .94); border-top: 1px solid var(--mtp-line, #dce8e2);
	-webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
	font-family: var(--mtp-font, system-ui, sans-serif);
}
.epmtp-tabs a {
	flex: 1 1 0; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
	color: #52675e !important; text-decoration: none !important; font-size: 10px; line-height: 1.2; -webkit-tap-highlight-color: transparent;
}
.epmtp-tabs a span { opacity: .82; }
.epmtp-tabs svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.epmtp-tabs a.is-on { color: var(--mtp-ink, #254b40) !important; font-weight: 700; }
.epmtp-tabs a.is-on svg { color: var(--mtp-accent, #527b6b); }
.epmtp-tabs a.is-on span { opacity: 1; }
.epmtp-tabs a:focus-visible { outline: 3px solid var(--mtp-focus, #8aa995); outline-offset: -3px; }
html.mtp-modal-open .epmtp-tabs { display: none; }
@media (min-width: 768px) { .epmtp-tabs { left: 50%; right: auto; width: min(100%, 620px); transform: translateX(-50%); } }
html:has(body.epmtp-app) { overflow-x: hidden; overflow-x: clip; background: var(--mtp-sand); }

/* ---- Hide the bulky theme chrome on the planner page only ---- */
body.epmtp-app #header,
body.epmtp-app header#header,
body.epmtp-app .entry-header,
body.epmtp-app .hero-section,
body.epmtp-app .ct-trending-block { display: none !important; }
/* The theme's App-style bottom nav lives inside #footer: keep it, hide the rest of the footer. */
body.epmtp-app #footer { padding: 0 !important; margin: 0 !important; border: 0 !important; min-height: 0 !important; background: none !important; }
body.epmtp-app #footer > *:not(.ep-magazine-bottom-nav) { display: none !important; }
body.epmtp-app #main-container,
body.epmtp-app #main,
body.epmtp-app .ct-container-full,
body.epmtp-app .entry-content,
body.epmtp-app article.page { padding: 0 !important; margin: 0 !important; max-width: none !important; background: transparent !important; }
body.epmtp-app .entry-content > * { max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; }
body.epmtp-app #main-container { padding-top: var(--epmtp-bar-h) !important; }
body.epmtp-app.epmtp-standalone { padding-top: var(--epmtp-bar-h); margin: 0; }
body.epmtp-app.epmtp-standalone .mtp-slot.is-app { padding-top: 0; }

/* ---- 56px App bar ---- */
.epmtp-bar {
	position: fixed; top: 0; left: 0; right: 0; z-index: 99;
	display: flex; align-items: center; gap: 4px;
	box-sizing: border-box;
	height: var(--epmtp-bar-h);
	padding: env(safe-area-inset-top, 0px) max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
	background: rgba(247, 250, 248, .96);
	border-bottom: 1px solid var(--mtp-line);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
	font-family: var(--mtp-font);
}
.admin-bar .epmtp-bar { top: 32px; }
.epmtp-bar-btn {
	display: inline-flex; align-items: center; justify-content: center;
	flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
	color: var(--mtp-ink, #254b40) !important; text-decoration: none;
}
.epmtp-bar-btn:active { background: rgba(37, 75, 64, .08); }
.epmtp-bar-btn:focus-visible { outline: 3px solid var(--mtp-focus); outline-offset: -3px; }
.epmtp-bar-title {
	flex: 1 1 auto; min-width: 0; margin: 0 !important; padding: 0 4px;
	font: 600 17px/1.2 var(--mtp-font) !important; color: var(--mtp-ink) !important;
	text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0 !important;
}

/* ---- Planner root ---- */
body.epmtp-app .mtp-slot, body.epmtp-app .entry-content > .mtp-slot { max-width: var(--epmtp-col) !important; margin: 0 auto !important; padding: 0 0 calc(var(--epmtp-nav-h) + 96px); }
body.epmtp-app .mtp {
	background: transparent; border-radius: 0; padding: 0;
	font-family: var(--mtp-font); font-size: 15px; line-height: 1.6; color: var(--mtp-text);
	max-width: 100%; overflow-x: hidden; overflow-x: clip;
}
body.epmtp-app .mtp h2, body.epmtp-app .mtp h3, body.epmtp-app .mtp-modal h2 {
	font-family: var(--mtp-font) !important; font-weight: 600; letter-spacing: 0; color: var(--mtp-ink);
}
html.epmtp-on .mtp .mtp-top { display: none !important; } /* greeting block replaced by the 56px App bar */
body.epmtp-app .mtp-offline { margin: 8px 12px 0; border-radius: var(--mtp-radius, 12px); }
body.epmtp-app .mtp-form-error, body.epmtp-app .mtp-form-warn { border-radius: var(--mtp-radius, 12px); }

/* Sticky segmented control */
body.epmtp-app .mtp-tabs {
	position: sticky; top: var(--epmtp-bar-h); z-index: 6;
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
	margin: 0; padding: 8px 12px;
	background: rgba(245, 248, 246, .96);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
body.epmtp-app.admin-bar .mtp-tabs { top: calc(var(--epmtp-bar-h) + 32px); }
body.epmtp-app .mtp-tabs::before {
	content: ""; position: absolute; inset: 8px 12px; border-radius: 12px; background: #e6eeea; z-index: -1;
}
body.epmtp-app .mtp-tab {
	min-height: 40px; margin: 3px; border: 0; border-radius: 10px; background: transparent;
	font-size: 15px; font-weight: 600; color: var(--mtp-muted); transition: background .18s, color .18s, box-shadow .18s;
}
body.epmtp-app .mtp-tab.is-on { background: #fff; color: var(--mtp-ink); box-shadow: 0 1px 4px rgba(37, 75, 64, .14); }
body.epmtp-app .mtp-error { margin: 8px 12px; border-radius: 12px; }

body.epmtp-app .mtp-layout { gap: 0; }
body.epmtp-app .mtp-panel { background: transparent; border: 0; border-radius: 0; padding: 4px 0 0; }
body.epmtp-app .mtp-panel > h3 { display: none; }

/* Buttons */
body.epmtp-app .mtp-btn, body.epmtp-app .mtp-modal .mtp-btn, .epmtp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid transparent;
	background: var(--mtp-accent); color: #fff; font: 600 14px/1 var(--mtp-font); cursor: pointer;
	text-decoration: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
body.epmtp-app :is(.mtp-btn, .epmtp-btn):not(.mtp-btn-ghost):not(.epmtp-btn-ghost):not(.mtp-btn-danger), body.epmtp-app :is(.mtp-btn, .epmtp-btn):not(.mtp-btn-ghost):not(.epmtp-btn-ghost):not(.mtp-btn-danger):is(:hover, :focus, :active) { color: #fff !important; }
body.epmtp-app .mtp-btn:hover, body.epmtp-app .mtp-modal .mtp-btn:hover, .epmtp-btn:hover { background: var(--mtp-accent-dark); color: #fff; }
body.epmtp-app .mtp-btn-ghost, body.epmtp-app .mtp-modal .mtp-btn-ghost, .epmtp-btn-ghost {
	background: #fff; color: var(--mtp-ink); border-color: var(--mtp-line);
}
body.epmtp-app .mtp-btn-ghost:hover, body.epmtp-app .mtp-modal .mtp-btn-ghost:hover, .epmtp-btn-ghost:hover { background: var(--mtp-soft); color: var(--mtp-ink); }
body.epmtp-app .mtp-btn-danger, body.epmtp-app .mtp-modal .mtp-btn-danger { background: #fff; color: var(--mtp-danger); border-color: #ecd3cd; }
body.epmtp-app .mtp-btn-danger:hover, body.epmtp-app .mtp-modal .mtp-btn-danger:hover { background: #fbefec; color: var(--mtp-danger); }
body.epmtp-app :is(.mtp, .mtp-modal) :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 3px solid var(--mtp-focus); outline-offset: 2px; }
.epmtp-link { border: 0; background: none; padding: 0 4px; min-height: 44px; color: var(--mtp-accent); font: 600 14px var(--mtp-font); cursor: pointer; }
.epmtp-muted { color: var(--mtp-muted); }
.epmtp-pad { padding: 4px 14px 8px; margin: 0; font-size: 14px; }
.epmtp-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.epmtp-chev { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 18px; transition: transform .22s var(--epmtp-ease); color: var(--mtp-subtle); }

.epmtp-private { display: flex; align-items: center; gap: 6px; margin: 2px 16px 8px; font-size: 12px; color: var(--mtp-muted); }
.epmtp-private svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ---- Plans carousel ---- */
body.epmtp-app [data-plans].epmtp-carousel {
	display: flex; gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory; scroll-padding: 0 16px; padding: 4px 16px 12px;
	-webkit-overflow-scrolling: touch; scrollbar-width: none;
}
body.epmtp-app [data-plans].epmtp-carousel::-webkit-scrollbar { display: none; }
body.epmtp-app [data-plans].epmtp-carousel > .mtp-card {
	flex: 0 0 min(84%, 360px); scroll-snap-align: center; margin: 0;
	display: flex; flex-direction: column; gap: 0;
	border: 0; border-radius: 16px; background: #fff; overflow: hidden;
	box-shadow: var(--mtp-shadow); outline: 2px solid transparent; outline-offset: -2px;
	transition: transform .25s var(--epmtp-ease), box-shadow .25s, outline-color .2s;
}
body.epmtp-app [data-plans].epmtp-carousel.is-single > .mtp-card { flex-basis: 100%; }
body.epmtp-app [data-plans].epmtp-carousel > .mtp-card:not(.is-on) { transform: scale(.96); box-shadow: 0 2px 8px rgba(46, 77, 62, .06); }
body.epmtp-app [data-plans].epmtp-carousel > .mtp-card.is-on { outline-color: var(--plan, var(--mtp-accent)); box-shadow: 0 8px 22px rgba(37, 75, 64, .14); }
body.epmtp-app .mtp-card .mtp-cover {
	position: relative; aspect-ratio: 16 / 9; height: auto !important; min-height: 0; width: 100%;
	background: linear-gradient(135deg, var(--plan, #527b6b), #2f5546); color: #fff; font-size: 40px; font-weight: 600;
}
body.epmtp-app .mtp-card .mtp-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
body.epmtp-app .mtp-card-body { padding: 12px 14px 12px; }
body.epmtp-app .mtp-card h3 { font-size: 17px; line-height: 1.35; }
body.epmtp-app .mtp-status { font-size: 12px; padding: 2px 9px; background: var(--mtp-soft); color: var(--mtp-ink); }
body.epmtp-app .mtp-status-booked { background: #dcefe6; }
body.epmtp-app .mtp-status-planning { background: #fbefd2; color: #6d5316; }
body.epmtp-app .mtp-dest, body.epmtp-app .mtp-dates, body.epmtp-app .mtp-meta { margin: 2px 0 0; font-size: 13px; color: var(--mtp-muted); }
body.epmtp-app .mtp-dest { font-weight: 600; color: var(--mtp-text); }
body.epmtp-app .mtp-card-actions { gap: 8px; margin-top: 10px; }
body.epmtp-app .mtp-card-actions .mtp-btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
body.epmtp-app [data-plans].epmtp-carousel .mtp-card [data-action="delete-plan"] { display: none; } /* delete stays inside the edit sheet */
.epmtp-dots { display: flex; justify-content: center; gap: 6px; min-height: 6px; margin: 0 0 6px; }
.epmtp-dots i { width: 6px; height: 6px; border-radius: 3px; background: #c9d8d0; transition: width .2s, background .2s; }
.epmtp-dots i.is-on { width: 18px; background: var(--mtp-accent); }
body.epmtp-app .mtp-empty { margin: 8px 16px; padding: 22px 16px; border-radius: 14px; background: #fff; text-align: center; box-shadow: var(--mtp-shadow); }
body.epmtp-app .mtp-empty h3 { font-size: 17px; }
.epmtp-empty { margin: 8px 0; padding: 18px 14px; border-radius: 14px; background: #fff; text-align: center; color: var(--mtp-muted); }
.epmtp-empty p { margin: 0 0 10px; }

/* ---- Collapsible primitives ---- */
.epmtp-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s var(--epmtp-ease); }
.epmtp-collapse-in { min-height: 0; overflow: hidden; }
.is-open > .epmtp-collapse { grid-template-rows: 1fr; }
.is-open > button > .epmtp-chev, .is-open > header > .epmtp-chev { transform: rotate(180deg); }

/* ---- Day agenda ---- */
.epmtp-agenda { padding: 0 12px; }
.epmtp-agenda-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 2px; }
.epmtp-agenda-head h3 { margin: 0; font-size: 16px !important; }
.epmtp-day { margin: 8px 0; background: #fff; border-radius: 14px; box-shadow: var(--mtp-shadow); overflow: hidden; }
.epmtp-day-head {
	display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 14px;
	border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--mtp-ink);
}
.epmtp-day-no { flex: 0 0 auto; padding: 3px 8px; border-radius: 99px; background: var(--mtp-soft); color: var(--mtp-accent-dark); font-size: 12px; font-weight: 700; }
.epmtp-day.is-today .epmtp-day-no { background: var(--mtp-accent); color: #fff; }
.epmtp-day-date { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epmtp-day-count { flex: 0 0 auto; font-size: 12px; color: var(--mtp-subtle); }

/* ---- Event rows ---- */
.epmtp-evs { list-style: none; margin: 0; padding: 0; }
.epmtp-ev { border-top: 1px solid #edf3ef; position: relative; }
.epmtp-ev::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--ev, var(--mtp-accent)); }
.epmtp-ev-head {
	display: grid; grid-template-columns: 76px 22px minmax(0, 1fr) 18px; align-items: center; gap: 8px;
	width: 100%; min-height: 48px; padding: 6px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--mtp-text);
}
.epmtp-ev-time { font-size: 13px; font-weight: 600; color: var(--mtp-ink); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epmtp-ev-cat { display: inline-flex; color: var(--ev, var(--mtp-accent)); }
.epmtp-ev-title { min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epmtp-ev.is-open .epmtp-ev-title { white-space: normal; }
.epmtp-ev-more { padding: 0 14px 12px 14px; font-size: 14px; }
.epmtp-ev-line { display: flex; gap: 8px; margin: 4px 0; overflow-wrap: anywhere; }
.epmtp-ev-line > span { flex: 0 0 36px; color: var(--mtp-subtle); font-size: 12px; padding-top: 2px; }
.epmtp-ev-line a, .epmtp-ev-desc a { color: var(--mtp-accent); }
.epmtp-ev-desc { margin: 6px 0; padding: 8px 10px; border-radius: 10px; background: #f4f8f5; white-space: pre-wrap; overflow-wrap: anywhere; }
.epmtp-ev-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.epmtp-add-row {
	display: block; width: calc(100% - 28px); margin: 6px 14px 12px; min-height: 44px; border-radius: 12px;
	border: 1px dashed #bcd2c6; background: #f8fbf9; color: var(--mtp-accent-dark); font: 600 14px var(--mtp-font); cursor: pointer;
}

/* ---- Calendar panel: planner's 日程/月 switch as a segmented control, our strip in 日程 mode ---- */
body.epmtp-app .mtp-view-switch.epmtp-seg {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; margin: 0 12px 10px; padding: 3px; border-radius: var(--mtp-radius, 12px); background: #e6eeea;
}
body.epmtp-app .mtp-view-switch.epmtp-seg .mtp-btn {
	min-height: 38px; margin: 0; border: 0; border-radius: 9px; background: transparent; color: var(--mtp-muted); font: 600 14px var(--mtp-font); box-shadow: none;
}
body.epmtp-app .mtp-view-switch.epmtp-seg .mtp-btn.is-on { background: #fff; color: var(--mtp-ink); box-shadow: 0 1px 3px rgba(37, 75, 64, .14); }
body.epmtp-app .mtp-cal-bar { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 12px 8px; padding: 0; border: 0; background: none; box-shadow: none; }
body.epmtp-app .mtp-cal-bar label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
body.epmtp-app .mtp-cal-bar select { flex: 1 1 auto; width: auto; min-height: 44px; border-radius: 99px; border-color: var(--mtp-line); padding: 0 34px 0 14px; font-size: 16px; background-color: #fff; }
body.epmtp-app .mtp-cal-bar .mtp-hint { flex: 1 0 100%; margin: 0; font-size: 12px; }
body.epmtp-app .mtp-cal-bar [data-action="new-event"] { display: none; } /* the floating button adds events */
body.epmtp-app .mtp.is-agenda .mtp-cal-bar .mtp-hint,
body.epmtp-app .mtp.is-agenda [data-agenda],
body.epmtp-app .mtp.is-agenda #mtp-calendar { display: none !important; }
body.epmtp-app .mtp:not(.is-agenda) .epmtp-dayview { display: none; }
.epmtp-dayview { padding: 0 12px; }
.epmtp-strip-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.epmtp-strip-head strong { font-size: 15px; color: var(--mtp-ink); }
.epmtp-strip {
	display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
	padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.epmtp-strip::-webkit-scrollbar { display: none; }
.epmtp-chip {
	position: relative; flex: 0 0 48px; scroll-snap-align: center;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
	min-height: 72px; padding: 4px 0 8px; border: 1px solid var(--mtp-line); border-radius: 14px; background: #fff;
	color: var(--mtp-text); font-family: var(--mtp-font); cursor: pointer; transition: background .18s, color .18s, transform .18s;
}
.epmtp-chip-m { font-size: 10px; line-height: 1.2; color: var(--mtp-accent); font-weight: 700; }
.epmtp-chip-w { font-size: 12px; color: var(--mtp-subtle); }
.epmtp-chip-d { font-size: 18px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.epmtp-chip-dot { position: absolute; bottom: 6px; width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.epmtp-chip-dot.has { background: var(--mtp-accent); }
.epmtp-chip.is-today { border-color: var(--mtp-accent); }
.epmtp-chip.is-on { background: var(--mtp-accent); border-color: var(--mtp-accent); color: #fff; }
.epmtp-chip.is-on .epmtp-chip-w, .epmtp-chip.is-on .epmtp-chip-m { color: rgba(255, 255, 255, .85); }
.epmtp-chip.is-on .epmtp-chip-dot.has { background: #fff; }
.epmtp-daylist { background: #fff; border-radius: 14px; box-shadow: var(--mtp-shadow); overflow: hidden; }
.epmtp-daylist .epmtp-ev:first-child { border-top: 0; }
.epmtp-daylist .epmtp-empty { margin: 0; box-shadow: none; }

/* FullCalendar grid (月/周) */
body.epmtp-app .mtp .fc {
	--fc-border-color: #e3ece7; --fc-button-bg-color: #fff; --fc-button-border-color: var(--mtp-line); --fc-button-text-color: var(--mtp-ink);
	--fc-button-hover-bg-color: var(--mtp-soft); --fc-button-hover-border-color: var(--mtp-line);
	--fc-button-active-bg-color: var(--mtp-accent); --fc-button-active-border-color: var(--mtp-accent);
	--fc-today-bg-color: #eef6f1; --fc-page-bg-color: #fff; --fc-neutral-bg-color: #f4f8f5; --fc-list-event-hover-bg-color: #f4f8f5;
	margin: 0 12px; padding: 10px 8px; background: #fff; border-radius: 14px; box-shadow: var(--mtp-shadow); font-size: 13px;
}
body.epmtp-app .mtp .fc .fc-button { min-height: 40px; min-width: 40px; padding: 0 10px; border-radius: 10px; color: var(--mtp-ink); font-weight: 600; }
body.epmtp-app .mtp .fc .fc-button:disabled { opacity: .45; }
body.epmtp-app .mtp .fc .fc-toolbar { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 8px; }
body.epmtp-app .mtp .fc .fc-toolbar-chunk { display: flex; align-items: center; gap: 4px; min-width: 0; margin: 0 !important; }
body.epmtp-app .mtp .fc .fc-toolbar-chunk .fc-button-group { gap: 4px; }
@media (max-width: 720px) { body.epmtp-app .mtp .fc .fc-daygrid-day-frame { min-height: 64px; } body.epmtp-app .mtp .fc .fc-daygrid-body td { height: auto !important; } }
body.epmtp-app .mtp .fc .fc-toolbar-title { font: 600 16px var(--mtp-font); color: var(--mtp-ink); }
body.epmtp-app .mtp .fc .fc-col-header-cell-cushion, body.epmtp-app .mtp .fc .fc-daygrid-day-number { color: var(--mtp-muted); text-decoration: none; font-size: 12px; }
body.epmtp-app .mtp .fc .fc-event { border-radius: 6px; }
body.epmtp-app .mtp .fc table { table-layout: fixed; }
body.epmtp-app .mtp .fc .fc-list-event-time { white-space: normal; width: 64px; }
body.epmtp-app .mtp .fc-scroller { overflow-x: hidden !important; }

/* ---- Notes ---- */
body.epmtp-app [data-notes] { padding: 0 12px; }
body.epmtp-app .mtp-note.epmtp-note { margin: 8px 0; padding: 0; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--mtp-shadow); overflow: hidden; }
body.epmtp-app .mtp-note.epmtp-note > header { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 14px; cursor: pointer; }
body.epmtp-app .mtp-note .mtp-note-where { flex: 1 1 auto; min-width: 0; color: var(--mtp-ink); font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.epmtp-app .mtp-note time { flex: 0 0 auto; font-size: 12px; color: var(--mtp-subtle); }
body.epmtp-app .mtp-note.epmtp-note .mtp-note-body { margin: 0; padding: 0 14px 10px; font-size: 14px; overflow-wrap: anywhere; }
body.epmtp-app .mtp-note.epmtp-note:not(.is-open) .mtp-note-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 3.4em; }
body.epmtp-app .mtp-note.epmtp-note:not(.is-open) .mtp-note-body :is(ul, ol, p, div, blockquote) { display: inline; margin: 0; padding: 0; }
body.epmtp-app .mtp-note.epmtp-note:not(.is-open) .mtp-note-body li { display: inline; }
body.epmtp-app .mtp-note.epmtp-note:not(.is-open) .mtp-note-body li + li::before { content: " · "; }
body.epmtp-app .mtp-note.epmtp-note:not(.is-open) .mtp-note-actions { display: none; }
body.epmtp-app .mtp-note.epmtp-note .mtp-note-actions { margin: 0; padding: 0 14px 12px; }
body.epmtp-app .mtp-note-body a { color: var(--mtp-accent); }
.epmtp-compose {
	display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 24px); margin: 10px 12px 4px; min-height: 48px;
	border: 1px dashed #bcd2c6; border-radius: 14px; background: #f8fbf9; color: var(--mtp-accent-dark); font: 600 15px var(--mtp-font); cursor: pointer;
}
.epmtp-compose svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
body.epmtp-app .mtp-note-form { margin: 8px 12px 0; padding: 12px; border-radius: 14px; background: #fff; box-shadow: var(--mtp-shadow); }
body.epmtp-app .mtp-note-form.epmtp-folded { display: none; }
body.epmtp-app .mtp-tools button { min-width: 44px; min-height: 44px; border-radius: 10px; border-color: var(--mtp-line); }
body.epmtp-app .mtp-editor { min-height: 120px; border-color: var(--mtp-line); font-size: 16px; }

/* ---- Inputs everywhere (≥16px, 44px) ---- */
body.epmtp-app :is(.mtp, .mtp-modal) :is(input, select, textarea) { font-size: 16px !important; min-height: 44px; border-radius: 12px; border-color: var(--mtp-line); }
body.epmtp-app .mtp-modal textarea { min-height: 88px; }
body.epmtp-app .mtp-field > span { font-size: 13px; font-weight: 600; color: var(--mtp-muted); }

/* ---- Dialogs → bottom sheets on mobile ---- */
body.epmtp-app .mtp-modal { font-family: var(--mtp-font); background: rgba(19, 36, 30, .5); z-index: 100000; }
body.epmtp-app .mtp-modal .mtp-dialog { border-radius: 18px; box-shadow: 0 18px 60px rgba(20, 45, 35, .28); color: var(--mtp-text); background: #fff; }
body.epmtp-app .mtp-dialog-head { position: sticky; top: 0; z-index: 2; background: #fff; }
body.epmtp-app .mtp-dialog-head h2 { font-size: 18px !important; }
body.epmtp-app .mtp-dialog-actions { position: sticky; bottom: 0; background: #fff; padding-top: 10px; padding-bottom: 4px; z-index: 2; }
body.epmtp-app .mtp-swatch { width: 36px; height: 36px; min-width: 36px; }
@media (max-width: 720px) {
	body.epmtp-app .mtp-modal { display: flex !important; align-items: flex-end !important; justify-content: center; padding: 0 !important; }
	body.epmtp-app .mtp-modal .mtp-dialog {
		width: 100% !important; max-width: 100% !important; max-height: 90vh; max-height: 90dvh; margin: 0 !important;
		border-radius: 20px 20px 0 0; box-shadow: var(--epmtp-shadow-sheet); overflow-y: auto; overscroll-behavior: contain;
		padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
		animation: epmtp-sheet .28s var(--epmtp-ease);
	}
	body.epmtp-app .mtp-dialog-head { padding: 18px 0 8px; margin: 0 0 4px; }
	body.epmtp-app .mtp-dialog-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 2px; background: #cfdcd5; }
	body.epmtp-app .mtp-dialog-actions .mtp-btn:not(.mtp-btn-danger) { flex: 1 1 auto; }
}
@keyframes epmtp-sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes epmtp-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- Floating action button ---- */
.epmtp-fab {
	position: fixed; z-index: 95; right: max(16px, calc((100vw - var(--epmtp-col)) / 2 + 16px));
	bottom: calc(var(--epmtp-nav-h) + 16px);
	display: inline-flex; align-items: center; gap: 6px; min-height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 26px;
	background: var(--mtp-accent); color: #fff; font: 600 15px var(--mtp-font); cursor: pointer;
	box-shadow: 0 8px 22px rgba(37, 75, 64, .3); -webkit-tap-highlight-color: transparent; transition: transform .15s, background .15s;
}
.epmtp-fab:hover { background: var(--mtp-accent-dark); }
.epmtp-fab:active { transform: scale(.96); }
.epmtp-fab:focus-visible { outline: 3px solid var(--mtp-focus); outline-offset: 3px; }
.epmtp-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.epmtp-fab[hidden], html.mtp-modal-open .epmtp-fab { display: none; }

/* Toast above the tab bar */
body.epmtp-app .mtp-toast { bottom: calc(var(--epmtp-nav-h) + 80px) !important; border-radius: 12px; font-family: var(--mtp-font); }

/* Theme bottom nav stays; make sure nothing hides under it */
body.epmtp-app .ep-magazine-bottom-nav { z-index: 96; }

/* Light entrance animation */
html.epmtp-ready .epmtp-day, html.epmtp-ready .epmtp-daylist { animation: epmtp-fade .24s var(--epmtp-ease) both; }

/* ---- Desktop ---- */
@media (min-width: 721px) {
	.epmtp-bar { left: 50%; right: auto; width: min(100%, var(--epmtp-col)); transform: translateX(-50%); border-left: 1px solid var(--mtp-line); border-right: 1px solid var(--mtp-line); }
	body.epmtp-app [data-plans].epmtp-carousel > .mtp-card { flex-basis: 560px; flex-direction: row; }
	body.epmtp-app [data-plans].epmtp-carousel.is-single > .mtp-card { flex-basis: 100%; }
	body.epmtp-app [data-plans].epmtp-carousel .mtp-card .mtp-cover { flex: 0 0 46%; width: 46%; aspect-ratio: 4 / 3; }
	body.epmtp-app [data-plans].epmtp-carousel .mtp-card .mtp-card-body { flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; padding: 16px 18px; }
	body.epmtp-app .mtp-modal .mtp-dialog { animation: epmtp-fade .2s var(--epmtp-ease); }
}

@media (prefers-reduced-motion: reduce) {
	body.epmtp-app *, body.epmtp-app *::before, body.epmtp-app *::after, .epmtp-fab {
		animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important;
	}
}
.epmtp-skeleton { padding: 8px 0; }
.epmtp-skeleton i { display: block; height: 52px; margin: 8px 0; border-radius: 14px; background: linear-gradient(90deg, #edf3ef 25%, #f6f9f7 50%, #edf3ef 75%); background-size: 200% 100%; animation: epmtp-shimmer 1.2s linear infinite; }
@keyframes epmtp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Logged-out gate: friendly centred card (the 行程 tab lands here) */
body.epmtp-app .mtp.mtp-gate {
	box-sizing: border-box; max-width: 420px; margin: 24px auto 0; padding: 32px 24px 28px; text-align: center;
	background: var(--mtp-surface, #fff); border: 1px solid var(--mtp-line, #dce8e2); border-radius: 20px;
	box-shadow: 0 10px 30px rgba(37, 75, 64, .08);
}
body.epmtp-app .mtp-slot > .mtp.mtp-gate { width: calc(100% - 32px); }
body.epmtp-app .mtp-gate::before {
	content: ""; display: block; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
	background: var(--mtp-accent-soft, #e7f1ed) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23527b6b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='18' r='2.2'/%3E%3Ccircle cx='18' cy='6' r='2.2'/%3E%3Cpath d='M8.2 18H16a3 3 0 0 0 0-6H8a3 3 0 0 1 0-6h7.8'/%3E%3C/svg%3E") center / 30px no-repeat;
}
body.epmtp-app .mtp-gate .mtp-kicker { margin: 0 0 6px; font-size: 12px; letter-spacing: .08em; color: var(--mtp-accent, #527b6b); font-weight: 700; }
body.epmtp-app .mtp-gate h2 { margin: 0 0 10px; font-size: 22px; line-height: 1.3; color: var(--mtp-ink, #254b40); }
body.epmtp-app .mtp-gate h2 + p { margin: 0 0 22px; font-size: 14px; line-height: 1.65; color: var(--mtp-muted, #5d7069); }
body.epmtp-app .mtp-gate .mtp-gate-actions { display: flex; flex-direction: column; gap: 10px; }
body.epmtp-app .mtp-gate .mtp-btn { justify-content: center; width: 100%; min-height: 48px; box-sizing: border-box; }

/* ======================================================================
 * 0.2.5 — MTP 1.2.0: budget, 路线导航, 优化顺序, new form fields, AI (hidden until configured)
 * Over-budget colours use the planner's own --mtp-warn-bg / --mtp-warn-text.
 * ==================================================================== */
body.epmtp-app { --epmtp-warn-bg: var(--mtp-warn-bg, #fff4dc); --epmtp-warn-text: var(--mtp-warn-text, #7a4b00); }

/* Plan card: compact budget summary (the planner's 4-line block is kept as fallback until data loads) */
body.epmtp-app .mtp-card .mtp-budget.epmtp-replaced { display: none; }
.epmtp-budget { margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; background: #f4f8f5; font-size: 13px; line-height: 1.4; color: var(--mtp-text); }
.epmtp-budget.is-over { background: var(--epmtp-warn-bg); }


.epmtp-budget-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.epmtp-budget-row span { min-width: 0; color: var(--mtp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epmtp-budget-row b { color: var(--mtp-ink); font-weight: 600; }
.epmtp-budget-row strong { flex: 0 0 auto; font-weight: 700; color: var(--mtp-accent-dark, #3e6656); font-variant-numeric: tabular-nums; }
.epmtp-budget-row strong.is-over { color: var(--epmtp-warn-text); }
.epmtp-bar-track { height: 6px; margin: 6px 0 4px; border-radius: 3px; background: rgba(37, 75, 64, .1); overflow: hidden; }
.epmtp-bar-track i { display: block; height: 100%; border-radius: 3px; background: var(--mtp-accent); transition: width .3s var(--epmtp-ease); }
.epmtp-budget.is-over .epmtp-bar-track i { background: var(--epmtp-warn-text); }
.epmtp-budget-sub { margin: 0; font-size: 12px; color: var(--mtp-muted); font-variant-numeric: tabular-nums; }
.epmtp-budget-cats { margin-top: 4px; }
.epmtp-budget-cats summary { display: inline-flex; align-items: center; min-height: 32px; list-style: none; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--mtp-accent); }
.epmtp-budget-cats summary::-webkit-details-marker { display: none; }
.epmtp-budget-cats summary::after { content: ""; width: 6px; height: 6px; margin-left: 6px; border: solid currentColor; border-width: 0 1.6px 1.6px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.epmtp-budget-cats[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.epmtp-budget-cats div { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0 2px; }
.epmtp-budget-cats div span { padding: 2px 9px; border-radius: 99px; background: #fff; border: 1px solid var(--mtp-line); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Planner's own budget markup (fallback, agenda clone, AI preview) */
body.epmtp-app .mtp-budget { border-radius: 12px; font-size: 13px; }
body.epmtp-app .mtp-budget p { margin: 2px 0; }
body.epmtp-app .mtp-budget-over { background: var(--epmtp-warn-bg); color: var(--epmtp-warn-text); }
body.epmtp-app .mtp-budget-categories { display: flex; flex-wrap: wrap; gap: 6px; }
body.epmtp-app .mtp-budget-category { padding: 2px 9px; border-radius: 99px; background: #fff; border: 1px solid var(--mtp-line); font-size: 12px; white-space: nowrap; }
body.epmtp-app .mtp-budget-day { margin: 0 14px 6px; padding: 4px 10px; font-size: 12px; }

/* Day tools row (inside each open day / the calendar day list) */
.epmtp-day-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 2px 14px 8px; }
.epmtp-day-spend { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--mtp-muted); font-variant-numeric: tabular-nums; }
.epmtp-day-spend em { font-style: normal; padding: 1px 7px; border-radius: 99px; background: var(--epmtp-warn-bg); color: var(--epmtp-warn-text); font-size: 11px; }
.epmtp-day-btns { display: inline-flex; gap: 6px; }
.epmtp-day-spend { margin-left: auto; }
.epmtp-tool {
	display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 99px;
	border: 1px solid var(--mtp-line); background: #fff; color: var(--mtp-ink); font: 600 13px var(--mtp-font); cursor: pointer; white-space: nowrap;
	-webkit-tap-highlight-color: transparent; touch-action: manipulation; position: relative;
}
.epmtp-tool::after { content: ""; position: absolute; inset: -4px 0; } /* 44px tap target */
.epmtp-tool svg { width: 16px; height: 16px; fill: none; stroke: var(--mtp-accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.epmtp-tool:active { background: var(--mtp-soft); }
.epmtp-tool[aria-busy="true"] { opacity: .6; }
.epmtp-daylist .epmtp-day-tools { padding-top: 10px; border-bottom: 1px solid #edf3ef; }

/* Event rows: cost on the right, navigation choices for typed coordinates */
.epmtp-ev-head { grid-template-columns: 76px 22px minmax(0, 1fr) auto 18px; }
.epmtp-ev-cost { font-size: 12px; color: var(--mtp-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.epmtp-ev-cost:empty { display: none; }
.epmtp-nav-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.epmtp-nav-choices[hidden] { display: none; }
.epmtp-nav-choices .epmtp-btn { padding: 0 6px; font-size: 13px; }

/* 路线导航 sheet */
body.epmtp-app .mtp-route { display: flex; flex-direction: column; gap: 10px; padding-bottom: 4px; }
body.epmtp-app .mtp-route > .mtp-hint { margin: 0; padding: 8px 12px; border-radius: 12px; background: #f4f8f5; font-size: 13px; color: var(--mtp-muted); }
body.epmtp-app .mtp-route-leg { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--mtp-line); border-radius: 14px; background: #fff; }
body.epmtp-app .mtp-route-leg > p { margin: 0; font-weight: 600; color: var(--mtp-ink); }
body.epmtp-app .mtp-route-leg .mtp-btn { width: 100%; box-sizing: border-box; }
.epmtp-leg-head { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; }
.epmtp-leg-head strong { font-size: 15px; color: var(--mtp-ink); }
.epmtp-leg-head span { font-size: 12px; color: var(--mtp-subtle); }
.epmtp-leg-head p { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--mtp-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epmtp-leg-main { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
body.epmtp-app .epmtp-leg-main .mtp-btn { padding: 0 8px; }
body.epmtp-app .epmtp-leg-main .mtp-btn + .mtp-btn { background: #fff; color: var(--mtp-ink) !important; border-color: var(--mtp-line); }
.epmtp-leg-waze summary {
	display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 2px; list-style: none; cursor: pointer;
	font-size: 14px; font-weight: 600; color: var(--mtp-accent-dark, #3e6656);
}
.epmtp-leg-waze summary::-webkit-details-marker { display: none; }
.epmtp-leg-waze summary span { margin-left: auto; margin-right: 8px; padding: 0 8px; border-radius: 99px; background: var(--mtp-soft); font-size: 12px; }
.epmtp-leg-waze summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.epmtp-leg-waze[open] summary::after { transform: rotate(-135deg); }
.epmtp-leg-waze ol { margin: 0; padding: 0; list-style: none; counter-reset: stop; }
.epmtp-leg-waze li { counter-increment: stop; border-top: 1px solid #edf3ef; }
body.epmtp-app .epmtp-leg-waze a.epmtp-waze-stop {
	display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 44px; padding: 0 4px; border: 0; border-radius: 0;
	background: transparent; color: var(--mtp-text) !important; font-weight: 500; text-align: left;
}
body.epmtp-app .epmtp-leg-waze a.epmtp-waze-stop::before {
	content: counter(stop); flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--mtp-soft); color: var(--mtp-accent-dark, #3e6656);
	font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
body.epmtp-app .epmtp-leg-waze a.epmtp-waze-stop::after { content: "Waze ›"; flex: 0 0 auto; margin-left: auto; font-size: 12px; color: var(--mtp-subtle); white-space: nowrap; }
body.epmtp-app .epmtp-leg-waze a.epmtp-waze-stop { white-space: normal; line-height: 1.3; padding-top: 6px; padding-bottom: 6px; }
.epmtp-sheet-hint { margin: 4px 0 0; font-size: 12px; color: var(--mtp-subtle); line-height: 1.5; }

/* 优化顺序 preview */
body.epmtp-app .mtp-route-preview { display: flex; flex-direction: column; gap: 10px; }
body.epmtp-app .mtp-route-preview > .epmtp-sheet-hint { margin: 0; padding: 8px 12px; border-radius: 12px; background: #f4f8f5; font-size: 13px; color: var(--mtp-muted); }
body.epmtp-app .mtp-route-preview ol { margin: 0; padding: 0; list-style: none; counter-reset: ord; border: 1px solid var(--mtp-line); border-radius: 14px; overflow: hidden; }
body.epmtp-app .mtp-route-preview li {
	counter-increment: ord; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 10px;
	min-height: 48px; padding: 6px 12px; border-top: 1px solid #edf3ef; font-size: 14px;
}
body.epmtp-app .mtp-route-preview li:first-child { border-top: 0; }
body.epmtp-app .mtp-route-preview li::before {
	content: counter(ord); width: 22px; height: 22px; border-radius: 50%; background: var(--mtp-soft); color: var(--mtp-accent-dark, #3e6656);
	font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
body.epmtp-app .mtp-route-preview li strong { min-width: 0; font-weight: 600; color: var(--mtp-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epmtp-chg { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.epmtp-chg s { color: var(--mtp-subtle); }
.epmtp-chg i { font-style: normal; color: var(--mtp-subtle); }
.epmtp-chg b { padding: 1px 7px; border-radius: 8px; background: var(--mtp-soft); color: var(--mtp-accent-dark, #3e6656); }
.epmtp-chg.is-same { color: var(--mtp-subtle); font-size: 12px; }
body.epmtp-app .mtp-route-preview [data-accept-order] { position: sticky; bottom: 0; width: 100%; min-height: 48px; box-shadow: 0 -8px 16px #fff; }

/* Forms: collapsible 地点与坐标 / 花费 / 预算 sections, toggle row */
.epmtp-sec { margin: 10px 0; border: 1px solid var(--mtp-line); border-radius: 14px; background: #fbfdfc; }
.epmtp-sec > summary {
	display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; list-style: none; cursor: pointer;
	font-weight: 600; color: var(--mtp-ink); -webkit-tap-highlight-color: transparent;
}
.epmtp-sec > summary::-webkit-details-marker { display: none; }
.epmtp-sec > summary em { margin-left: auto; font-style: normal; font-weight: 500; font-size: 13px; color: var(--mtp-subtle); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epmtp-sec > summary::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border: solid var(--mtp-subtle); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: transform .2s; }
.epmtp-sec[open] > summary::after { transform: rotate(-135deg); }
.epmtp-sec[open] > summary { border-bottom: 1px solid #edf3ef; }
.epmtp-sec > :not(summary) { margin-left: 14px !important; margin-right: 14px !important; }
.epmtp-sec > :last-child { margin-bottom: 12px !important; }
.epmtp-sec > .mtp-field:first-of-type, .epmtp-sec > summary + * { margin-top: 10px !important; }
body.epmtp-app .mtp-modal .mtp-row { gap: 10px; }
body.epmtp-app .mtp-modal .mtp-row > .mtp-field { min-width: 0; }
body.epmtp-app .mtp-modal [name="budget_currency"] { text-transform: uppercase; }
body.epmtp-app .mtp-check {
	display: flex !important; flex-direction: row !important; align-items: center; gap: 10px; min-height: 48px; margin: 8px 0 0;
	padding: 0 14px; border: 1px solid var(--mtp-line); border-radius: 14px; background: #fbfdfc; cursor: pointer;
}
body.epmtp-app .mtp-check > span { flex: 1 1 auto; font-size: 15px !important; font-weight: 600 !important; color: var(--mtp-ink) !important; }
body.epmtp-app .mtp-check input[type="checkbox"] { order: 2; flex: 0 0 auto; width: 22px; height: 22px; min-height: 0 !important; margin: 0; accent-color: var(--mtp-accent); }
body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"] {
	-webkit-appearance: none; appearance: none; width: 46px; height: 28px; border-radius: 14px; background: #d5e0da; position: relative; cursor: pointer; transition: background .2s; border: 0;
}
body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"]::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s var(--epmtp-ease);
}
body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"]:checked { background: var(--mtp-accent); }
body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"]:checked::after { transform: translateX(18px); }
body.epmtp-app .mtp-check + .mtp-hint { margin: 4px 4px 0; font-size: 12px; }
body.epmtp-app .mtp-ai .mtp-check, body.epmtp-app .mtp-ai-preview .mtp-check { min-height: 44px; margin: 6px 0 0; }

/* AI 安排行程 (hidden until an endpoint is set; styled so it is ready) */
body.epmtp-app .mtp-ai { display: flex; flex-direction: column; gap: 8px; }
body.epmtp-app .mtp-ai-preview { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
body.epmtp-app .mtp-ai-preview[hidden] { display: none; }
body.epmtp-app .mtp-ai-day { padding: 10px 12px; border: 1px solid var(--mtp-line); border-radius: 14px; background: #fff; }
body.epmtp-app .mtp-ai-day h3 { margin: 0 0 6px; font-size: 15px !important; }
body.epmtp-app .mtp-ai-day ol { margin: 0; padding-left: 20px; font-size: 14px; }
body.epmtp-app .mtp-ai-day li { margin: 4px 0; overflow-wrap: anywhere; }

/* Planner's own agenda day head (only visible in fallbacks) */
body.epmtp-app .mtp-day-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
body.epmtp-app .mtp-day-head h3 { margin: 0; font-size: 15px; }
body.epmtp-app .mtp-day-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }
body.epmtp-app .mtp-day-actions .mtp-btn { min-height: 36px; padding: 0 12px; border-radius: 99px; font-size: 13px; }

/* Card actions: three buttons share one row on phones */
body.epmtp-app .mtp-card-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.epmtp-app .mtp-card-actions .mtp-btn { padding: 0 6px; white-space: nowrap; }

@media (min-width: 721px) {
	body.epmtp-app .mtp-route, body.epmtp-app .mtp-route-preview { min-width: min(520px, 80vw); }
}

/* Two short inputs side by side inside the folded sections (lat/lng, 预计/实际, 金额/货币) */
body.epmtp-app .mtp-modal .epmtp-sec .mtp-row { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
body.epmtp-app .mtp-modal .epmtp-sec .mtp-row:has([name="budget_currency"]) { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
body.epmtp-app .mtp-modal .epmtp-sec .mtp-row > .mtp-field { margin: 0; }

/* ================= 0.2.6 · MTP 1.2.1 ================= */
/* 「使用当前位置」 (1.2.1 .mtp-geo) sits inside 地点与坐标, under the lat/lng row. */
body.epmtp-app .mtp-modal .mtp-geo {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; box-sizing: border-box; width: 100%; max-width: 100%; min-height: 44px; margin: 2px 0 6px;
	padding: 0 14px; border: 1px solid var(--mtp-line); border-radius: 99px; background: var(--mtp-paper, #fff); color: var(--mtp-accent-dark, #3e6656) !important;
	font: 600 14px/1 var(--mtp-font); cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent;
}
body.epmtp-app .mtp-modal .mtp-geo::before {
	content: ""; flex: 0 0 18px; width: 18px; height: 18px; background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Ccircle cx='12' cy='12' r='7.5'/%3E%3Cpath d='M12 1.8v3M12 19.2v3M1.8 12h3M19.2 12h3'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='3.2'/%3E%3Ccircle cx='12' cy='12' r='7.5'/%3E%3Cpath d='M12 1.8v3M12 19.2v3M1.8 12h3M19.2 12h3'/%3E%3C/svg%3E") center / contain no-repeat;
}
body.epmtp-app .mtp-modal .mtp-geo:hover { background: var(--mtp-soft); }
body.epmtp-app .mtp-modal .mtp-geo:disabled { opacity: .6; cursor: progress; }
body.epmtp-app .mtp-modal .mtp-geo:disabled::before { animation: epmtp-geo-spin 1s linear infinite; }
@keyframes epmtp-geo-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { body.epmtp-app .mtp-modal .mtp-geo:disabled::before { animation: none; } }
/* inside 地点与坐标 the section's own 14px side margins apply: be a block that fills the rest */
body.epmtp-app .mtp-modal .epmtp-sec > .mtp-geo { display: flex; width: calc(100% - 28px); margin: 4px 14px 8px; }
@media (min-width: 768px) { body.epmtp-app .mtp-modal .epmtp-sec > .mtp-geo { display: inline-flex; width: auto; } }
/* 优化顺序: "some stops did not fit" note from the planner. */
body.epmtp-app .mtp-route-preview > .mtp-hint.epmtp-warn { margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--epmtp-warn-bg); color: var(--epmtp-warn-text); font-size: 13px; line-height: 1.5; }

/* ---- Night mode: follows eatplan-pwa-plus (html[data-ep-theme="dark"], same palette as its app CSS) ---- */
html[data-ep-theme="dark"]:has(body.epmtp-app) { background: #121a18; color-scheme: dark; }
html[data-ep-theme="dark"] body.epmtp-app {
	color-scheme: dark;
	--eatplan-bg: #121a18; --eatplan-surface: #1a2422; --eatplan-surface-soft: #22302c; --eatplan-mint: #1f2d29;
	--eatplan-ink: #e6efe9; --eatplan-text: #d9e2dc; --eatplan-text-muted: #a9b8b1; --eatplan-text-subtle: #8a9a93;
	--eatplan-line: #2e3c38; --eatplan-green: #4f9a78; --eatplan-accent-strong: #8fd3b0; --eatplan-focus: #8fd3b0;
	--eatplan-warn-bg: #3a3120; --eatplan-warn-text: #f0d79a; --eatplan-chrome-bg: rgba(18, 26, 24, .96);
	--eatplan-shadow-card: 0 4px 16px rgba(0, 0, 0, .35);
	--mtp-sand: #121a18; --mtp-paper: #1a2422; --mtp-surface: #1a2422; --mtp-soft: #22302c; --mtp-mint: #1f2d29;
	--mtp-ink: #e6efe9; --mtp-text: #d9e2dc; --mtp-muted: #a9b8b1; --mtp-subtle: #8a9a93; --mtp-line: #2e3c38;
	--mtp-accent: #4f9a78; --mtp-accent-dark: #8fd3b0; --mtp-accent-soft: #1f2d29; --mtp-focus: #8fd3b0;
	--mtp-chrome: rgba(18, 26, 24, .96); --mtp-shadow: 0 4px 16px rgba(0, 0, 0, .35);
	--mtp-warn-bg: #3a3120; --mtp-warn-text: #f0d79a; --mtp-danger: #f0a196;
	--epmtp-warn-bg: #3a3120; --epmtp-warn-text: #f0d79a;
	--epmtp-shadow-sheet: 0 -10px 40px rgba(0, 0, 0, .5);
	background: #121a18 !important; color: #d9e2dc;
}
/* surfaces that were plain white */
html[data-ep-theme="dark"] body.epmtp-app :is(
	.mtp-tab.is-on, .mtp-btn-ghost, .mtp-btn-danger, [data-plans].epmtp-carousel > .mtp-card, .mtp-card, .mtp-empty, .epmtp-empty, .epmtp-day,
	.mtp-view-switch.epmtp-seg .mtp-btn.is-on, .epmtp-chip, .epmtp-daylist, .mtp-note.epmtp-note, .mtp-note-form, .mtp-dialog, .mtp-dialog-head,
	.mtp-dialog-actions, .epmtp-budget-cats div span, .mtp-budget-category, .epmtp-tool, .mtp-route-leg, .epmtp-leg-main .mtp-btn + .mtp-btn,
	.mtp-ai-day, .mtp-gate, .mtp-agenda-item
) { background-color: #1a2422; color: #d9e2dc; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-modal .mtp-dialog { background: #1a2422; color: #d9e2dc; box-shadow: 0 18px 60px rgba(0, 0, 0, .6); }
html[data-ep-theme="dark"] body.epmtp-app .mtp-modal { background: rgba(0, 0, 0, .6); }
html[data-ep-theme="dark"] body.epmtp-app :is(.mtp-modal .mtp-btn-ghost, .mtp-btn-ghost, .epmtp-btn-ghost, .epmtp-leg-main .mtp-btn + .mtp-btn) { background: #1a2422; color: #e6efe9 !important; border-color: #2e3c38; }
html[data-ep-theme="dark"] body.epmtp-app :is(.mtp-btn-danger, .mtp-modal .mtp-btn-danger) { color: #f0a196; border-color: #5a3430; }
html[data-ep-theme="dark"] body.epmtp-app :is(.mtp-btn-danger, .mtp-modal .mtp-btn-danger):hover { background: #2c1e1c; }
html[data-ep-theme="dark"] body.epmtp-app :is(.mtp-btn, .epmtp-btn):not(.mtp-btn-ghost):not(.epmtp-btn-ghost):not(.mtp-btn-danger):hover { background: #3f8566; color: #fff; }
/* soft fills, rules and dashed boxes */
html[data-ep-theme="dark"] body.epmtp-app :is(.epmtp-ev-desc, .epmtp-budget, .mtp-route > .mtp-hint, .mtp-route-preview > .epmtp-sheet-hint, .mtp-cal-bar select) { background-color: #121a18; }
html[data-ep-theme="dark"] body.epmtp-app :is(.epmtp-ev, .epmtp-leg-waze li, .mtp-route-preview li, .epmtp-sec[open] > summary) { border-color: #26332f; }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-daylist .epmtp-day-tools { border-bottom-color: #26332f; }
html[data-ep-theme="dark"] body.epmtp-app :is(.epmtp-add, .mtp-note-new, [data-epmtp="add-day"]) { background: #17211f; border-color: #3a4c46; }
html[data-ep-theme="dark"] body.epmtp-app :is(.epmtp-sec, .epmtp-switch) { background: #17211f; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-check { background: #17211f; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"] { background: #3a4c46; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"]:checked { background: var(--mtp-accent); }
html[data-ep-theme="dark"] body.epmtp-app .mtp-check.epmtp-switch input[type="checkbox"]::after { background: #e6efe9; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-view-switch.epmtp-seg, html[data-ep-theme="dark"] body.epmtp-app .mtp-tabs::before { background: #22302c; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-tab.is-on { background: #2e3c38; color: #e6efe9; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
html[data-ep-theme="dark"] body.epmtp-app .mtp-view-switch.epmtp-seg .mtp-btn.is-on { background: #2e3c38; color: #e6efe9; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-route-preview [data-accept-order] { box-shadow: 0 -8px 16px #1a2422; }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-bar-track { background: rgba(255, 255, 255, .1); }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-dots i { background: #3a4c46; }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-skeleton i { background: linear-gradient(90deg, #1a2422 25%, #22302c 50%, #1a2422 75%); background-size: 200% 100%; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-status-booked { background: #1f3a2e; color: #bfe6d0; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-status-planning { background: #3a3120; color: #f0d79a; }
html[data-ep-theme="dark"] body.epmtp-app .mtp-dialog-head::before { background: #3a4c46; }
/* app bar, tab bar, plan tabs */
html[data-ep-theme="dark"] body.epmtp-app :is(.epmtp-bar, .mtp-tabs) { background: rgba(18, 26, 24, .94); border-color: #2e3c38; }
html[data-ep-theme="dark"] .epmtp-tabs { background: rgba(18, 26, 24, .94); border-top-color: #2e3c38; }
html[data-ep-theme="dark"] .epmtp-tabs a { color: #a9b8b1 !important; }
html[data-ep-theme="dark"] .epmtp-tabs a.is-on { color: #e6efe9 !important; }
html[data-ep-theme="dark"] .epmtp-tabs a.is-on svg { color: #8fd3b0; }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-bar-btn:active { background: rgba(255, 255, 255, .08); }
/* form controls inside the planner sheets */
html[data-ep-theme="dark"] body.epmtp-app :is(.mtp-modal, .mtp-app) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
	background-color: #121a18; color: #e6efe9; border-color: #2e3c38;
}
html[data-ep-theme="dark"] body.epmtp-app :is(.mtp-modal, .mtp-app) :is(input, textarea)::placeholder { color: #7f8f88; }
/* FullCalendar month/list */
html[data-ep-theme="dark"] body.epmtp-app .fc {
	--fc-border-color: #2e3c38; --fc-button-bg-color: #1a2422; --fc-button-text-color: #e6efe9; --fc-button-border-color: #2e3c38;
	--fc-today-bg-color: #1f2d29; --fc-page-bg-color: #1a2422; --fc-neutral-bg-color: #22302c; --fc-list-event-hover-bg-color: #22302c;
	background: #1a2422; color: #d9e2dc;
}
html[data-ep-theme="dark"] body.epmtp-app .fc a { color: inherit; }
/* links, accents, warnings */
html[data-ep-theme="dark"] body.epmtp-app :is(.epmtp-day-spend.is-over, .epmtp-budget .is-over, .mtp-budget-over) { color: #f0a196; }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-ev-more a { color: #8fd3b0; }
html[data-ep-theme="dark"] body.epmtp-app .epmtp-ev-cat { filter: brightness(1.9) saturate(.8); }

/* ================= 0.2.7 · MTP 1.2.2 ================= */
/* 采用 while the one-call save is in flight: the planner disables it and shows 正在保存… */
body.epmtp-app .mtp-route-preview [data-accept-order]:disabled { opacity: .75; cursor: progress; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
body.epmtp-app .mtp-route-preview [data-accept-order]:disabled::before {
	content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: epmtp-geo-spin .8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { body.epmtp-app .mtp-route-preview [data-accept-order]:disabled::before { animation: none; } }
html[data-ep-theme="dark"] body.epmtp-app .mtp-route-preview [data-accept-order]:disabled { background: #3f8566; color: #e6efe9; }
