.group-main { max-width: 930px; }
.legacy-link { margin-inline-start: auto; font-size: .83rem; }
#status:not(:empty), #editor-status { border-radius: 10px; padding: 8px 12px; background: var(--sand); }
#status:empty { display: none; }
.auth-card { max-width: 470px; margin: 28px auto; padding: clamp(18px,4vw,32px); }
.group-form, #fields { display: grid; gap: 10px; }
.group-form label, .group-toolbar label, .room-bar label { display: grid; gap: 4px; }
.group-main select { min-height: 44px; max-width: 100%; }
.room-bar, .group-toolbar, .room-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.group-toolbar { justify-content: space-between; }
.room-bar label { flex: 1 1 220px; }
.room-cover { background: #164b45; color: #fff; border-radius: 17px; padding: clamp(16px,4vw,36px); margin-block: 18px 12px; }
.room-cover h1 { font-size: clamp(1.75rem,6vw,3.2rem); margin-bottom: .2em; overflow-wrap: anywhere; }
.room-cover p:last-child { margin: 0; }
.room-tabs { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.room-tabs [aria-current] { background: var(--plum); color: white; }
.group-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.group-list li { overflow-wrap: anywhere; }
.group-list li:not(.panel) { padding-block: 4px; }
.group-list small { display: block; color: var(--muted); }
.group-list .links > * { min-height: 44px; }
.group-list .links { gap: 7px; flex-wrap: wrap; }
.money-total { display: block; font-size: 1.55rem; }
#settings .panel { margin-bottom: 12px; }
#editor { width: min(470px, calc(100% - 24px)); max-height: calc(100dvh - 28px); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--card); }
#editor::backdrop { background: #172b2ba8; }
#editor .group-toolbar { margin-bottom: 0; justify-content: flex-start; }

.trip-welcome { max-width: 620px; margin: clamp(16px,5vw,48px) auto; }
.welcome-actions { display: grid; gap: 12px; margin-top: 18px; }
.welcome-choice {
  display: grid; gap: 5px; text-align: start; padding: 16px;
  border: 1px solid var(--plum); border-radius: 14px; background: var(--plum); color: white;
}
.welcome-choice strong { font-size: 1.2rem; }
.welcome-choice span { font-size: .93rem; }
.welcome-choice-secondary { color: var(--ink); background: var(--card); border-color: var(--line); }
.invite-code input { letter-spacing: .07em; font-weight: 750; text-align: center; }

.calendar-hint { font-size: .9rem; }
.trip-calendar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(106px,1fr); gap: 8px; overflow-x: auto; padding: 4px 2px 12px; }
.calendar-day { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 6px; }
.calendar-day.selected, .calendar-day.drop-day { background: var(--sand); border-color: var(--plum); }
.calendar-date { width: 100%; min-height: 44px; border: 0; border-radius: 7px; background: transparent; font-weight: 700; font-size: .88rem; }
.calendar-date[aria-pressed="true"] { color: white; background: var(--plum); }
.event-drag { flex: 0 0 32px; cursor: grab; touch-action: none; font-size: 1.15rem; border: 0; background: transparent; padding: 0; }
.dragging, .dragging .event-drag { cursor: grabbing; user-select: none; }
.money-total strong { display: block; }
.planner-map-card { margin-top: 12px; }
.planner-map-card summary { font-weight: 750; min-height: 44px; }

.event-thumb { flex: none; display: block; width: clamp(24px,9vw,48px); height: 24px; border-radius: 5px; object-fit: cover; background: var(--sand); }
.calendar-credits { margin: 4px 0 10px; color: var(--muted); font-size: .85rem; }
.calendar-credits summary { min-height: 44px; padding-block: 8px; }

.time-plan { margin-top: 14px; }
.time-plan h2 { font-size: 1.35rem; }
.time-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .88rem; }
.time-legend span:first-child { color: #165d48; }
.time-legend span:last-child { color: #855016; }
#time-note { font-size: .83rem; }
.calendar-time-summary { font-size: .73rem; color: var(--muted); line-height: 1.45; padding: 4px 4px 0; margin: 0; }

.hourly-calendar { position: relative; --hour-label: clamp(55px,14vw,92px); margin-block: 12px; }
.hour-row { display: grid; grid-template-columns: var(--hour-label) 1fr; height: 84px; }
.hour-row::after { content: ''; border-top: 1px solid var(--line); }
.hour-row span { padding-inline-end: 4px; color: var(--muted); font-size: .77rem; line-height: 1.2; }
.hour-events { position: absolute; inset: 0 0 0 var(--hour-label); pointer-events: none; }
.hour-event {
  position: absolute; display: flex; align-items: stretch; overflow: hidden; pointer-events: auto; padding: 0;
  border: 0; border-inline-start: 4px solid #165d48; border-radius: 5px;
  background: #e1f3eb; color: #163d30; text-align: start; line-height: 1.2;
}
.hour-event.travel { border-color: #a45b16; background: #fff0d9; color: #5d350e; }
.hour-event strong, .hour-event small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hour-event strong { font-size: .84rem; }
.hour-event small { font-size: .73rem; }
.hour-event.compact small { display: none; }
.day-route-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }

.hourly-calendar.drop-day { outline: 2px dashed var(--plum); outline-offset: 2px; }
.hour-event-details { min-width: 0; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 4px; background: transparent; border: 0; text-align: start; padding: 2px 4px; }
.hour-event-details > span { min-width: 0; }
.hour-event:focus-within { outline: 2px solid var(--plum); z-index: 1; }

.day-drop-dock {
  position: fixed; z-index: 520; inset: auto 10px max(10px,env(safe-area-inset-bottom));
  max-width: 560px; margin-inline: auto; padding: 9px;
  color: var(--ink); background: var(--card); border: 2px solid var(--plum); border-radius: 13px;
  box-shadow: 0 6px 22px #172b2b40; font-size: .86rem;
}
#day-drop-options { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0,1fr); gap: 4px; margin-top: 5px; }
#day-drop-options > span {
  display: grid; place-items: center; text-align: center; min-height: 44px; line-height: 1.1;
  border-radius: 6px; background: var(--sand); padding: 3px 1px;
}
#day-drop-options > .current { opacity: .46; }
#day-drop-options > .drop-day { color: white; background: var(--plum); }

.trip-tools summary { min-height: 44px; padding: 7px 10px; font-weight: 700; }
.trip-tools > div, .schedule-controls, .schedule-switch { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.trip-tools > div { padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); }
.day-overview { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; }
.day-overview h2 { margin-bottom: 4px; }
.day-start { font-weight: 700; }
.schedule-controls { margin-block: 12px; }
.schedule-switch { gap: 3px; padding: 3px; border-radius: 8px; background: var(--sand); }
.schedule-switch button { min-height: 44px; padding: 4px 9px; border: 0; border-radius: 6px; background: transparent; font-weight: 700; }
.schedule-switch [aria-pressed="true"] { background: var(--plum); color: white; }
.day-stop-list { display: grid; gap: 10px; list-style: none; padding: 0; margin: 12px 0; }
.stop-card {
  display: grid; grid-template-columns: 66px minmax(0,1fr); gap: 6px 10px; align-items: start;
  border: 1px solid var(--line); border-radius: 11px; padding: 10px; background: var(--card);
}
.stop-media {
  display: grid; place-items: center; width: 66px; height: 54px; overflow: hidden;
  border-radius: 7px; color: var(--plum); background: var(--sand);
}
.stop-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.stop-number { font-size: 1rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.stop-info { min-width: 0; }
.stop-meta, .stop-durations { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
.stop-meta { font-size: .76rem; color: var(--muted); line-height: 1.3; }
.stop-meta time { font-weight: 750; color: var(--plum); font-variant-numeric: tabular-nums; }
.stop-name { display: block; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.3; margin-block: 3px 5px; }
.stop-duration, .stop-durations small { font-size: .73rem; line-height: 1.35; color: var(--muted); }
.stop-duration { border-radius: 5px; padding: 2px 5px; }
.stop-duration.visit { background: #e1f3eb; color: #163d30; }
.stop-duration.travel { background: #fff0d9; color: #5d350e; }
.day-stop-actions {
  grid-column: 1 / -1; justify-self: end; display: flex; align-items: center; gap: 4px;
  width: 100%; justify-content: end; border-top: 1px solid var(--line);
}
.stop-action {
  min-width: 68px; min-height: 44px; padding: 3px 7px; border: 0; border-radius: 6px;
  background: transparent; color: var(--plum); font-size: .83rem; font-weight: 700;
}
.stop-action:hover { background: var(--sand); }
.stop-map-action { margin-inline-end: auto; display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.stop-extra { grid-column: 2; min-width: 0; font-size: .82rem; color: var(--muted); }
.stop-extra summary { min-height: 44px; display: list-item; align-content: center; }
.stop-extra p { overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .stop-card { grid-template-columns: 52px minmax(0,1fr); gap: 5px 7px; padding: 8px; }
  .stop-media { width: 52px; height: 46px; }
}

.mobile-legacy-link { display: none; }
.schedule-jump { margin-bottom: 8px; }
.day-overview-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.day-overview-actions .text-button, .route-parts summary { min-height: 44px; }
.route-parts summary { font-size: .88rem; padding-block: 8px; }

@media (max-width: 600px) {
  .mast-inner { min-height: 48px; padding-block: 2px; }
  .mast-inner .legacy-link { display: none; }
  .mast-inner #logout { margin-inline-start: auto; border: 0; background: transparent; font-size: .81rem; padding-inline: 5px; }
  .group-main { padding-top: 5px; }
  .room-bar { flex-wrap: nowrap; align-items: center; gap: 6px; margin-bottom: 7px; }
  .room-bar label { flex: 1; min-width: 0; }
  .room-switch-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); }
  .room-bar select { width: 100%; font-size: .9rem; }
  .trip-tools summary { white-space: nowrap; font-size: .82rem; padding-inline: 5px; }
  .trip-tools > div { position: absolute; z-index: 20; right: 12px; max-width: calc(100% - 24px); }
  .mobile-legacy-link { display: inline-flex; align-items: center; min-height: 44px; }
  .room-cover { margin: 8px 0; padding: 11px 13px; border-radius: 11px; }
  .room-cover h1 { font-size: clamp(1.23rem,5.4vw,1.65rem); }
  .room-cover p { display: inline; font-size: .77rem; }
  #room-destination::before { content: ' · '; }
  .room-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; padding-bottom: 6px; margin-bottom: 6px; }
  .room-tabs button { padding-inline: 3px; font-size: .84rem; white-space: nowrap; }
  .tab-detail { display: none; }
  .short-trip .schedule-jump { display: none; }
  .trip-calendar { grid-auto-columns: minmax(42px,1fr); gap: 4px; padding: 3px 1px 6px; }
  .calendar-day { padding: 2px; border-radius: 8px; }
  .calendar-date { display: grid; place-content: center; justify-items: center; font-size: .67rem; line-height: 1.2; padding: 0; }
  .calendar-date strong { font-size: .94rem; }
  .date-month, .calendar-time-summary { display: none; }
  .time-plan { margin-top: 6px; padding: 10px; }
  .day-overview { gap: 3px; }
  .day-overview h2 { font-size: 1.15rem; }
  .day-overview p { margin-bottom: 2px; font-size: .83rem; line-height: 1.4; }
  .day-overview-actions { gap: 7px; }
  .day-overview-actions button, .day-route-links a { font-size: .85rem; }
  .day-route-links { margin-top: 5px; margin-bottom: 0; }
  .schedule-controls { margin-block: 5px; }
  .schedule-switch button { font-size: .82rem; }
}
.day-overview-actions .day-route-links { margin: 0; }
.day-secondary-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.day-secondary-actions button { min-height: 44px; }
@media (max-width: 600px) {
  .day-overview-actions { margin-top: 5px; }
  .time-legend { margin-bottom: 2px; font-size: .78rem; }
  .hourly-calendar { margin-block: 6px; }
}

.group-form label.route-start-option { display: flex; align-items: center; gap: 8px; min-height: 44px; }

.route-transport { display: block; color: var(--muted); font-size: .88rem; }

.hourly-calendar.has-milestones .hour-events { inset-inline-start: calc(var(--hour-label) + 22px); }
.hour-milestones { position: absolute; inset: 0 auto 0 var(--hour-label); width: 22px; pointer-events: none; }
.hour-milestone { position: absolute; inset-inline-start: 0; width: 22px; height: 22px; color: var(--plum); pointer-events: auto; font-size: .8rem; }
.hour-event.short-event .hour-event-details { padding-block: 0; }
.hour-event.short-event strong { font-size: .69rem; }
.hour-event.short-event .event-thumb { display: none; }
.event-preview-photo { width: 100%; max-height: 135px; object-fit: cover; border-radius: 9px; }
.event-preview-times { display: grid; gap: 6px; margin: 0; }
.event-preview-times > div { display: grid; grid-template-columns: 100px minmax(0,1fr); gap: 8px; }
.event-preview-times dt { color: var(--muted); font-size: .84rem; }
.event-preview-times dd { margin: 0; font-weight: 700; }
.event-preview-note { background: var(--sand); padding: 9px; border-radius: 8px; }
.trip-task-items { display: grid; gap: 5px; }
.trip-task-items label { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 5px; border-bottom: 1px solid var(--line); }

.stop-preview-link { border: 0; background: transparent; text-align: start; padding: 0; color: var(--ink); font-weight: 750; }

.trip-stays { margin-block: 16px; padding: 16px; border: 1px solid #cdd9d2; border-radius: 16px; background: #fffdf8; }
.trip-stays > summary { cursor: pointer; font-weight: 700; }
.trip-stays > summary span { display: block; font-size: .85rem; font-weight: 400; margin-top: 4px; }
.stay-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,260px),1fr)); gap: 12px; margin-top: 18px; }
.stay-card { min-width: 0; border: 1px solid #d8ded8; border-radius: 12px; padding: 16px; }
.stay-card h3 { font-size: 1.1rem; margin-block: 6px; overflow-wrap: anywhere; }
.stay-card p { font-size: .9rem; margin-block: 8px; }
.stay-card small { display: block; font-weight: 400; }
.stay-card details { margin-block: 12px; }
.stay-card summary { cursor: pointer; font-size: .88rem; }
.stay-current { border-color: #287163; background: #edf7f1; }
.stay-total { margin-top: 18px; padding-top: 14px; border-top: 1px solid #cdd9d2; }
.event-food-gallery { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.event-food-gallery figure { margin: 0; min-width: min(80%,280px); flex: 1 0 75%; scroll-snap-align: start; }
.event-food-gallery .event-preview-photo { width: 100%; height: 240px; object-fit: cover; border-radius: 14px; }
.event-food-gallery figcaption { font-size: .85rem; margin-top: 6px; }

.stay-gallery{margin-block:14px}.stay-gallery-strip{display:flex;gap:12px;overflow-x:auto;scroll-snap-type:x mandatory;margin-top:10px}.stay-gallery-strip figure{flex:0 0 90%;margin:0;scroll-snap-align:start}.stay-gallery-strip img{display:block;width:100%;height:210px;object-fit:contain;border-radius:12px;background:#edf0e3}.stay-gallery-strip figcaption{font-size:.75rem;margin-top:6px}
