/* JapanDays app components. Tokens can be overridden by the theme. */
:root {
	--jd-bg: #F7F6F2;
	--jd-surface: #FFFFFF;
	--jd-ink: #15171B;
	--jd-muted: #5F636B;
	--jd-line: #E3E1DB;
	--jd-line-strong: #8A8E96;
	--jd-accent: #1F3FA8;
	--jd-accent-soft: #E8ECF8;
	--jd-teal: #0B6E61;
	--jd-teal-soft: #E3F1EE;
	--jd-partner: #2E6B4F;
	--jd-warn: #9A4A12;
	--jd-warn-soft: #FBF0E6;
	--jd-radius: 14px;
	--jd-radius-s: 10px;
	--jd-shadow: 0 1px 2px rgba(21, 23, 27, .04), 0 8px 24px rgba(21, 23, 27, .06);
	--jd-shadow-l: 0 2px 6px rgba(21, 23, 27, .06), 0 24px 60px rgba(21, 23, 27, .16);
	--jd-font: Inter, var(--jd-cjk, system-ui), -apple-system, "Segoe UI", sans-serif;
	--jd-cjk: "Apple SD Gothic Neo", "Malgun Gothic", "PingFang TC", "PingFang SC", "Microsoft JhengHei", "Microsoft YaHei", "Hiragino Sans", "Noto Sans CJK KR", sans-serif;
	--jd-gap: clamp(16px, 2.5vw, 28px);
}
.jd-lang-ko { --jd-cjk: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif; }
.jd-lang-zh-hant { --jd-cjk: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", sans-serif; }
.jd-lang-zh-hans { --jd-cjk: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif; }
.jd-lang-ko, .jd-lang-zh-hant, .jd-lang-zh-hans { word-break: keep-all; overflow-wrap: anywhere; }
.jd-lang-zh-hant, .jd-lang-zh-hans { word-break: normal; line-break: strict; }

.jd-app, .jd-trip, .jd-dialog, .jd-toast, .jd-planner, .jd-mini { font-family: var(--jd-font); color: var(--jd-ink); }
.jd-app *, .jd-dialog *, .jd-planner *, .jd-mini * { box-sizing: border-box; }
.jd-app img, .jd-img { max-width: 100%; display: block; }
.jd-img { width: 100%; height: auto; object-fit: cover; background: #ECEAE4; border-radius: inherit; }
.jd-ph { display: flex; align-items: center; justify-content: center; background: repeating-linear-gradient(135deg, #EFEDE7 0 12px, #E9E7E0 12px 24px); color: #6E7178; font-size: 11px; letter-spacing: .02em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-align: center; overflow: hidden; }
.jd-ph span { background: rgba(255,255,255,.85); padding: 3px 8px; border-radius: 6px; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jd-icon { flex: none; }
.jd-muted { color: var(--jd-muted); font-size: 14px; margin: 0; }
.jd-eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--jd-accent); margin: 0 0 8px; }
.jd-lang-ko .jd-eyebrow, .jd-lang-zh-hant .jd-eyebrow, .jd-lang-zh-hans .jd-eyebrow { text-transform: none; letter-spacing: 0; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.jd-warning { background: var(--jd-warn-soft); color: var(--jd-warn); border-radius: var(--jd-radius-s); padding: 10px 14px; font-size: 14px; margin: 12px 0; }

/* Buttons and chips */
.jd-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; font: 600 15px/1.2 var(--jd-font); text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s, transform .15s; background: var(--jd-ink); color: #fff; white-space: nowrap; }
.jd-btn:hover { transform: translateY(-1px); }
.jd-btn:focus-visible, .jd-icon-btn:focus-visible, .jd-chip:focus-visible, .jd-pick-card:focus-within, .jd-tag:focus-within { outline: 3px solid rgba(31, 63, 168, .35); outline-offset: 2px; }
.jd-btn--primary { background: var(--jd-accent); color: #fff; }
.jd-btn--primary:hover { background: #18338A; color: #fff; }
.jd-btn--ghost { background: var(--jd-surface); color: var(--jd-ink); border-color: var(--jd-line); }
.jd-btn--ghost:hover { border-color: var(--jd-ink); color: var(--jd-ink); }
.jd-btn--small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.jd-btn--large { min-height: 54px; padding: 14px 28px; font-size: 17px; }
.jd-btn[disabled] { opacity: .5; cursor: default; transform: none; }
.jd-btn .jd-icon { width: 18px; height: 18px; }
.jd-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--jd-muted); cursor: pointer; padding: 0; list-style: none; }
.jd-icon-btn::-webkit-details-marker { display: none; }
.jd-icon-btn:hover { background: var(--jd-bg); color: var(--jd-ink); }
.jd-icon-btn[disabled] { opacity: .35; cursor: default; background: none; }
.jd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.jd-chips--scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.jd-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border-radius: 999px; background: var(--jd-accent-soft); color: var(--jd-accent); font: 600 13px/1.2 var(--jd-font); border: 1px solid transparent; white-space: nowrap; cursor: default; }
button.jd-chip { cursor: pointer; background: var(--jd-surface); color: var(--jd-ink); border-color: var(--jd-line); }
button.jd-chip.is-on { background: var(--jd-ink); color: #fff; border-color: var(--jd-ink); }
.jd-label { display: inline-flex; align-items: center; font: 600 11px/1.2 var(--jd-font); letter-spacing: .03em; text-transform: uppercase; color: var(--jd-partner); border: 1px solid currentColor; border-radius: 6px; padding: 2px 6px; margin: 0 4px 0 0; }
.jd-labels { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.jd-pick { color: var(--jd-accent); font-weight: 600; font-size: 13px; }

/* Section heads, grids and cards */
.jd-sechead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin: 0 0 24px; }
.jd-sechead__title { font: 700 clamp(26px, 3.2vw, 38px)/1.12 var(--jd-font); letter-spacing: -.02em; margin: 0; }
.jd-sechead__intro { color: var(--jd-muted); margin: 10px 0 0; max-width: 44em; font-size: 17px; }
.jd-sechead__link { font-weight: 600; color: var(--jd-accent); text-decoration: none; white-space: nowrap; }
.jd-sechead__link::after { content: " →"; }
.jd-grid { display: grid; gap: var(--jd-gap); grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.jd-grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.jd-grid--5 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.jd-card { position: relative; display: flex; flex-direction: column; background: var(--jd-surface); border-radius: var(--jd-radius); overflow: hidden; box-shadow: var(--jd-shadow); transition: transform .2s, box-shadow .2s; }
.jd-card:hover { transform: translateY(-2px); box-shadow: var(--jd-shadow-l); }
.jd-card__media { display: block; overflow: hidden; }
.jd-card__media .jd-img { border-radius: 0; transition: transform .5s; }
.jd-card:hover .jd-card__media .jd-img { transform: scale(1.03); }
.jd-card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.jd-card__kicker { font-size: 13px; color: var(--jd-muted); margin: 0; font-weight: 500; }
.jd-card__title { font: 700 19px/1.25 var(--jd-font); margin: 0; letter-spacing: -.01em; }
.jd-card__title a { color: inherit; text-decoration: none; }
.jd-card__title a::after { content: ""; position: absolute; inset: 0; }
.jd-card__text { margin: 0; color: var(--jd-muted); font-size: 15px; line-height: 1.5; }
.jd-card__route { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--jd-accent); }
.jd-card .jd-btn, .jd-card .jd-label { position: relative; z-index: 1; align-self: flex-start; margin-top: auto; }
.jd-card--area .jd-card__body, .jd-card--style .jd-card__body { padding: 14px 16px 16px; }
.jd-card--area .jd-card__title, .jd-card--style .jd-card__title { font-size: 18px; }

/* Hero */
.jd-hero { position: relative; display: grid; border-radius: 0 0 28px 28px; overflow: hidden; background: #1A1D24; }
.jd-hero__media { grid-area: 1/1; min-height: 640px; }
.jd-hero__media .jd-img, .jd-hero__media .jd-ph { height: 100%; aspect-ratio: auto !important; border-radius: 0; }
.jd-hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10,12,16,.72) 0%, rgba(10,12,16,.35) 55%, rgba(10,12,16,.05) 100%); pointer-events: none; }
.jd-hero__panel { grid-area: 1/1; position: relative; z-index: 1; align-self: center; width: min(1200px, 100% - 2 * clamp(16px, 4vw, 40px)); margin: 0 auto; padding: 72px 0; color: #fff; }
.jd-hero__panel .jd-eyebrow { color: #C9D4FF; }
.jd-hero__title { font: 800 clamp(38px, 6vw, 72px)/1.03 var(--jd-font); letter-spacing: -.03em; margin: 0 0 16px; max-width: 13em; }
.jd-hero__lede { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; max-width: 34em; color: rgba(255,255,255,.88); margin: 0 0 28px; }
.jd-lang-ko .jd-hero__title, .jd-lang-zh-hant .jd-hero__title, .jd-lang-zh-hans .jd-hero__title { letter-spacing: -.01em; line-height: 1.18; }

/* Mini planner (hero) */
.jd-mini { background: rgba(255,255,255,.97); color: var(--jd-ink); border-radius: 20px; padding: 18px; box-shadow: var(--jd-shadow-l); max-width: 620px; display: grid; gap: 14px; }
.jd-mini__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jd-mini__styles { display: flex; flex-wrap: wrap; gap: 8px; }
.jd-mini__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.jd-mini__more { color: var(--jd-accent); font-weight: 600; text-decoration: none; }
.jd-tag { position: relative; display: inline-flex; }
.jd-tag input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.jd-tag span { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--jd-line); border-radius: 999px; font-size: 14px; font-weight: 500; background: var(--jd-surface); }
.jd-tag input:checked + span { background: var(--jd-ink); color: #fff; border-color: var(--jd-ink); }

/* Fields */
.jd-field { display: grid; gap: 6px; font-size: 14px; }
.jd-field > span { font-weight: 600; color: var(--jd-muted); font-size: 13px; }
.jd-app select, .jd-app input[type="text"], .jd-app input[type="date"], .jd-app input[type="number"], .jd-app input[type="search"], .jd-app textarea,
.jd-dialog select, .jd-dialog input[type="text"], .jd-dialog input:not([type]), .jd-dialog input[type="search"], .jd-dialog textarea,
.jd-mini select, .jd-planner select, .jd-planner input[type="date"] {
	font: 500 16px/1.3 var(--jd-font); color: var(--jd-ink); background: var(--jd-surface); border: 1px solid var(--jd-line-strong); border-radius: var(--jd-radius-s); min-height: 44px; padding: 8px 12px; width: 100%; max-width: 100%;
}
.jd-app textarea, .jd-dialog textarea { min-height: 64px; resize: vertical; }
.jd-app select, .jd-mini select, .jd-planner select, .jd-dialog select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235F636B' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

/* Planner */
.jd-planner { max-width: 1080px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) 0 80px; }
.jd-planner__head { margin: 0 0 28px; }
.jd-planner__title { font: 800 clamp(32px, 4.6vw, 52px)/1.06 var(--jd-font); letter-spacing: -.03em; margin: 0 0 12px; }
.jd-planner__intro { font-size: 18px; color: var(--jd-muted); max-width: 40em; margin: 0; line-height: 1.55; }
.jd-step { border: 0; margin: 0 0 20px; padding: clamp(18px, 3vw, 28px); background: var(--jd-surface); border-radius: 20px; box-shadow: var(--jd-shadow); min-width: 0; }
.jd-step legend { float: left; width: 100%; display: flex; align-items: center; gap: 12px; font: 700 20px/1.2 var(--jd-font); padding: 0; margin: 0 0 6px; }
.jd-step legend + * { clear: both; }
.jd-step__n { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 999px; background: var(--jd-accent); color: #fff; font-size: 15px; }
.jd-step__help { margin: 0 0 16px; color: var(--jd-muted); font-size: 15px; clear: both; }
.jd-fields { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin-top: 16px; clear: both; }
.jd-fields--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); margin-top: 22px; }
.jd-stepper { display: flex; align-items: stretch; border: 1px solid var(--jd-line-strong); border-radius: var(--jd-radius-s); overflow: hidden; background: var(--jd-surface); }
.jd-stepper button { width: 48px; border: 0; background: var(--jd-bg); font: 600 22px/1 var(--jd-font); cursor: pointer; color: var(--jd-ink); }
.jd-stepper input[type="number"] { border: 0 !important; text-align: center; border-radius: 0 !important; -moz-appearance: textfield; font-weight: 700 !important; }
.jd-stepper input::-webkit-outer-spin-button, .jd-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.jd-nights-text { color: var(--jd-accent); font-weight: 600; }
.jd-pick-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); clear: both; }
.jd-pick-grid--styles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.jd-pick-card { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px 8px 12px; border: 1.5px solid var(--jd-line); border-radius: var(--jd-radius); cursor: pointer; background: var(--jd-surface); transition: border-color .15s, box-shadow .15s; }
.jd-pick-card input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.jd-pick-card__media { display: block; border-radius: var(--jd-radius-s); overflow: hidden; margin-bottom: 8px; }
.jd-pick-card__name { font-weight: 700; font-size: 15px; padding: 0 4px; }
.jd-pick-card__hint { font-size: 13px; color: var(--jd-muted); padding: 0 4px; line-height: 1.4; }
.jd-pick-card:has(input:checked) { border-color: var(--jd-accent); box-shadow: 0 0 0 3px var(--jd-accent-soft); }
.jd-pick-card:has(input:checked)::after { content: ""; position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 999px; background: var(--jd-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='white' stroke-width='3'/%3E%3C/svg%3E") center no-repeat; }
.jd-pick-card.is-disabled { opacity: .45; }
.jd-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.jd-seg label { position: relative; }
.jd-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.jd-seg span { display: inline-flex; min-height: 40px; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--jd-line); background: var(--jd-surface); font-size: 14px; font-weight: 500; }
.jd-seg input:checked + span { background: var(--jd-ink); color: #fff; border-color: var(--jd-ink); }
.jd-seg input:focus-visible + span { outline: 3px solid rgba(31,63,168,.35); outline-offset: 2px; }
.jd-planner__submit { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-radius: 20px; padding: 14px 18px; box-shadow: var(--jd-shadow-l); }
.jd-planner__status { margin: 0; font-weight: 600; color: var(--jd-accent); }
.is-busy .jd-btn--primary { opacity: .7; }

/* Trip */
.jd-trip { max-width: 1240px; margin: 0 auto; padding: clamp(20px, 3vw, 40px) 0 80px; }
.jd-trip__head { margin: 0 0 18px; }
.jd-trip__title { font: 800 clamp(28px, 4vw, 46px)/1.08 var(--jd-font); letter-spacing: -.025em; margin: 0 0 10px; }
.jd-title-input { display: block; width: 100%; border: 0 !important; border-bottom: 2px dashed var(--jd-line) !important; border-radius: 0 !important; background: transparent !important; padding: 2px 0 6px !important; min-height: 0 !important; }
.jd-title-input:focus { outline: none; border-bottom-color: var(--jd-accent) !important; }
.jd-title-input::placeholder { color: var(--jd-ink); opacity: 1; }
.jd-trip__meta { color: var(--jd-muted); margin: 0; font-size: 15px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.jd-trip__intro { font-size: 18px; line-height: 1.55; color: #33363C; max-width: 40em; margin: 12px 0 0; }
.jd-page-hero--trip { margin: 0 0 20px; }
.jd-page-hero--trip .jd-img, .jd-page-hero--trip .jd-ph { max-height: 420px; }
.jd-itinerary__intro { margin: 0 0 24px; }
.jd-trip__meta--edit label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.jd-trip__meta--edit input[type="date"] { width: auto; min-height: 38px; }
.jd-trip__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.jd-status { color: var(--jd-muted); text-transform: none; letter-spacing: 0; font-weight: 500; }
.jd-status[data-state="saved"]::before { content: "● "; color: var(--jd-teal); }
.jd-status[data-state="saving"]::before { content: "● "; color: #C9A227; }
.jd-status[data-state="offline"]::before, .jd-status[data-state="saveError"]::before { content: "● "; color: var(--jd-warn); }
.jd-conflict { margin: 14px 0 0; padding: 12px 14px; background: var(--jd-warn-soft); border-radius: var(--jd-radius-s); color: var(--jd-warn); }
.jd-conflict p { margin: 0 0 8px; font-weight: 600; }

.jd-route { list-style: none; margin: 8px 0 24px; padding: 14px; display: flex; gap: 8px; overflow-x: auto; background: var(--jd-surface); border-radius: var(--jd-radius); box-shadow: var(--jd-shadow); scrollbar-width: thin; }
.jd-route li { display: flex; flex-direction: column; justify-content: center; flex: none; padding: 8px 14px; border-radius: var(--jd-radius-s); background: var(--jd-bg); position: relative; }
.jd-route li + li::before { content: "→"; position: absolute; left: -9px; top: 50%; transform: translate(-50%, -50%); color: var(--jd-line-strong); font-size: 13px; }
.jd-route li + li { margin-left: 14px; }
.jd-route__name { font-weight: 700; font-size: 15px; }
.jd-route__n { font-size: 12px; color: var(--jd-muted); }
.jd-route__end { flex-direction: row !important; align-items: center; gap: 6px; font-size: 13px; color: var(--jd-muted); background: transparent !important; }
.jd-route__end .jd-icon { width: 16px; height: 16px; }

.jd-trip__layout { display: grid; gap: var(--jd-gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .jd-trip__layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; } .jd-trip__side { position: sticky; top: 88px; max-height: calc(100vh - 100px); overflow: auto; } }

.jd-day { background: var(--jd-surface); border-radius: 20px; box-shadow: var(--jd-shadow); padding: clamp(16px, 2.6vw, 26px); margin: 0 0 var(--jd-gap); scroll-margin-top: 90px; }
.jd-day__head { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; margin: 0 0 12px; }
.jd-day__num { grid-row: span 2; margin: 0; display: inline-flex; align-items: center; justify-content: center; min-width: 64px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--jd-ink); color: #fff; font-weight: 700; font-size: 14px; align-self: center; }
.jd-day__date { margin: 0; font-size: 13px; color: var(--jd-muted); font-weight: 600; }
.jd-day__title { margin: 0; font: 700 clamp(20px, 2.4vw, 26px)/1.2 var(--jd-font); letter-spacing: -.015em; }
.jd-day__map { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--jd-accent); text-decoration: none; margin-top: 8px; justify-self: start; }
.jd-day__map .jd-icon { width: 18px; height: 18px; }
.jd-day__controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--jd-muted); }
.jd-day__controls label { display: inline-flex; align-items: center; gap: 6px; }
.jd-day__controls select { width: auto; min-height: 36px; padding: 4px 30px 4px 10px; font-size: 14px; }
.jd-day__note { background: var(--jd-bg); border-radius: var(--jd-radius-s); padding: 10px 14px; margin: 0 0 12px; font-size: 15px; }
.jd-day__notes { display: grid; gap: 6px; margin-top: 16px; font-size: 13px; font-weight: 600; color: var(--jd-muted); }
.jd-day__add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.jd-day__stay { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 14px; border-radius: var(--jd-radius-s); background: var(--jd-accent-soft); font-size: 14px; }
.jd-day__stay p { margin: 0; flex: 1; }
.jd-day__stay a { font-weight: 600; color: var(--jd-accent); white-space: nowrap; }
.jd-day__stay .jd-icon { color: var(--jd-accent); }

.jd-menu { position: relative; margin-left: auto; }
.jd-menu summary { list-style: none; }
.jd-menu__list { position: absolute; right: 0; top: 40px; z-index: 20; min-width: 260px; background: var(--jd-surface); border-radius: var(--jd-radius); box-shadow: var(--jd-shadow-l); padding: 6px; display: grid; }
.jd-menu__list button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px 12px; border: 0; background: none; border-radius: var(--jd-radius-s); font: 500 15px/1.3 var(--jd-font); color: var(--jd-ink); cursor: pointer; }
.jd-menu__list button:hover { background: var(--jd-bg); }

.jd-sketch { width: 100%; max-width: 420px; height: auto; display: block; margin: 0 0 12px; background: linear-gradient(var(--jd-bg), var(--jd-bg)); border-radius: var(--jd-radius-s); }
.jd-sketch polyline { fill: none; stroke: var(--jd-accent); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.jd-sketch circle { fill: var(--jd-accent); stroke: #fff; stroke-width: 2; }
.jd-sketch text { fill: #fff; font: 700 10px/1 var(--jd-font); text-anchor: middle; dominant-baseline: central; }

.jd-stops { list-style: none; margin: 0; padding: 0; position: relative; }
.jd-stop { position: relative; display: grid; grid-template-columns: 64px 64px minmax(0, 1fr); gap: 4px 14px; align-items: start; padding: 12px 0; border-top: 1px solid var(--jd-line); }
.jd-trip--edit .jd-stop { grid-template-columns: 64px 64px minmax(0, 1fr) auto; }
.jd-stops > .jd-stop:first-child, .jd-stops > .jd-leg:first-child + .jd-stop { border-top: 0; }
.jd-stop__time { font: 700 15px/1.2 var(--jd-font); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 4px; }
.jd-stop__letter { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: var(--jd-accent); color: #fff; font-size: 12px; font-weight: 700; }
.jd-stop__grip { display: none; color: var(--jd-line-strong); cursor: grab; }
.jd-trip--edit .jd-stop__grip { display: inline-flex; }
.jd-stop__media { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; }
.jd-stop__media .jd-img { width: 64px; height: 64px; aspect-ratio: 1/1; }
.jd-stop__icon { width: 64px; height: 64px; border-radius: 12px; background: var(--jd-bg); display: flex; align-items: center; justify-content: center; color: var(--jd-muted); }
.jd-stop--move .jd-stop__icon { background: var(--jd-teal-soft); color: var(--jd-teal); }
.jd-stop--move .jd-stop__name { color: var(--jd-teal); }
.jd-stop__body { min-width: 0; }
.jd-stop__name { font: 700 17px/1.3 var(--jd-font); margin: 0 0 2px; }
.jd-stop__name a { color: inherit; text-decoration: none; }
.jd-stop__name a:hover { color: var(--jd-accent); }
.jd-stop__meta { margin: 0; font-size: 14px; color: var(--jd-muted); }
.jd-stop__meta select { width: auto; min-height: 30px; padding: 2px 28px 2px 8px; font-size: 13px; display: inline-block; }
.jd-stop--move select { margin-top: 6px; font-size: 14px; min-height: 36px; }
.jd-stop__sum { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: #33363C; }
.jd-stop__note { margin: 6px 0 0; font-size: 14px; background: #FFF8E1; border-radius: 8px; padding: 6px 10px; }
.jd-stop__links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.jd-stop__links a { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--jd-accent); text-decoration: none; }
.jd-stop__links .jd-icon { width: 16px; height: 16px; }
.jd-stop__book { color: var(--jd-partner) !important; }
.jd-stop__notebox { margin-top: 8px; font-size: 13px; }
.jd-stop__notebox summary { cursor: pointer; color: var(--jd-muted); font-weight: 600; }
.jd-stop__notebox textarea { margin-top: 6px; font-size: 15px; }
.jd-stop__tools { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.jd-stop__tools .jd-icon { width: 18px; height: 18px; }
.jd-app select.jd-stop__day { width: 64px; min-height: 30px; padding: 2px 18px 2px 6px; font-size: 12px; font-weight: 600; color: var(--jd-muted); border-color: var(--jd-line); border-radius: 8px; background-position: right 5px center; background-size: 9px 6px; cursor: pointer; margin: 2px 0; }
.jd-app select.jd-stop__day:hover { border-color: var(--jd-line-strong); color: var(--jd-ink); }
.jd-stop.is-dragging { opacity: .4; }
.jd-stop.is-drop, .jd-stops__end.is-drop { box-shadow: inset 0 3px 0 var(--jd-accent); }
.jd-stops__end { min-height: 12px; list-style: none; }
.jd-leg { display: flex; align-items: center; gap: 8px; padding: 2px 0 2px 78px; font-size: 13px; color: var(--jd-muted); }
.jd-leg .jd-icon { width: 16px; height: 16px; }
.jd-leg a { color: var(--jd-accent); font-weight: 600; text-decoration: none; }
.jd-leg--free { color: var(--jd-teal); font-weight: 600; }
.jd-addday { text-align: center; }

@media (max-width: 640px) {
	.jd-stop, .jd-trip--edit .jd-stop { grid-template-columns: 52px minmax(0, 1fr) auto; }
	.jd-stop__media, .jd-stop__icon { display: none; }
	.jd-leg { padding-left: 64px; }
	.jd-stop__time { font-size: 14px; }
	.jd-day__controls { font-size: 12px; }
}

/* Side panel */
.jd-panel { background: var(--jd-surface); border-radius: 20px; box-shadow: var(--jd-shadow); padding: 18px; margin: 0 0 var(--jd-gap); }
.jd-panel__title { font: 700 18px/1.2 var(--jd-font); margin: 0 0 12px; }
.jd-checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.jd-check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px 0; border-top: 1px solid var(--jd-line); }
.jd-check:first-child { border-top: 0; }
.jd-check__box { width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--jd-line-strong); display: inline-flex; align-items: center; justify-content: center; position: relative; margin-top: 2px; color: #fff; }
.jd-check__box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.jd-check.is-done .jd-check__box { background: var(--jd-teal); border-color: var(--jd-teal); }
.jd-check.is-done .jd-check__box::after { content: ""; width: 12px; height: 7px; border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.jd-check.is-done .jd-check__title { text-decoration: line-through; color: var(--jd-muted); }
.jd-check__title { font-weight: 700; margin: 0; font-size: 15px; line-height: 1.35; }
.jd-check__text { margin: 4px 0 0; font-size: 14px; color: var(--jd-muted); line-height: 1.5; }
.jd-check__lines { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #33363C; display: grid; gap: 4px; }
.jd-check__links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 0; font-size: 14px; }
.jd-check__links a, .jd-check__lines a { color: var(--jd-accent); font-weight: 600; }
.jd-side-stays { padding: 12px 0; border-top: 1px solid var(--jd-line); scroll-margin-top: 100px; }
.jd-side-stays:first-of-type { border-top: 0; }
.jd-side-stays h3 { margin: 0 0 4px; font-size: 16px; }
.jd-hotel-mini { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 10px 0; }
.jd-hotel-mini .jd-img { width: 72px; height: 72px; border-radius: 12px; }
.jd-hotel-mini__name { margin: 0; font-weight: 700; font-size: 15px; }
.jd-hotel-mini__name a { color: inherit; text-decoration: none; }
.jd-hotel-mini .jd-btn { margin-top: 8px; }
.jd-hotel-list { display: grid; gap: 4px 24px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }

/* Dialogs and toasts */
.jd-dialog { border: 0; border-radius: 22px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: min(86vh, 760px); box-shadow: var(--jd-shadow-l); }
.jd-dialog::backdrop { background: rgba(15, 17, 21, .5); backdrop-filter: blur(2px); }
.jd-dialog__inner { padding: 20px; display: grid; gap: 14px; }
.jd-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jd-dialog__head h2 { margin: 0; font: 700 20px/1.2 var(--jd-font); }
.jd-dialog__actions { display: flex; justify-content: flex-end; margin: 0; }
.jd-dialog form { display: grid; gap: 14px; }
.jd-share__row { display: grid; gap: 6px; }
.jd-share__label { margin: 0; font-weight: 700; }
.jd-share__field { display: flex; gap: 8px; }
.jd-share__field input { flex: 1; font-size: 14px !important; }
.jd-search { font-size: 16px !important; }
.jd-picklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.jd-picklist .jd-pick { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--jd-line); color: var(--jd-ink); font-weight: 400; font-size: 15px; }
.jd-pick__img img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--jd-bg); }
.jd-pick__img:empty { width: 56px; height: 56px; border-radius: 10px; background: var(--jd-bg); }
.jd-pick__body { display: grid; gap: 2px; min-width: 0; }
.jd-pick__body .jd-muted { font-size: 13px; }
.jd-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; z-index: 9999; background: var(--jd-ink); color: #fff; padding: 12px 18px; border-radius: 999px; font: 600 15px/1.3 var(--jd-font); box-shadow: var(--jd-shadow-l); transition: opacity .25s, transform .25s; max-width: calc(100vw - 32px); }
.jd-toast.is-in { opacity: 1; transform: translate(-50%, 0); }
.jd-toast a { color: #fff; }

/* Pages: area, spot, stay, guides */
.jd-page-hero { border-radius: 24px; overflow: hidden; margin: clamp(12px, 2vw, 24px) 0 0; }
.jd-page-hero .jd-img { max-height: 520px; }
.jd-page-media { border-radius: 20px; overflow: hidden; margin: 0 0 20px; }
.jd-page-head { margin: clamp(20px, 3vw, 36px) 0 28px; max-width: 54rem; }
.jd-page-head__title { font: 800 clamp(32px, 4.6vw, 56px)/1.06 var(--jd-font); letter-spacing: -.03em; margin: 0 0 12px; }
.jd-page-head__intro { font-size: 19px; line-height: 1.55; color: var(--jd-muted); margin: 0 0 18px; }
.jd-lede { font-size: 19px; line-height: 1.55; color: var(--jd-muted); max-width: 44em; margin: 24px 0 0; }
.jd-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; margin: 0 0 20px; }
.jd-facts > div { background: var(--jd-surface); border-radius: var(--jd-radius-s); padding: 12px 14px; box-shadow: var(--jd-shadow); }
.jd-facts dt { font-size: 12px; font-weight: 700; color: var(--jd-muted); text-transform: uppercase; letter-spacing: .04em; }
.jd-facts dd { margin: 4px 0 0; font-weight: 600; }
.jd-facts--stack { grid-template-columns: 1fr; }
.jd-section { margin: clamp(40px, 6vw, 72px) 0 0; }
.jd-section--tight { margin-top: 40px; }
.jd-legs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.jd-legs li { background: var(--jd-surface); border-radius: var(--jd-radius-s); padding: 12px 14px; box-shadow: var(--jd-shadow); }
.jd-spot-layout { display: grid; gap: var(--jd-gap); margin-top: clamp(16px, 3vw, 32px); }
@media (min-width: 1024px) { .jd-spot-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .jd-spot-side { position: sticky; top: 88px; } }
.jd-spot-side .jd-actions { display: grid; gap: 8px; margin: 0 0 16px; }
.jd-tip { background: var(--jd-accent-soft); border-radius: var(--jd-radius); padding: 16px 18px; margin: 0 0 20px; }
.jd-tip p { margin: 0; }
.jd-verdict { font-size: 20px; line-height: 1.45; margin: 12px 0 0; font-weight: 500; }
.jd-meta-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.jd-booking { background: var(--jd-surface); border-radius: 20px; padding: 18px; box-shadow: var(--jd-shadow); display: grid; gap: 12px; }
.jd-booking__actions { display: grid; gap: 8px; }
.jd-booking__actions .jd-btn { width: 100%; }
.jd-booking__via, .jd-booking__note { margin: 0; font-size: 12px; color: var(--jd-muted); text-align: center; }
.jd-booking__note { text-align: left; }
.jd-booking__perk { background: var(--jd-accent-soft); border-radius: var(--jd-radius-s); padding: 12px 14px; }
.jd-booking__perk-text { margin: 0; font-weight: 700; }
.jd-booking__code { margin: 6px 0 0; font-size: 13px; }
.jd-booking__code code { background: #fff; border: 1px dashed var(--jd-line-strong); padding: 2px 8px; border-radius: 6px; font-weight: 700; user-select: all; }
.jd-prose { font-size: 17px; line-height: 1.75; max-width: 44em; }
.jd-guide-list { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; max-width: 54rem; }
.jd-guide-list li { display: grid; grid-template-columns: 40px 1fr; gap: 14px; background: var(--jd-surface); border-radius: var(--jd-radius); padding: 18px; box-shadow: var(--jd-shadow); }
.jd-guide-list h3 { margin: 0 0 4px; font-size: 18px; }
.jd-guide-list p { margin: 0; color: #33363C; line-height: 1.6; }
.jd-num { display: inline-flex; width: 32px; height: 32px; border-radius: 999px; align-items: center; justify-content: center; background: var(--jd-accent); color: #fff; font-weight: 700; }
.jd-table-wrap { overflow-x: auto; background: var(--jd-surface); border-radius: var(--jd-radius); box-shadow: var(--jd-shadow); margin: 0 0 12px; }
.jd-table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
.jd-table th, .jd-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--jd-line); vertical-align: top; }
.jd-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--jd-muted); }
.jd-cta { margin: 40px 0 0; background: var(--jd-ink); color: #fff; border-radius: 24px; padding: clamp(22px, 4vw, 40px); display: grid; gap: 10px; justify-items: start; }
.jd-cta h2 { margin: 0; font: 700 clamp(22px, 3vw, 30px)/1.2 var(--jd-font); }
.jd-cta p { margin: 0; color: rgba(255,255,255,.85); max-width: 40em; }
.jd-about__item { max-width: 46rem; margin: 0 0 28px; }
.jd-about__item h2 { font-size: 22px; margin: 0 0 6px; }
.jd-about__item p { margin: 0; font-size: 17px; line-height: 1.65; color: #33363C; }
.jd-empty { text-align: center; padding: 80px 0; }

/* Home: steps */
.jd-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--jd-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.jd-steps__item { background: var(--jd-surface); border-radius: 20px; padding: 14px 14px 22px; box-shadow: var(--jd-shadow); }
.jd-steps__media { border-radius: 14px; overflow: hidden; margin: 0 0 14px; }
.jd-steps__n { margin: 0; font-weight: 800; color: var(--jd-accent); font-size: 14px; padding: 0 6px; }
.jd-steps__item h3 { margin: 4px 0 6px; font-size: 20px; padding: 0 6px; }
.jd-steps__item p { margin: 0; color: var(--jd-muted); padding: 0 6px; line-height: 1.55; }

/* My trips */
.jd-mytrips__ul { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 10px; }
.jd-mytrip { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--jd-surface); border-radius: var(--jd-radius); padding: 16px 18px; box-shadow: var(--jd-shadow); }
.jd-mytrip__title { margin: 0 0 4px; font-weight: 700; font-size: 17px; }
.jd-mytrip__title a { color: inherit; text-decoration: none; }
.jd-mytrip__actions { display: flex; gap: 8px; }

.jd-trip.is-loading, [data-jd-app].is-loading { opacity: .6; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
	.jd-card, .jd-btn, .jd-card__media .jd-img, .jd-toast { transition: none; }
}

@media print {
	.jd-trip__actions, .jd-day__controls, .jd-day__add, .jd-day__notes, .jd-stop__tools, .jd-stop__notebox:not([open]), .jd-addday, .jd-trip__side .jd-panel:last-child, .jd-stop__grip, .jd-menu, .jd-conflict { display: none !important; }
	.jd-trip__layout { display: block; }
	.jd-day, .jd-panel, .jd-route { box-shadow: none; border: 1px solid #ddd; break-inside: avoid-page; }
	.jd-title-input { border: 0 !important; }
	.jd-stop__links a::after { content: ""; }
}

/* Placeholder label stays out of the way of overlaid text. */
.jd-hero__media .jd-ph, .jd-page-hero .jd-ph { align-items: flex-end; justify-content: flex-end; padding: 14px; }
.jd-hero__media .jd-ph { align-items: flex-start; padding-top: 90px; }
.jd-stepper input[type="number"] { flex: 1; min-width: 0; width: auto; }
.jd-stepper button { flex: none; }
@media (max-width: 640px) {
	.jd-planner__submit { padding: 10px 12px; gap: 6px 12px; bottom: 8px; border-radius: 16px; }
	.jd-planner__submit .jd-btn { flex: 1; }
	.jd-planner__submit .jd-muted { font-size: 12px; flex-basis: 100%; }
}
