:root {
  --label: #1d1d1f;
  --secondary: #6e6e73;
  --tertiary: #86868b;
  --blue: #0071e3;
  --blue-press: #0066cc;
  --green: #248a3d;
  --orange: #c93400;
  --red: #ff3b30;
  --fill: #f2f2f7;
  --line: rgba(0, 0, 0, 0.08);
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.05);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f5f7;
  -webkit-font-smoothing: antialiased;
}
body { margin: 0; min-height: 100vh; background: #f5f5f7; }
button, input, select, textarea { font: inherit; color: inherit; box-sizing: border-box; }
[hidden] { display: none !important; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22);
}

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.brand-logo {
  height: 76px;
  width: auto;
  background: transparent;
  object-fit: contain;
  display: block;
}
.eyebrow { color: var(--tertiary); font-size: 12px; font-weight: 500; margin-top: 2px; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.022em; line-height: 1.15; }
.clock-block { margin-left: auto; text-align: right; }
#clock {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--tertiary); font-size: 12px; }
.live::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c7c7cc;
}
.live.on::before { background: #34c759; box-shadow: 0 0 0 3px rgba(52, 199, 89, 0.16); }
.live.off { color: var(--red); }
.live.off::before { background: var(--red); }
.top-actions { display: flex; gap: 8px; }

.solid, .ghost, .danger, .icon-btn {
  border-radius: 980px;
  padding: 8px 14px;
  border: 0;
  font-weight: 560;
  letter-spacing: -0.01em;
  transition: background 0.15s ease, transform 0.15s ease;
}
.solid { background: var(--blue); color: white; }
.solid:hover { background: var(--blue-press); }
.ghost { background: rgba(0, 0, 0, 0.05); color: var(--label); }
.ghost:hover { background: rgba(0, 0, 0, 0.08); }
.danger { background: transparent; color: var(--red); padding-inline: 8px; }
.danger:hover { background: rgba(255, 59, 48, 0.08); }
.icon-btn { background: transparent; color: var(--blue); font-weight: 560; }
.solid:disabled, .ghost:disabled { opacity: 0.45; cursor: wait; }

main { width: min(1120px, calc(100% - 40px)); margin: 22px auto 56px; }
.controls { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.stats {
  display: flex;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 3px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
}
.stats button {
  border: 0;
  background: transparent;
  border-radius: 9px;
  padding: 7px 12px;
  color: var(--label);
  font-size: 13px;
  font-weight: 560;
  white-space: nowrap;
}
.stats button.active {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
}
.toolbar { display: flex; gap: 8px; }
#search {
  flex: 1;
  min-width: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.05) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2386868b' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14'/%3E%3C/svg%3E") 12px 50% no-repeat;
  border-radius: 12px;
  padding: 11px 14px 11px 36px;
}
#search:focus { background-color: white; }

.group-title {
  margin: 22px 4px 8px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.team-card {
  background: #fff;
  border-radius: 22px;
  padding: 12px 12px 4px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.team-tools { display: flex; gap: 8px; margin: 0 0 12px; }
.team-tools button {
  border: 0;
  border-radius: 980px;
  padding: 8px 14px;
  background: #fff;
  color: #1d1d1f;
  font-weight: 680;
  box-shadow: var(--shadow);
}
.team-card-head {
  position: sticky;
  top: var(--sticky-top, 0px);
  z-index: 4;
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(14px);
  border-radius: 12px;
}
.team-card.collapsed { padding-bottom: 12px; }
.team-card.collapsed .team-body { display: none; }
.team-card.collapsed .team-card-head { margin-bottom: 0; }
.team-card-head strong { font-size: 18px; letter-spacing: -0.02em; }
.team-card-head span { color: var(--secondary); font-weight: 640; }
.team-card-head em { font-style: normal; color: var(--blue); font-size: 13px; font-weight: 650; }
.fold-mark { margin-left: auto; font-style: normal; color: var(--blue); font-size: 13px; font-weight: 700; }
.team-card > .guest { box-shadow: none; margin-bottom: 8px; }
.team-card .room-party { margin-bottom: 8px; }
.team-card .room-party:last-child { margin-bottom: 4px; }
.section-switch { display: flex; gap: 8px; margin-bottom: 12px; }
.section-switch[hidden] { display: none; }
.section-switch button {
  flex: 1;
  border: 0;
  border-radius: 980px;
  padding: 11px 16px;
  background: #fff;
  color: #1d1d1f;
  font-weight: 680;
  box-shadow: var(--shadow);
}
.section-switch button.active { background: #1d1d1f; color: #fff; }
.level-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 980px;
  font-style: normal;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.5;
  vertical-align: 2px;
}
.guest.level-important .level-tag { background: #fff; color: #d70015; }
.guest.level-senior .level-tag { background: #fff; color: #0a4f73; }
.guest.level-normal .level-tag { background: #f2f2f7; color: #3a3a3c; }
.level-legend { display: flex; gap: 8px; margin: 0 0 12px; }
.level-legend .lv {
  padding: 4px 10px;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 720;
}
.level-legend .important { background: #ff3b30; color: #fff; }
.level-legend .senior { background: #ffd60a; color: #1d1d1f; }
.level-legend .normal { background: #007aff; color: #fff; }
.lv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.lv-dot.important { background: #ff3b30; }
.lv-dot.senior { background: #ffd60a; }
.lv-dot.normal { background: #007aff; }
.stats button { display: inline-flex; align-items: center; gap: 6px; }
.room-card {
  background: #fff;
  border-radius: 22px;
  padding: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.room-card.level-important { box-shadow: inset 0 0 0 2px #ff3b30, var(--shadow); }
.room-card.level-senior { box-shadow: inset 0 0 0 2px #ffd60a, var(--shadow); }
.room-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.room-card-head strong { font-size: 22px; letter-spacing: -0.03em; }
.room-card-head span { color: var(--secondary); font-weight: 650; }
.room-person, .room-companion {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 16px;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.stay-hotel {
  flex: 1 0 100%;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.01em;
  opacity: 0.92;
}
.room-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}
.room-edit {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.82;
  font-size: 13px;
  font-weight: 650;
  padding: 4px 2px;
}
.room-no {
  font-size: 28px;
  font-weight: 680;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.room-person.level-important, .room-companion.level-important { background: #ff3b30; color: #fff; }
.room-person.level-senior, .room-companion.level-senior { background: #ffd60a; color: #1d1d1f; }
.room-person.level-normal, .room-companion.level-normal { background: #007aff; color: #fff; }
.room-person-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; flex: 1; }
.room-person-main span { color: inherit; opacity: 0.86; }
.room-person.level-important .level-tag, .room-companion.level-important .level-tag { background: #fff; color: #d70015; }
.room-person.level-senior .level-tag, .room-companion.level-senior .level-tag { background: #fff; color: #0a4f73; }
.room-person.level-normal .level-tag, .room-companion.level-normal .level-tag { background: #fff; color: #3a3a3c; }
.room-deliver {
  flex: none;
  border: 0;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 12px;
  background: #fff;
  color: #248a3d;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.room-person.level-senior .room-deliver,
.room-companion.level-senior .room-deliver {
  background: #1d1d1f;
  color: #fff;
  box-shadow: none;
}
.room-checkin {
  flex: none;
  border: 0;
  border-radius: 999px;
  min-height: 28px;
  padding: 0 12px;
  background: #fff;
  color: #007aff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: -0.02em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.gift-line {
  flex: 0 0 100%;
  display: block;
  margin-top: 4px;
  padding: 0;
  background: none;
  font-style: normal;
}
.gift-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  background: #fff;
  color: #248a3d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.gift-pill i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #34c759;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
}
.room-person-main .gift-pill span {
  color: #248a3d;
  opacity: 0.72;
  font-weight: 600;
}
.stay-pill { color: #007aff; }
.stay-pill i { background: #007aff; }
.room-person-main .stay-pill span { color: #007aff; }
.self-tag {
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 999px;
  background: #e8e8ed;
  color: #3a3a3c;
}
.name-tag, .age-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  vertical-align: 2px;
}
.name-tag { background: #f2f2f7; color: #3a3a3c; }
.age-tag { background: #e5f6ea; color: #1b7a3a; }
.guest.level-important .name-tag, .guest.level-senior .name-tag,
.room-person.level-important .name-tag, .room-person.level-senior .name-tag,
.room-companion.level-important .name-tag, .room-companion.level-senior .name-tag { background: #fff; color: #1d1d1f; }
.guest.level-important .age-tag, .guest.level-senior .age-tag,
.room-person.level-important .age-tag, .room-person.level-senior .age-tag,
.room-companion.level-important .age-tag, .room-companion.level-senior .age-tag { background: #fff; color: #1b7a3a; }
.room-person.phase-cancelled strong { text-decoration: line-through; opacity: 0.72; }
.room-party:has(.room-companion) {
  margin-bottom: 10px;
  padding: 6px;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.room-party:has(.room-companion) .room-person { margin-bottom: 4px; }
.room-companion { margin: 0 0 8px 18px; }
.header-toggle { display: none; }
.level-switch { display: flex; gap: 6px; margin-top: 8px; width: fit-content; }
.level-switch button {
  flex: none;
  width: 36px;
  min-height: 22px;
  min-width: 36px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: transparent;
  font-size: 13px;
  font-weight: 650;
}
.level-switch button[data-level="important"] { background: #ff3b30; }
.level-switch button[data-level="senior"] { background: #ffd60a; }
.level-switch button[data-level="normal"] { background: #007aff; }
.level-switch button.on { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px #1d1d1f; }
.guest {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) 148px;
  gap: 8px 22px;
  align-items: center;
  background: var(--card);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.guest.level-important {
  background: #ff3b30;
  color: #fff;
  box-shadow: 0 12px 28px rgba(255, 59, 48, 0.28);
}
.guest.level-senior {
  background: #ffd60a;
  color: #1d1d1f;
  box-shadow: 0 12px 28px rgba(214, 168, 0, 0.28);
}
.guest.level-normal {
  background: #007aff;
  color: #fff;
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.28);
}
.guest.level-important .who span,
.guest.level-important .trip span,
.guest.level-important .route,
.guest.level-important .arrive small,
.guest.level-important .arrive em,
.guest.level-important .depart-line,
.guest.level-important .plan-time,
.guest.level-important .substatus {
  color: rgba(255, 255, 255, 0.9);
}
.guest.level-important .companion,
.guest.level-important .companion strong,
.guest.level-senior .companion,
.guest.level-senior .companion strong {
  color: #1d1d1f;
}
.guest.level-important .companion span,
.guest.level-senior .companion span { color: #6e6e73; }
.guest.level-normal .who span,
.guest.level-normal .trip span,
.guest.level-normal .route,
.guest.level-normal .arrive small,
.guest.level-normal .arrive em,
.guest.level-normal .depart-line,
.guest.level-normal .plan-time,
.guest.level-normal .substatus {
  color: rgba(255, 255, 255, 0.9);
}
.guest.level-normal .companion,
.guest.level-normal .companion strong { color: #1d1d1f; }
.guest.level-normal .companion span { color: #6e6e73; }
.guest.level-normal .badge { background: rgba(255, 255, 255, 0.28); color: #fff; }
.guest.level-normal .ghost { background: rgba(255, 255, 255, 0.22); color: #fff; }
.guest.level-normal .ghost:hover { background: rgba(255, 255, 255, 0.34); }
.guest.level-normal .solid { background: #fff; color: #007aff; }
.guest.level-normal .details { border-top-color: rgba(255, 255, 255, 0.28); }
.guest.level-normal .meta span { background: rgba(255, 255, 255, 0.2); color: #fff; }
.guest.level-normal .name-tag,
.room-person.level-normal .name-tag,
.room-companion.level-normal .name-tag { background: #fff; color: #1d1d1f; }
.guest.level-normal .age-tag,
.room-person.level-normal .age-tag,
.room-companion.level-normal .age-tag { background: #fff; color: #1b7a3a; }
.color-choice { width: 52px; min-height: 34px; padding: 0; }
.color-choice.important { background: #ff3b30; }
.color-choice.senior { background: #ffd60a; }
.color-choice.normal { background: #007aff; }
.color-choice:has(input:checked) { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #1d1d1f; }
.guest.level-senior .who span,
.guest.level-senior .trip span,
.guest.level-senior .route,
.guest.level-senior .arrive small,
.guest.level-senior .arrive em,
.guest.level-senior .depart-line,
.guest.level-senior .plan-time,
.guest.level-senior .substatus {
  color: rgba(29, 29, 31, 0.72);
}
.guest.level-important .badge {
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.guest.level-senior .badge {
  background: rgba(255, 255, 255, 0.62);
  color: #1d1d1f;
}
.guest.level-important .ghost { background: rgba(255, 255, 255, 0.22); color: #fff; }
.guest.level-important .ghost:hover { background: rgba(255, 255, 255, 0.34); }
.guest.level-important .solid { background: #fff; color: #d70015; }
.guest.level-important .solid:hover { background: #fff; }
.guest.level-senior .ghost { background: rgba(255, 255, 255, 0.62); color: #1d1d1f; }
.guest.level-senior .solid { background: #007aff; color: #fff; }
.guest.level-senior .solid:hover { background: #0066cc; }
.guest.level-important .details { border-top-color: rgba(255, 255, 255, 0.28); }
.guest.level-senior .details { border-top-color: rgba(0, 0, 0, 0.12); }
.guest.level-important .meta span { background: rgba(255, 255, 255, 0.2); color: #fff; }
.guest.level-senior .meta span { background: rgba(255, 255, 255, 0.45); color: #1d1d1f; }
.guest.level-important.phase-cancelled .who > strong { color: rgba(255, 255, 255, 0.72); }
.who > strong, .trip b, .arrive strong { display: block; }
.who > strong { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 650; letter-spacing: -0.022em; }
.who-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.who-meta .level-tag, .who-meta .name-tag, .who-meta .age-tag, .who-meta .self-tag, .who-meta .host-done, .who-meta .review-tag { margin-left: 0; margin-top: 0; }
.who-sub {
  display: block;
  max-width: 36em;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.star { width: 18px; height: 18px; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.16)); }
.star.sm { width: 13px; height: 13px; filter: none; }
.companions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.companion {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 3px 8px 3px 4px;
  border-radius: 980px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--secondary);
  font-size: 13px;
  line-height: 1.35;
}
.companion strong { color: var(--label); font-size: 13px; font-weight: 640; }
.host-done {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 980px;
  background: rgba(52, 199, 89, 0.18);
  color: #248a3d;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}
.guest.level-important .host-done { background: #fff; color: #248a3d; }
.pick {
  border: 0;
  border-radius: 980px;
  padding: 3px 8px;
  background: #007aff;
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.pick.done { background: rgba(0, 0, 0, 0.06); color: #1d1d1f; }
.separate-ops { display: flex; align-items: center; gap: 6px; justify-self: start; }
.separate-trips {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 8px;
}
.separate {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  padding: 9px 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #1d1d1f;
}
.separate-who, .separate-code b { display: flex; align-items: center; gap: 6px; min-width: 0; }
.separate-who strong, .separate-code b { font-size: 16px; font-weight: 680; letter-spacing: -0.02em; }
.separate-who span, .separate-code span, .separate-route, .separate-times em { color: #6e6e73; font-size: 12px; font-style: normal; }
.separate-times { display: flex; gap: 16px; align-items: baseline; font-variant-numeric: tabular-nums; }
.separate-times b { font-size: 18px; font-weight: 680; }
.mini-badge {
  justify-self: start;
  border-radius: 980px;
  padding: 4px 9px;
  background: #f2f2f7;
  color: #1d1d1f;
  font-size: 12px;
  font-weight: 700;
}
.who span, .trip span, .route, .arrive small, .substatus { color: var(--secondary); font-size: 13px; }
.trip b { font-size: 20px; font-weight: 650; letter-spacing: -0.03em; }
.route { margin-top: 2px; }
.depart-line { display: block; margin-top: 2px; color: var(--tertiary); font-size: 12px; }
.arrive { justify-self: end; text-align: right; }
.arrive em { font-style: normal; color: var(--tertiary); font-size: 12px; font-weight: 560; }
.arrive strong {
  font-size: 32px;
  font-weight: 640;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.arrive small, .arrive .plan-time { display: block; }
.arrive .badge { display: inline-flex; margin-top: 8px; }
.badge {
  justify-self: start;
  border-radius: 980px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 650;
  background: var(--fill);
  color: var(--secondary);
}
.phase-waiting .badge { background: rgba(255, 59, 48, 0.12); color: #d70015; }
.phase-delayed .badge { background: rgba(255, 149, 0, 0.16); color: var(--orange); }
.phase-enroute .badge { background: rgba(0, 122, 255, 0.12); color: #007aff; }
.phase-picked .badge { background: rgba(52, 199, 89, 0.16); color: var(--green); }
.phase-error .badge, .phase-cancelled .badge { background: rgba(255, 59, 48, 0.1); color: #d70015; }
.phase-incomplete .badge { background: rgba(142, 142, 147, 0.16); color: #6e6e73; }
.phase-incomplete { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.import-summary { display: grid; gap: 10px; color: var(--secondary); }
.import-summary strong { color: var(--label); font-variant-numeric: tabular-nums; }
.import-issues { max-height: 240px; overflow: auto; margin: 0; padding-left: 18px; }
.phase-cancelled .who > strong { color: var(--tertiary); text-decoration: line-through; }
.ops { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; grid-column: 1 / -1; }
.separate-trips, .details { grid-column: 1 / -1; }
.ops button { padding: 6px 11px; font-size: 13px; }
.details { grid-column: 1 / -1; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 14px; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--secondary); font-size: 13px; margin-bottom: 12px; }
.meta span { background: var(--fill); border-radius: 980px; padding: 4px 10px; }
.stops { display: flex; gap: 0; overflow-x: auto; padding: 4px 0 6px; }
.stop { min-width: 92px; position: relative; padding-top: 16px; }
.stop::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d1d6;
  box-shadow: -46px 0 0 #e5e5ea;
}
.stop.done::before { background: #34c759; }
.stop.now::before { background: var(--blue); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.16); }
.stop.target b { color: var(--blue); }
.stop b, .stop span { display: block; font-size: 13px; }
.stop b { font-weight: 600; letter-spacing: -0.01em; }
.stop span { color: var(--secondary); }
.empty {
  background: var(--card);
  border-radius: 18px;
  padding: 64px 24px;
  text-align: center;
  color: var(--secondary);
  box-shadow: var(--shadow);
}
.empty strong {
  display: block;
  color: var(--label);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(92vh, 900px);
  overflow: auto;
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  color: var(--label);
}
dialog[open] { animation: sheet 0.22s ease; }
dialog::backdrop { background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(6px); }
@keyframes sheet {
  from { transform: translateY(10px) scale(0.985); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.dialog-head, .dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}
.dialog-head h2 { font-size: 20px; font-weight: 680; letter-spacing: -0.02em; }
.settings-menu { display: flex; gap: 8px; padding: 0 18px 12px; }
.roster-menu { display: grid; gap: 8px; padding: 0 18px 18px; }
.roster-menu button { width: 100%; min-height: 42px; }
#settings-fields[hidden] { display: none; }
.dialog-actions { justify-content: flex-end; }
.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px 18px;
  padding: 0 18px 8px;
}
#trip-fields.form-grid { padding: 0; }
.form-grid > label, .help { display: grid; gap: 6px; min-width: 0; font-size: 13px; font-weight: 560; color: var(--secondary); }
.span-2 { grid-column: 1 / -1; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  background: var(--fill);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--label);
}
.when-pair { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr); gap: 8px; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus { background: white; }
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-content: start;
}
fieldset legend { padding: 0; }
.radio {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--fill);
  color: var(--label);
  font-weight: 560;
}
.radio:has(input:checked) { background: white; box-shadow: 0 0 0 1.5px var(--blue); color: var(--blue); }
.companions-head { display: flex; align-items: center; justify-content: space-between; }
.companion-row {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.035);
}
.companion-main { display: grid; grid-template-columns: 1.15fr 0.9fr 108px 124px auto; gap: 8px; }
.companion-trip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.companion-trip label { display: grid; gap: 4px; min-width: 0; color: var(--secondary); font-size: 12px; font-weight: 560; }
.companion-row input, .companion-row select { box-sizing: border-box; min-width: 0; }
.companion-row input, .companion-row select {
  width: 100%;
  border: 0;
  background: white;
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--label);
}
.companion-row input:focus, .companion-row select:focus { box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.22); }
.radio { cursor: pointer; }
.radio input { position: absolute; opacity: 0; inset: 0; margin: 0; }
#role-perms .radio input { pointer-events: none; }

html.invite-open .top,
html.invite-open main,
html.invite-open #gate { display: none !important; }
.invite-page {
  display: none;
  min-height: 100vh;
  box-sizing: border-box;
  padding: 28px 16px 48px;
  justify-content: center;
}
html.invite-open .invite-page { display: flex; align-items: flex-start; }
.invite-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: 28px 22px 22px;
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow);
}
.invite-card .brand-logo { height: 72px; margin: 0 auto 12px; }
.invite-card h2 { text-align: center; font-size: 28px; font-weight: 680; letter-spacing: -0.03em; }
.invite-card .eyebrow { text-align: center; margin-bottom: 18px; }
.invite-who { text-align: center; font-size: 18px; font-weight: 650; margin-bottom: 16px; }
.invite-who span { display: block; margin-top: 4px; color: var(--secondary); font-size: 14px; font-weight: 500; }
.invite-card fieldset {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}
.invite-card fieldset legend { width: 100%; margin-bottom: 4px; color: var(--secondary); font-size: 13px; font-weight: 600; }
.invite-card label { display: grid; gap: 6px; margin-bottom: 14px; color: var(--secondary); font-size: 13px; font-weight: 600; }
.invite-card input,
.invite-card textarea {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: var(--fill);
  padding: 14px 16px;
  color: var(--label);
  font-size: 17px;
}
.invite-card .radio { flex: 1; min-width: 92px; min-height: 44px; }
.invite-card .solid,
.invite-card .invite-edit { width: 100%; min-height: 48px; margin-top: 4px; font-size: 17px; }
.invite-card .help { padding: 12px 0 0; text-align: center; }
.invite-when, .invite-contact { text-align: center; line-height: 1.5; }
.invite-when { margin: 0 0 4px; color: var(--label); font-size: 17px; font-weight: 650; }
.invite-contact { margin: 0 0 14px; color: var(--secondary); font-size: 15px; font-weight: 560; }
.invite-status { margin: 0 0 12px; text-align: center; font-size: 15px; font-weight: 650; line-height: 1.5; }
.invite-status.pending { color: #b26a00; }
.invite-status.approved { color: #248a3d; }
.invite-status.rejected { color: #ff3b30; }
.invite-stay {
  margin: 0 0 16px;
  padding: 16px;
  border-radius: 18px;
  background: #f5f5f7;
  text-align: center;
}
.invite-stay span { display: block; color: var(--secondary); font-size: 13px; font-weight: 650; }
.invite-stay p { margin: 8px 0 0; font-size: 17px; font-weight: 650; }
.invite-stay strong { display: block; margin-top: 4px; font-size: 34px; font-weight: 700; letter-spacing: -0.04em; }
.invite-stay em { display: block; margin-top: 2px; color: var(--secondary); font-style: normal; font-size: 13px; font-weight: 600; }
.review-tag {
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: 999px;
}
.review-tag.pending { background: #fff4d6; color: #8a5a00; }
.review-tag.approved { background: #e5f6ea; color: #248a3d; }
.review-tag.rejected { background: #ffe8e6; color: #d70015; }
.invite-done-text { margin-top: 12px; color: var(--secondary); line-height: 1.6; text-align: center; }
#invite-dialog { width: min(440px, calc(100vw - 24px)); }
.invite-setup { display: grid; gap: 8px; padding: 0 16px 12px; }
.invite-setup label { display: grid; gap: 4px; color: var(--secondary); font-size: 13px; font-weight: 600; }
.invite-setup input {
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  padding: 10px 12px;
  color: var(--label);
  font-size: 16px;
}
.invite-setup-actions { display: flex; gap: 8px; }
.invite-setup-actions .ghost,
.invite-setup-actions .solid { flex: 1; }
.invite-poster {
  display: none;
  margin: 4px 16px 8px;
  border-radius: 18px;
  overflow: hidden;
}
.invite-poster.ready { display: block; }
.invite-poster > img { display: block; width: 100%; height: auto; }
.invite-open-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 8px; }
.invite-open-list .ghost.on { box-shadow: 0 0 0 1.5px var(--blue); color: var(--blue); }
.invite-url {
  display: block;
  width: calc(100% - 36px);
  margin: 8px 18px 0;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  padding: 12px 14px;
  color: var(--label);
}
.check { display: flex; align-items: center; gap: 8px; color: var(--label); font-weight: 500; }
.preview, .form-error, .help { padding: 8px 18px 4px; }
.preview { min-height: 1.2em; color: var(--secondary); font-size: 13px; }
.form-error { color: var(--red); font-size: 13px; }
.help { line-height: 1.5; }
.help p + p { margin-top: 8px; }
.session-chip { display: flex; align-items: center; gap: 6px; color: var(--secondary); font-size: 13px; }
.session-chip .ghost, .top-actions .ghost, .top-actions .solid { white-space: nowrap; }
.gate { display: none; min-height: calc(100vh - 110px); place-items: center; padding: 28px 16px 48px; }
body:not(.authed) .gate { display: grid; }
body:not(.authed) main, body:not(.authed) .top-actions { display: none; }
.login-card {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 28px 22px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}
.login-card h2 { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; }
.login-card label { width: 100%; display: grid; gap: 6px; margin-top: 10px; color: var(--secondary); font-size: 13px; font-weight: 560; }
.login-card input {
  border: 0;
  background: var(--fill);
  border-radius: 12px;
  padding: 11px 12px;
  color: var(--label);
}
.login-card .solid { width: 100%; margin-top: 16px; }
.role-list { display: grid; gap: 8px; padding: 0 18px 8px; }
.role-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 36px);
  margin: 0 18px 14px;
  padding: 11px;
  border: 1.5px dashed rgba(0, 113, 227, 0.45);
  border-radius: 12px;
  background: transparent;
  color: var(--blue);
  font-weight: 650;
}
.role-add:hover { background: rgba(0, 113, 227, 0.06); }
.plus-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
#role-form h3 { margin: 2px 18px 0; font-size: 17px; font-weight: 680; letter-spacing: -0.02em; }
.role-link-help { margin: 0 18px 10px; }
.role-link-box { margin: 0 18px 12px; }
.role-link-box p { margin: 0 0 8px; color: var(--text); font-size: 13px; }
.role-link-box input { width: 100%; font-size: 13px; }
.role-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill);
}
.role-row b { display: block; font-size: 14px; }
.role-row span { color: var(--secondary); font-size: 12px; }
.log-wrap { max-height: min(62vh, 560px); overflow: auto; padding: 0 18px 18px; }
.log-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.log-table th, .log-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.log-table th { color: var(--secondary); font-weight: 650; position: sticky; top: 0; background: #fff; }
#log-dialog, #roles-dialog { width: min(860px, calc(100vw - 28px)); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: rgba(29, 29, 31, 0.88);
  color: white;
  border-radius: 14px;
  padding: 12px 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

body.board main { width: min(1360px, calc(100% - 36px)); }
body.board h1 { font-size: 28px; }
body.board .guest { padding: 22px 22px; }
body.board .who > strong { font-size: 28px; }
body.board .brand-logo { height: 92px; }
body.board .star { width: 26px; height: 26px; }
body.board .star.sm { width: 16px; height: 16px; }
body.board .companion, body.board .companion strong { font-size: 16px; }
body.board .separate-who strong, body.board .separate-code b { font-size: 22px; }
body.board .separate-times b { font-size: 26px; }
body.board .companions { font-size: 16px; }
body.board .arrive strong { font-size: 44px; }
body.board .trip b { font-size: 24px; }

@media (max-width: 980px) {
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    padding: max(10px, env(safe-area-inset-top)) 14px 12px;
  }
  .brand { min-width: 0; }
  .clock-block { margin: 0; text-align: right; }
  .top-actions { grid-column: 1 / -1; flex-wrap: wrap; width: 100%; }
  main { width: min(100% - 20px, 1120px); margin-top: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .companion-main, .companion-trip { grid-template-columns: 1fr; }
  dialog { width: calc(100vw - 16px); }
  .dialog-actions { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .header-toggle { display: inline-flex; margin-left: auto; min-height: 36px; }
  .brand { width: 100%; }
  body.header-collapsed .top-actions,
  body.header-collapsed .live { display: none; }
  body.header-collapsed .eyebrow { font-size: 11px; }
  body.header-collapsed .clock-block { display: block; margin: 0; flex: none; }
  body.header-collapsed .brand { width: auto; flex: 1; min-width: 0; }
  body.header-collapsed .brand > div { min-width: 0; }
  body.header-collapsed .brand-logo { height: 36px; }
  body.header-collapsed h1 {
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.header-collapsed #clock { font-size: 15px; }
  body.header-collapsed .top {
    display: flex;
    align-items: center;
    grid-template-columns: none;
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: 6px;
  }
  .team-card-head { flex-wrap: wrap; row-gap: 4px; }
  .team-card-head strong { flex: 1 0 100%; }
  .team-card-head span,
  .team-card-head em,
  .fold-mark { white-space: nowrap; }
  .brand-logo { height: 52px; }
  .eyebrow { font-size: 11px; }
  h1 { font-size: 18px; }
  #clock { font-size: 13px; white-space: nowrap; }
  .session-chip { flex: 1 0 100%; min-width: 0; justify-content: space-between; }
  #session-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top-actions > .ghost { flex: 1 1 calc(33% - 8px); padding: 9px 8px; text-align: center; }
  #roster-btn { flex: 1 1 calc(33% - 8px); }
  .session-chip .ghost { flex: 0 0 auto; }
  #add-btn { flex: 1 0 100%; min-height: 42px; }
  .stats { width: 100%; flex-wrap: wrap; overflow: visible; }
  .toolbar { align-items: stretch; }
  #refresh-all { flex: none; min-height: 42px; }
  .guest {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 14px;
    border-radius: 16px;
  }
  .guest .who { grid-column: 1; grid-row: 1; min-width: 0; }
  .guest .arrive { grid-column: 2; grid-row: 1; align-self: start; }
  .guest .trip, .guest .ops, .separate-trips, .details { grid-column: 1 / -1; }
  .arrive strong { font-size: 28px; }
  .ops { gap: 8px; }
  .ops button, .pick { min-height: 40px; }
  .separate { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
  .separate-times { flex-wrap: wrap; gap: 8px 14px; }
  .separate-times, .separate-ops { grid-column: auto; }
  .room-no { font-size: 24px; }
  .room-companion { margin-left: 10px; }
  body.board h1 { font-size: 20px; }
  body.board .brand-logo { height: 56px; }
  body.board .who > strong { font-size: 22px; }
  body.board .arrive strong { font-size: 32px; }
  body.board .trip b { font-size: 18px; }
  .toast { width: min(92vw, 420px); text-align: center; bottom: max(16px, env(safe-area-inset-bottom)); }
}
