:root {
  color-scheme: light;
  --bg: #f9f8f6;
  --surface: #ffffff;
  --surface-soft: #f1f5f3;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --coral: #c2410c;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 0%, rgba(15, 118, 110, 0.04) 0%, transparent 65%),
              radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.03) 0%, transparent 60%),
              #f9f8f6;
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small,
.eyebrow,
.permission-strip,
.timeline-item p,
.item-meta,
.map-details span {
  color: var(--muted);
}

.header-actions,
.pane-head,
.itinerary-toolbar,
.permission-strip,
.day-head,
.timeline-item,
.map-details {
  display: flex;
  align-items: center;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.header-menu-mine {
  margin-left: 2px;
}

.header-menu {
  position: relative;
}

.header-menu-trigger {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.header-menu-trigger:hover,
.header-menu.is-open .header-menu-trigger {
  color: var(--ink);
  background: var(--surface-soft);
}

.header-menu.is-open .header-menu-trigger {
  color: var(--teal);
}

.header-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: min(320px, calc(100vw - 24px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.header-menu-panel-mine {
  width: min(360px, calc(100vw - 24px));
  max-height: min(72vh, 640px);
  overflow: auto;
}

.header-profile-block .header-menu-item-label {
  margin-bottom: 2px;
}

.header-profile-sections {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.header-profile-section {
  display: grid;
  gap: 6px;
}

.header-profile-kicker {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.header-profile-facts {
  display: grid;
  gap: 4px;
  margin: 0;
}

.header-profile-fact {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  font-size: 12px;
  line-height: 1.4;
}

.header-profile-fact dt {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.header-profile-fact dd {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}

.header-document-list,
.header-traveler-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.header-document-item,
.header-traveler-item {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.header-document-item {
  display: grid;
  gap: 2px;
}

.header-document-item strong,
.header-traveler-head strong {
  font-size: 13px;
}

.header-document-item span,
.header-traveler-item .header-menu-item-meta {
  font-size: 12px;
  color: var(--muted);
}

.header-document-item em,
.header-traveler-note {
  font-size: 11px;
  font-style: normal;
  color: var(--muted);
}

.header-traveler-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.header-traveler-tag {
  flex-shrink: 0;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.header-profile-edit {
  width: 100%;
  margin-top: 2px;
}

.header-menu-user {
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.header-menu-user strong {
  font-size: 15px;
}

.header-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.header-menu-item {
  margin: 0;
}

.header-menu-item-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.header-menu-item-button:hover {
  border-color: #b8ddd8;
  background: #f7fbfa;
}

.header-menu-item-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.header-menu-item-meta,
.header-menu-item-note {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.header-menu-item-block {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.header-menu-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.header-menu-ai-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(8, 124, 114, 0.12);
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
}

.header-session-button {
  width: 100%;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}

.header-session-button.is-primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.header-session-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.header-trip-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.header-trip-item {
  margin: 0;
}

.header-trip-button {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
}

.header-trip-button:hover {
  border-color: #b8ddd8;
  background: #f7fbfa;
}

.header-trip-button.is-current {
  border-color: #9ec5e8;
  background: #f3f9ff;
}

.header-trip-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.header-trip-status {
  flex-shrink: 0;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.header-trip-status.status-planning {
  background: rgba(8, 124, 114, 0.12);
  color: var(--teal);
}

.header-trip-status.status-completed {
  background: var(--surface-soft);
  color: var(--muted);
}

.header-platform-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.header-platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.header-platform-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.header-platform-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.header-platform-scope {
  font-size: 11px;
  color: var(--muted);
}

.header-platform-status {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal);
}

.header-platform-connect {
  flex-shrink: 0;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.header-platform-connect:hover {
  border-color: var(--teal);
  background: #f7fbfa;
}

.header-menu-section {
  display: grid;
  gap: 6px;
}

.header-menu-kicker {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.header-menu-title {
  font-size: 15px;
  line-height: 1.35;
}

.header-menu-meta,
.header-menu-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.header-auth-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.header-auth-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
}

.header-menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.header-menu-action {
  width: 100%;
  margin-top: 12px;
}

.header-menu-actions .header-menu-action {
  margin-top: 0;
}

.primary-button,
.ghost-button,
.permission-strip button {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

.primary-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal);
  font-weight: 800;
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 18px;
  height: calc(100vh - 56px);
  padding: 18px;
}

.chat-column,
.itinerary-column {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.chat-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 14px;
}

.itinerary-column {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
}

.pane-head,
.itinerary-toolbar {
  justify-content: space-between;
  gap: 16px;
}

.pane-head {
  min-height: 28px;
}

.title-date,
.day-date {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.title-date {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.day-date {
  display: block;
  margin-top: 4px;
}

.title-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.eyebrow {
  margin: 0 0 5px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.15;
}

.pane-head h1 {
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.status {
  padding: 7px 10px;
  border-radius: 8px;
  background: #fff4e8;
  color: #9a5a14;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
}

.message.user {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
}

.message.assistant {
  background: var(--surface-soft);
}

/* Standalone operation/error state: never an Agent reply, never persisted
   to chat history. Rendered for failures, takeovers and refresh notes. */
.message.operation-state {
  align-self: stretch;
  background: #fff8e6;
  border: 1px dashed #d9a441;
  color: #7a5a10;
}

.chat-retry-btn {
  margin-top: 8px;
  min-height: 32px;
  padding: 0 14px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.agent-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-progress-label {
  min-width: 0;
  flex: 1;
}

.agent-stop {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #c85a54;
  border-radius: 6px;
  background: #fff;
  color: #a33e38;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
}

.agent-stop:disabled {
  cursor: wait;
  opacity: 0.65;
}

.permission-strip {
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  font-size: 13px;
}

.permission-strip strong {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal);
  font-size: 12px;
}

.permission-strip button {
  min-height: 30px;
  margin-left: auto;
  padding: 0 10px;
}

/* Skill bar — AI mode selector shown above the chat input */
.skill-bar {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.skill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.skill-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: #f7fbfa;
}

.skill-btn.active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.skill-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.system-mode-switch {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  padding: 4px 12px;
  text-align: center;
}

.chat-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.chat-box input {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}

.chat-box input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.12);
}

.fill-only-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary, inherit);
  cursor: pointer;
  user-select: none;
}

.fill-only-toggle input {
  min-height: auto;
  width: 14px;
  height: 14px;
}

.view-panel {
  display: block;
  min-height: 0;
}

.view-panel.active {
  display: block;
}

#mapView {
  order: 1;
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.trip-content {
  display: grid;
  min-height: 0;
  overflow: hidden;
}

.trip-panel {
  display: none;
  min-height: 0;
}

.trip-panel.active {
  display: grid;
  min-height: 0;
}

.map-panel.active {
  grid-template-rows: auto minmax(0, 1fr);
}

.map-route-sequence {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(34, 67, 60, 0.12);
  background: rgba(248, 251, 249, 0.96);
  scrollbar-width: thin;
}

.map-route-sequence[hidden] {
  display: none;
}

.map-route-sequence-stop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 4px 9px 4px 5px;
  border: 1px solid rgba(34, 67, 60, 0.16);
  border-radius: 999px;
  color: #23443d;
  background: #fff;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  font-family: inherit;
}

button.map-route-sequence-stop {
  appearance: none;
  cursor: pointer;
}

button.map-route-sequence-stop:hover,
button.map-route-sequence-stop:focus-visible {
  border-color: rgba(35, 107, 91, 0.48);
  background: #f0f8f5;
  box-shadow: 0 3px 10px rgba(35, 107, 91, 0.12);
  outline: none;
}

.map-route-sequence-stop b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  background: #236b5b;
  font-size: 11px;
}

.map-route-sequence-context {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(35, 107, 91, 0.18);
  border-radius: 999px;
  color: #35665a;
  background: #eef7f3;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.map-route-sequence-context > span {
  color: #236b5b;
  font-size: 15px;
}

.map-route-sequence-context em {
  max-width: 180px;
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-context-popup {
  display: grid;
  gap: 4px;
  min-width: 180px;
  font-family: inherit;
}

.map-context-popup strong {
  color: #236b5b;
  font-size: 13px;
}

.map-context-popup span,
.map-context-popup small {
  color: #5e706a;
  font-size: 11px;
  line-height: 1.45;
}

.map-route-sequence-arrow {
  flex: 0 0 auto;
  color: #d96f55;
  font-size: 18px;
  font-weight: 800;
}

.map-route-sequence-connector {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #c85f47;
  font-family: inherit;
  cursor: default;
}

button.map-route-sequence-connector.is-card {
  cursor: pointer;
}

button.map-route-sequence-connector.is-card:hover,
button.map-route-sequence-connector.is-card:focus-visible {
  background: #fff2ed;
  outline: none;
}

.map-route-sequence-connector em {
  max-width: 80px;
  overflow: hidden;
  color: #8b4b3d;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manifest-panel.active {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
}

.manifest-schedule.day-list {
  min-height: 0;
}

.day-head-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.day-head-copy h3 {
  margin: 0;
}

.manifest-toolbar {
  display: grid;
  gap: 8px;
}

.manifest-progress {
  margin: 0;
}

.manifest-filters {
  margin: 0;
}

.manifest-booking {
  display: flex;
  justify-content: flex-end;
}

.manifest-booking-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}

.manifest-booking-cta .booking-tier {
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.3;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.manifest-booking-cta.secondary .booking-tier {
  background: var(--surface);
}

.manifest-booking-empty {
  color: var(--muted);
  font-size: 12px;
}

.detail-booking-panel {
  margin-bottom: 0;
}

.detail-booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.detail-booking-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-booking-panel .manifest-booking-cta {
  flex-shrink: 0;
}

.day-list {
  display: grid;
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 4px 4px 0;
}

.day-group {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.day-head {
  justify-content: space-between;
  gap: 16px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.day-head div {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.day-head time {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal);
  font-weight: 800;
}

.day-head h3 {
  margin-bottom: 0;
}

.day-head > strong {
  white-space: nowrap;
}

.day-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.poi-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.poi-strip span {
  padding: 5px 8px;
  border: 1px solid #cfe4dd;
  border-radius: 8px;
  background: #eef8f5;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.table-wrap {
  max-height: calc(100% - 73px);
  overflow-x: hidden;
  overflow-y: auto;
}

.itinerary-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.itinerary-table th {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

.itinerary-table td {
  padding: 12px;
  border-bottom: 1px solid #edf1ef;
  vertical-align: top;
  font-size: 14px;
}

.itinerary-table tr:last-child td {
  border-bottom: 0;
}

.itinerary-table th:nth-child(1),
.itinerary-table td:nth-child(1) {
  width: 68px;
}

.itinerary-table th:nth-child(2),
.itinerary-table td:nth-child(2) {
  width: 54px;
  text-align: center;
}

.itinerary-table th:nth-child(3),
.itinerary-table td:nth-child(3) {
  width: auto;
}

.itinerary-table th:nth-child(4),
.itinerary-table td:nth-child(4) {
  width: 76px;
}

.itinerary-table th:nth-child(5),
.itinerary-table td:nth-child(5) {
  width: 16%;
}

.itinerary-table th:nth-child(6),
.itinerary-table td:nth-child(6) {
  width: 24%;
  min-width: 150px;
  text-align: left;
}

.itinerary-table th:nth-child(7),
.itinerary-table td:nth-child(7) {
  width: 118px;
  text-align: right;
}

.booking-cell {
  vertical-align: top;
}

.itinerary-table tr.is-filter-muted {
  opacity: 0.36;
}

.itinerary-table tr.is-filter-muted:hover {
  opacity: 0.72;
}

.manifest-schedule .itinerary-table tbody tr {
  cursor: pointer;
}

.time-cell,
.duration-cell {
  font-weight: 800;
  white-space: nowrap;
}

.budget-cell {
  min-width: 0;
  font-weight: 800;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.budget-cell > span {
  display: block;
  max-width: 100%;
}

.estimate-rationale {
  display: block;
  max-width: 180px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}

.manifest-schedule.day-list {
  scroll-padding-bottom: 88px;
  padding-bottom: 88px;
}

@media (max-width: 1400px) {
  .planner-layout {
    grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .itinerary-table th,
  .itinerary-table td {
    padding-right: 9px;
    padding-left: 9px;
  }

  .itinerary-table th:nth-child(1),
  .itinerary-table td:nth-child(1) {
    width: 62px;
  }

  .itinerary-table th:nth-child(2),
  .itinerary-table td:nth-child(2) {
    width: 50px;
  }

  .itinerary-table th:nth-child(4),
  .itinerary-table td:nth-child(4) {
    width: 68px;
  }

  .itinerary-table th:nth-child(5),
  .itinerary-table td:nth-child(5) {
    width: 14%;
  }

  .itinerary-table th:nth-child(6),
  .itinerary-table td:nth-child(6) {
    width: 25%;
  }

  .itinerary-table th:nth-child(7),
  .itinerary-table td:nth-child(7) {
    width: 106px;
  }

  .manifest-booking-cta {
    padding-right: 8px;
    padding-left: 8px;
  }
}

.estimate-rationale.is-missing {
  color: #a06a23;
}

.planning-audit-summary {
  display: inline-block;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: #eef8f5;
  color: #266b5e;
  font-size: 12px;
  font-weight: 700;
}

.planning-audit-summary.is-incomplete {
  background: #fff5e7;
  color: #8a5a18;
}



.route-cell,
.duration-cell,
.plan-cell span {
  color: var(--muted);
}

.plan-cell strong,
.plan-cell span {
  display: block;
}

.plan-cell strong {
  margin-bottom: 5px;
  line-height: 1.35;
}

.plan-cell span,
.route-cell {
  font-size: 13px;
  line-height: 1.45;
}

.type-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #edf2ff;
  color: #3451a3;
}

.type-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.type-icon.rail {
  background: #edf2ff;
  color: #3451a3;
}

.type-icon.local {
  background: #eaf5f1;
  color: var(--teal);
}

.type-icon.hotel {
  background: #fff2e8;
  color: #9a5a14;
}

.type-icon.meal {
  background: #fff4de;
  color: #8a5600;
  box-shadow: inset 0 0 0 1px #f3d59b;
}

.type-icon.poi {
  background: var(--teal);
  color: #fff;
}

.table-photo-icon {
  display: inline-block;
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 8px;
  background-color: var(--surface-soft);
  background-image: var(--fallback-image);
  background-position: center;
  background-size: cover;
  box-shadow: 0 5px 14px rgba(23, 32, 28, 0.16);
}

.table-photo-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poi-row {
  background: #fbfefd;
}

.poi-row td {
  border-bottom-color: #dceae5;
}

.meal-row {
  background: #fffaf1;
}

.meal-row td {
  border-bottom-color: #f1dfbd;
}

.meal-row .time-cell,
.meal-name,
.meal-row .budget-cell {
  color: #8a5600;
}

.poi-name {
  color: var(--teal);
  font-size: 15px;
}

.itinerary-table tr.is-adjusting,
.itinerary-table tr.is-detail-open,
.itinerary-table tr.is-map-linked {
  background: #fff8ea;
}

.itinerary-table tr.is-adjusting td,
.itinerary-table tr.is-detail-open td,
.itinerary-table tr.is-map-linked td {
  background: #fff2cf;
}

.itinerary-table tr.is-map-linked td:first-child {
  box-shadow: inset 4px 0 0 var(--coral);
}

.detail-drawer {
  display: none;
  position: absolute;
  inset: 18px;
  z-index: 20;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  box-shadow: 0 24px 80px rgba(23, 32, 28, 0.24);
}

.detail-drawer.open {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
}

/* A real card has summary, canonical facts, evidence and scoped chat after
   its header. Keep those sections in one scroll region; implicit grid rows
   previously pushed the lower sections under each other or below the panel. */
.detail-drawer.detail-card-open {
  grid-template-rows: auto minmax(0, 1fr);
}

.detail-card-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

/* P5.9.7: 卡片独立聊天面板 —— 打开时抽屉变为 头 / 卡片 / 聊天 三行。 */
.detail-drawer.detail-card-open.card-chat-active {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.card-chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(46vh, 420px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* P5.10.3B C: 单次点击「问 AI」后面板立即进入视口并带展开动画。
   hidden → visible 触发 display 切换，动画从头播放（面板每次随抽屉重建）。 */
.card-chat-panel:not([hidden]) {
  animation: card-chat-enter 180ms ease-out;
}

@keyframes card-chat-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-chat-panel[hidden] {
  display: none;
}

.card-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.card-chat-head strong {
  font-size: 13px;
}

.card-chat-scope {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}

.card-chat-collapse {
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.card-chat-clear {
  flex: none;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.card-chat-clear:hover {
  color: #b42318;
  background: #fff7f7;
}

.card-chat-clear:disabled {
  cursor: wait;
  opacity: 0.55;
}

.card-chat-feed {
  min-height: 140px;
  max-height: min(30vh, 260px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-chat-feed .message {
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.card-chat-feed .message.user {
  align-self: flex-end;
  background: var(--teal);
  color: #fff;
}

.card-chat-feed .message.assistant,
.card-chat-feed .message.card-chat-welcome {
  align-self: flex-start;
  background: #f0f4f2;
  color: var(--ink);
}

.card-chat-feed .message.operation-state {
  align-self: stretch;
  background: #fff8e8;
  color: #8a6a1a;
  font-size: 12px;
}

.card-chat-feed .message.operation-state.agent-failure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-chat-feed .card-chat-retry,
.card-chat-feed .card-handoff-go,
.card-chat-feed .card-handoff-dismiss,
.card-chat-feed .card-chat-proposal button {
  border: 1px solid #c9a227;
  border-radius: 999px;
  padding: 4px 12px;
  background: #fff;
  color: #8a6a1a;
  font-size: 12px;
  cursor: pointer;
}

.card-chat-feed .card-chat-retry:hover,
.card-chat-feed .card-handoff-go:hover,
.card-chat-feed .card-handoff-dismiss:hover,
.card-chat-feed .card-chat-proposal button:hover {
  background: #fdf3d7;
}

.card-chat-feed .card-chat-proposal {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-chat-feed .card-chat-proposal .card-chat-proposal-hint {
  color: var(--muted, #777);
  font-size: 12px;
  margin: 0;
}

.card-chat-feed .card-handoff {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.card-chat-box {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.card-chat-box input {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

.card-chat-box input:disabled {
  background: var(--surface);
}

.card-chat-box button {
  min-width: 64px;
  min-height: 44px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.card-chat-box button[disabled] {
  opacity: 0.6;
  cursor: default;
}

.detail-card-scroll > .detail-main {
  min-height: min(340px, 46vh);
  overflow: visible;
}

.detail-drawer.detail-meal {
  border-color: #e6c88c;
}

.detail-drawer.detail-meal .detail-head {
  background: #fff8ea;
}

.detail-drawer.detail-meal .detail-summary-unified > .detail-summary-col,
.detail-drawer.detail-meal .detail-facts span {
  border-color: #f0d8a8;
  background: #fffaf1;
}

.detail-drawer.detail-meal-signature .detail-main,
.detail-drawer.detail-poi .detail-main,
.detail-drawer.detail-terminal .detail-main {
  grid-template-columns: minmax(220px, 0.46fr) minmax(0, 0.54fr);
}

.detail-drawer.detail-meal-quick .detail-main,
.detail-drawer.detail-meal-included .detail-main,
.detail-drawer.detail-hotel .detail-main {
  grid-template-columns: minmax(180px, 0.4fr) minmax(0, 0.6fr);
}

.detail-drawer.detail-longhaul .detail-main {
  grid-template-columns: minmax(160px, 0.34fr) minmax(0, 0.66fr);
}

.detail-drawer.open .detail-poi-hero,
.detail-drawer.open .detail-hero,
.detail-drawer.open .travel-detail-hero {
  position: relative;
  width: 100%;
  min-height: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  align-self: stretch;
  overflow: hidden;
  border-radius: 8px;
}

.detail-drawer.open .detail-poi-hero img,
.detail-drawer.open .detail-hero img,
.detail-drawer.open .travel-detail-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.meal-detail-quick,
.meal-detail-included,
.meal-detail-signature {
  gap: 6px;
}

.meal-dishes-panel h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.meal-dish-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.meal-dish-item strong {
  display: block;
  font-size: 13px;
  color: var(--ink);
}

.meal-dish-item p {
  margin: 4px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.meal-dish-tip {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--teal-dark);
  font-weight: 700;
}

.meal-tips-panel {
  padding: 0;
}

.meal-tips-list {
  margin: 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.meal-tips-list li + li {
  margin-top: 4px;
}

.meal-signature-links {
  flex-wrap: nowrap;
}

.meal-guide-compact .poi-story-copy p {
  margin-bottom: 0;
}

.meal-quick-body {
  display: grid;
  gap: 8px;
}

.meal-quick-picks,
.meal-quick-tips {
  margin: 0;
  padding-left: 1rem;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
}

.meal-quick-picks li + li,
.meal-quick-tips li + li {
  margin-top: 4px;
}

.meal-quick-tips {
  color: var(--muted);
  font-size: 12px;
}

.meal-quick-panel .poi-section-head {
  margin-bottom: 8px;
}

.meal-story-copy .meal-quick-tip {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.meal-order-panel h4 {
  margin: 0 0 8px;
  font-size: 13px;
}

.meal-order-panel p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.meal-included-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.meal-included-fact {
  display: grid;
  gap: 2px;
}

.meal-included-fact dt {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.meal-included-fact dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
}

.detail-drawer.detail-longhaul .detail-main {
  gap: 8px;
}

.travel-detail-column {
  display: grid;
  gap: 8px;
  align-content: start;
  min-width: 0;
}

.travel-ai-banner {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid #c5dff5;
  border-radius: 8px;
  background: linear-gradient(135deg, #f3f9ff 0%, #f8fcfa 100%);
}

.travel-ai-badge {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #087c72;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.travel-ai-banner p {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: #3a4a44;
}

.detail-drawer.detail-flight.detail-longhaul .detail-main {
  display: flex;
  flex-direction: column;
  grid-template-columns: minmax(0, 1fr);
  width: 100%;
  min-height: 0;
  overflow: hidden;
  align-content: stretch;
}

.detail-drawer.detail-flight .travel-detail-column,
.detail-drawer.detail-flight .travel-detail-column-flight {
  flex: 1;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
}

.flight-explore-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
}

.detail-flight .detail-summary-unified:empty {
  display: none;
}

.flight-explore-requirements {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.flight-explore-requirements-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.flight-explore-requirements-input {
  width: 100%;
  min-height: 0;
  height: auto;
  max-height: 104px;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.flight-explore-requirements-input:focus {
  outline: 2px solid rgba(0, 105, 92, 0.22);
  border-color: rgba(0, 105, 92, 0.35);
}

.flight-explore-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.flight-explore-toolbar h4 {
  margin: 0;
  font-size: 15px;
}

.flight-explore-start {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
}

.flight-explore-table-wrap {
  flex: 1;
  min-height: 140px;
  max-height: min(52vh, 420px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.flight-candidate-row.is-selected td {
  background: #f4faf4;
}

.flight-explore-status-msg {
  color: #5a554f;
  font-size: 13px;
}

.flight-explore-flight {
  font-weight: 600;
  white-space: nowrap;
}

.flight-explore-note-col {
  font-size: 12px;
  color: #6b6560;
  line-height: 1.35;
}

.flight-rank-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e8f3e8;
  color: #2d6a2d;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.flight-explore-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.flight-explore-status-line:empty {
  display: none;
}

.flight-explore-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.flight-explore-table th,
.flight-explore-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.flight-explore-table thead th {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface-soft);
}

.flight-explore-table tbody tr:last-child td,
.flight-explore-table tbody tr:last-child th {
  border-bottom: 0;
}

.flight-explore-platform {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 120px;
  font-weight: 700;
}

.flight-explore-platform-link {
  color: var(--teal-dark);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 105, 92, 0.28);
}

.flight-explore-platform-link:hover {
  color: var(--teal);
  border-bottom-color: currentColor;
}

.flight-explore-status {
  white-space: nowrap;
  color: var(--teal-dark);
  font-weight: 700;
}

.flight-explore-row-pending_login .flight-explore-status {
  color: #9a6700;
}

.flight-explore-row-searching .flight-explore-status {
  color: var(--teal);
}

.flight-explore-row-failed .flight-explore-status {
  color: #b54a3a;
}

.flight-explore-summary,
.flight-explore-time,
.flight-explore-price {
  color: var(--ink);
}

.flight-explore-action {
  width: 88px;
  text-align: right;
}

.flight-explore-action-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

.flight-explore-empty td {
  padding: 18px 12px;
  color: var(--muted);
  text-align: center;
}

.flight-explore-status-line {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-dark);
}

.flight-explore-login-banner {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid #dce9e7;
  border-radius: 12px;
  background: #f7fbfa;
}

.flight-explore-login-banner-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--teal-dark);
}

.flight-explore-login-banner-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.flight-explore-login-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.flight-explore-login-banner-actions .primary-button,
.flight-explore-login-banner-actions .ghost-button {
  min-height: 36px;
  font-size: 13px;
}

.flight-explore-login-platforms-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  text-decoration: none;
}

.detail-drawer.detail-flight .detail-actions {
  flex-shrink: 0;
  align-items: center;
}

.detail-drawer.detail-flight .detail-actions .primary-button,
.detail-drawer.detail-flight .detail-actions .secondary-button {
  min-height: 40px;
  height: 40px;
  max-height: 40px;
  padding-top: 0;
  padding-bottom: 0;
}

.flight-explore-selected {
  padding: 14px;
  border: 1px solid #b8ddd8;
  border-radius: 12px;
  background: #f7fbfa;
}

.flight-explore-selected-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.flight-explore-selected-head span {
  font-size: 12px;
  color: var(--muted);
}

.flight-explore-manage {
  display: grid;
  gap: 10px;
}

.flight-explore-manage-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}

.flight-explore-manage-row span {
  color: var(--muted);
  font-weight: 700;
}

.flight-explore-manage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.flight-explore-disconnect {
  color: #b54a3a;
  border-color: #efc8c0;
}

.flight-ai-results {
  margin-top: 16px;
}

.flight-ai-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.flight-ai-option {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border-soft, #e8e4df);
  border-radius: 12px;
  background: #fff;
}

.flight-ai-option.is-selected {
  border-color: #c8dcc8;
  background: #f7fbf7;
}

.flight-ai-option-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.flight-ai-option-label {
  font-size: 15px;
}

.flight-ai-option-badge {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f3e8;
  color: #2d6a2d;
  font-size: 11px;
  font-weight: 600;
}

.flight-ai-option-time {
  font-size: 14px;
  font-weight: 600;
  color: #1f1c1a;
}

.flight-ai-option-reason {
  font-size: 12px;
  color: #6b6560;
}

.flight-ai-option-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
  color: #4a4541;
  white-space: nowrap;
}

.flight-ai-option-meta strong {
  font-size: 15px;
  color: #1f1c1a;
}

.flight-ai-select-button {
  min-width: 72px;
}

.travel-options-panel {
  padding-top: 0;
  min-width: 0;
  overflow-x: auto;
}

.travel-options-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(100%, 580px);
}

.travel-options-head,
.travel-option-row {
  display: grid;
  grid-template-columns:
    minmax(72px, 0.9fr)
    minmax(92px, 1fr)
    minmax(44px, 0.48fr)
    minmax(40px, 0.44fr)
    minmax(88px, 0.85fr);
  gap: 8px 8px;
  align-items: center;
}

.travel-options-head {
  padding: 0 12px 2px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.travel-option-row {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
}

.travel-option-row.is-selected {
  border-color: #9ec5e8;
  background: #f3f9ff;
  box-shadow: inset 0 0 0 1px #c5dff5;
}

.detail-drawer.detail-rail .travel-option-row.is-selected {
  border-color: #b8ddd8;
  background: #eef8f5;
  box-shadow: inset 0 0 0 1px #c5e8e0;
}

.travel-option-row.is-booked {
  border-color: #9ec5e8;
  background: #f3f9ff;
  box-shadow: inset 0 0 0 1px #c5dff5;
}

.travel-options-booked .travel-option-row:not(.is-booked) {
  opacity: 0.72;
}

.travel-booking-actions-slot {
  margin-top: 10px;
}

.travel-booking-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.travel-booking-actions-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.travel-booking-selection {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.travel-booking-actions-cta {
  flex-shrink: 0;
}

.travel-option-status {
  display: inline-flex;
  margin-left: 6px;
  vertical-align: middle;
}

.travel-option-label-cell {
  min-width: 0;
}

.travel-option-label {
  font-size: 13px;
  line-height: 1.3;
}

.travel-option-note {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.travel-option-time-range {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}

.travel-option-duration,
.travel-option-transfer {
  font-size: 12px;
  line-height: 1.35;
}

.travel-option-transfer {
  color: var(--muted);
  font-weight: 700;
}

.travel-option-best {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.travel-option-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
}

.travel-option-vendor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.travel-vendor-icon {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  object-fit: contain;
}

.travel-save-note {
  font-size: 10px;
  font-style: normal;
  color: var(--teal-dark);
  line-height: 1.2;
}

.hotel-ai-line {
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #f3f9ff;
  color: #3a4a44;
  font-size: 11px;
  line-height: 1.35;
}

.poi-detail-bullets {
  margin: 0;
  padding-left: 1rem;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}

.poi-detail-bullets li + li {
  margin-top: 3px;
}

.poi-detail-tips {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.poi-ticket-inline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  align-items: stretch;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}

.poi-ticket-inline > span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  box-sizing: border-box;
}

.poi-ticket-inline strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.poi-ticket-link {
  grid-column: 1 / -1;
  justify-self: end;
  margin-left: 0;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-dark);
  text-decoration: none;
  white-space: nowrap;
}

.meal-signature-lead {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--ink);
}

.detail-drawer.open .travel-option-note,
.detail-drawer.open .travel-save-note {
  display: none;
}

.detail-drawer.open .travel-options-table {
  gap: 4px;
}

.detail-drawer.open .travel-option-row {
  padding: 6px 8px;
}

.detail-drawer.open .travel-option-label {
  font-size: 11px;
}

.detail-drawer.open .travel-ai-banner {
  margin-bottom: 6px;
  padding: 6px 8px;
}

.detail-drawer.open .travel-ai-banner p {
  font-size: 10px;
  line-height: 1.3;
}

.hotel-detail-column {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
}

.detail-drawer.detail-hotel .hotel-detail-column-wide {
  grid-column: 1 / -1;
}

.detail-drawer.detail-hotel .detail-poi-hero-compact {
  min-height: 220px;
  max-height: 360px;
}

.hotel-ai-banner {
  margin-bottom: 0;
  padding: 8px 10px;
  border-color: #d9c8ef;
  background: linear-gradient(135deg, #f9f5ff 0%, #f8fcfa 100%);
}

.hotel-ai-banner p {
  font-size: 11px;
  line-height: 1.4;
}

.hotel-rec-card {
  padding: 10px 12px;
  border: 1px solid #ddd0ef;
  border-radius: 12px;
  background: linear-gradient(180deg, #fcfaff 0%, var(--surface) 100%);
}

.hotel-rec-card-overnight {
  border-color: var(--line);
  background: var(--surface);
}

.hotel-core-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 0;
  align-items: stretch;
}

.hotel-fact-block {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  height: 100%;
  box-sizing: border-box;
}

.hotel-fact-block dt {
  margin: 0 0 2px;
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hotel-fact-block dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.hotel-fact-block dd strong {
  display: block;
  margin-bottom: 1px;
}

.hotel-fact-block dd span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.hotel-fact-span {
  grid-column: 1 / -1;
}

.hotel-map-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-dark);
  text-decoration: none;
}

.hotel-map-link:hover {
  color: var(--teal);
  text-decoration: underline;
}

.hotel-extras-panel {
  margin-top: 6px;
}

.hotel-section-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hotel-extra-list {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.hotel-extra-list li {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fcfbfe;
}

.hotel-extra-list span {
  display: block;
  margin-bottom: 1px;
  font-size: 10px;
  font-weight: 800;
  color: var(--teal-dark);
  letter-spacing: 0.04em;
}

.hotel-extra-list p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.hotel-tips-list {
  margin: 0;
  padding-left: 16px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
}

.hotel-tips-list li + li {
  margin-top: 4px;
}

.hotel-rec-foot {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.meal-detail-column {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.meal-options-panel {
  padding-top: 0;
  min-width: 0;
  overflow-x: auto;
}

.meal-options-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(100%, 560px);
}

.meal-options-head,
.meal-option-row {
  display: grid;
  grid-template-columns:
    minmax(64px, 0.78fr)
    minmax(92px, 1.2fr)
    minmax(48px, 0.52fr)
    minmax(56px, 0.58fr)
    minmax(44px, 0.42fr)
    52px;
  gap: 8px 8px;
  align-items: center;
}

.meal-options-head {
  padding: 0 12px 2px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.meal-option-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.meal-option-row.is-selected {
  border-color: #e6c88c;
  background: #fffaf1;
  box-shadow: inset 0 0 0 1px #f0d8a8;
}

.meal-option-name {
  font-size: 14px;
  line-height: 1.3;
}

.meal-option-location {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

.meal-option-price,
.meal-option-time {
  font-size: 12px;
  font-weight: 700;
}

.meal-option-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meal-option-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.meal-review-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  object-fit: contain;
}

.meal-option-link:hover {
  border-color: #b8c5bf;
  background: #f7faf8;
}

.meal-option-links-empty {
  color: var(--muted);
  font-size: 12px;
}

.meal-option-action {
  display: flex;
  justify-content: stretch;
  min-width: 0;
}

.meal-option-confirm {
  width: 100%;
  min-width: 0;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  box-sizing: border-box;
}

.meal-option-confirm.is-confirmed {
  border-color: #b8ddd8;
  background: #e8f5f3;
  color: var(--teal-dark);
}

.meal-option-row .meal-option-confirm {
  cursor: pointer;
}

.meal-detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meal-included-blurb p {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
}

.meal-slot-note p,
.meal-route-note p {
  margin: 0;
}

.meal-reservation-facts {
  padding: 0;
  margin-bottom: 10px;
}

.meal-tier-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  vertical-align: middle;
}

.meal-tier-signature {
  color: #8a5a12;
  background: #fff1d6;
  border: 1px solid #f0d8a8;
}

.meal-tier-quick {
  color: #4a5651;
  background: #eef3f1;
  border: 1px solid var(--line);
}

.meal-tier-included {
  color: #075f59;
  background: #e8f5f3;
  border: 1px solid #b8ddd8;
}

.detail-empty {
  padding: 22px;
}

.detail-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.detail-head-kicker,
.detail-empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-head-main {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.detail-head-main > span,
.detail-head-kicker {
  display: block;
}

.detail-place-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 4px 0 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
}

.detail-place-meta-transit {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.detail-place-text {
  color: var(--ink);
}

.detail-place-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.detail-transit-route {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-transit-point {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
}

.detail-transit-arrow {
  color: var(--muted);
  font-weight: 700;
}

.detail-transit-vehicle {
  color: var(--muted);
  font-size: 12px;
}

.detail-map-icon-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--teal-dark);
  background: #eef6f3;
  flex-shrink: 0;
}

.detail-map-icon-link svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.detail-map-icon-link:hover {
  color: var(--teal);
  background: #e2f0eb;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 2px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  margin-top: 5px;
}

.local-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.local-detail-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.local-detail-list strong {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.detail-title-row h3 {
  margin: 0;
  padding: 0 1px;
  font-size: 18px;
  line-height: 1.25;
  min-width: 0;
  overflow-wrap: break-word;
}

.detail-nav {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: #4a5651;
  cursor: pointer;
}

.detail-nav svg {
  width: 16px;
  height: 16px;
}

.detail-nav:hover:not(:disabled) {
  color: var(--ink);
  border-color: #b8c5bf;
  background: #e4ebe8;
}

.detail-nav:disabled {
  opacity: 0.38;
  cursor: default;
  background: var(--surface);
}

.detail-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.detail-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 20px;
  cursor: pointer;
  position: relative;
  z-index: 40;
}

.detail-summary,
.detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px 12px;
  align-items: stretch;
}

.detail-unified-facts {
  margin: 0 0 8px;
}
.detail-unified-facts .detail-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  padding: 0;
  border: 1px solid var(--line, rgba(0,0,0,0.08));
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface, #fff);
}
.detail-unified-facts .detail-fact-row {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
}
.detail-unified-facts .detail-fact-row:nth-child(odd) {
  border-right: 1px solid var(--line, rgba(0,0,0,0.06));
}
.detail-unified-facts .detail-fact-row:last-child,
.detail-unified-facts .detail-fact-row:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}
.detail-unified-facts dt {
  font-size: 11px;
  color: var(--muted, #6f6b63);
  margin-bottom: 3px;
  font-weight: 500;
}
.detail-unified-facts dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink, #23201b);
  line-height: 1.3;
}
.detail-unified-facts .fact-link dd a {
  color: var(--teal, #2563eb);
  text-decoration: none;
  font-weight: 600;
}
.detail-unified-facts .fact-link dd a:hover {
  text-decoration: underline;
}

.detail-summary-unified {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.detail-summary-unified > .detail-summary-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
  height: 100%;
}

.detail-summary-unified .detail-summary-col span {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.detail-summary-col-compact .detail-summary-value-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.detail-summary-col-compact .detail-summary-sub {
  justify-self: end;
  text-align: right;
  white-space: normal;
  min-width: 0;
}

.detail-summary-col-compact .detail-summary-price-row {
  min-width: 0;
}

.detail-summary-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.2;
  min-height: 12px;
  color: var(--muted);
}

.detail-summary-unified .detail-summary-main {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
  min-width: 0;
}

.detail-summary-unified .detail-summary-sub {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
}

.detail-summary-unified .detail-summary-main strong {
  display: inline;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
}

.detail-summary-price-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
}

.detail-summary-book,
.detail-summary-map,
.hotel-map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--teal-dark);
  text-decoration: none;
  white-space: nowrap;
}

.detail-summary-book:hover,
.detail-summary-map:hover,
.hotel-map-link:hover {
  color: var(--teal);
}

.detail-summary-book .travel-vendor-icon,
.detail-summary-book .site-icon {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
}

.detail-main {
  display: grid;
  grid-template-columns: minmax(200px, 0.42fr) minmax(0, 0.58fr);
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding: 0 12px 8px;
  align-items: stretch;
  align-content: stretch;
}

.detail-drawer.detail-flight.detail-longhaul .detail-main {
  display: flex;
  flex-direction: column;
  grid-template-columns: minmax(0, 1fr);
}

.detail-drawer.detail-local .detail-main {
  grid-template-columns: minmax(160px, 0.34fr) minmax(0, 0.66fr);
}

.local-options-table .travel-options-head,
.local-options-table .local-option-row {
  grid-template-columns:
    minmax(72px, 0.82fr)
    minmax(120px, 1.35fr)
    minmax(64px, 0.72fr)
    minmax(56px, 0.62fr)
    minmax(72px, 0.78fr);
  min-width: min(100%, 680px);
}

.local-option-route-vendor {
  font-size: 11px;
  line-height: 1.35;
  color: var(--ink);
  min-width: 0;
}

.local-option-route {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}

.local-option-route-text {
  line-height: 1.35;
}

.local-option-pass-hint {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: #edf6f0;
  color: #2a6b4f;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
}

.local-option-vendor .travel-option-vendor {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.local-option-vendor .travel-vendor-name {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}

.local-option-duration,
.local-option-price,
.local-option-effort {
  font-size: 12px;
  line-height: 1.35;
}

.local-option-price {
  font-size: 13px;
  color: var(--ink);
}

.local-option-effort {
  font-weight: 700;
  color: var(--ink);
  font-size: 11px;
  line-height: 1.3;
  white-space: normal;
}

.detail-drawer.detail-local .travel-option-row.is-selected {
  border-color: #c8ddd4;
  background: #eef6f2;
  box-shadow: inset 0 0 0 1px #c5e8dc;
}

.detail-summary:not(.detail-summary-unified) > span,
.detail-facts > span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  height: 100%;
  box-sizing: border-box;
}

.detail-summary:not(.detail-summary-unified) > span strong,
.detail-facts > span strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
}

.detail-gallery {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  grid-template-rows: 190px 190px;
  gap: 8px;
  align-self: start;
}

.detail-gallery img:first-child {
  grid-row: span 2;
}

.detail-gallery img,
.detail-hero img,
.detail-poi-hero img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.detail-poi-hero {
  position: relative;
  width: 100%;
  min-height: 100%;
  margin: 0;
  align-self: stretch;
  overflow: hidden;
  border-radius: 8px;
}

.detail-hero-attribution {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  margin: 0;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.poi-detail-column,
.hotel-detail-column,
.travel-detail-column,
.meal-detail-column {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 0;
  overflow: hidden;
  align-self: stretch;
}

.detail-hero {
  width: 100%;
  height: 100%;
  min-height: 100%;
  align-self: stretch;
}

.detail-section {
  display: grid;
  gap: 6px;
  align-self: start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-section h4 {
  margin: 0;
  font-size: 13px;
}

.detail-section p,
.detail-section li,
.detail-option span,
.detail-option p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.detail-section ul {
  margin: 0;
  padding-left: 18px;
}

.detail-section a,
.detail-links a {
  color: var(--teal);
  font-weight: 800;
}

.detail-section a.primary-button,
.detail-section a.primary-button:visited {
  color: #fff;
}

.detail-drawer.detail-calendar-sync .detail-main,
.detail-drawer.detail-share .detail-main {
  display: block;
  overflow-y: auto;
  padding: 16px 20px 24px;
}

.detail-calendar-sync .detail-section,
.detail-share .detail-section {
  max-width: 760px;
  margin-inline: auto;
}

.calendar-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 760px;
  margin: 0 auto 14px;
}

.calendar-mode-tab {
  display: grid;
  gap: 3px;
  min-height: 62px;
  padding: 10px 14px;
  text-align: left;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #fff;
  color: #475569;
  cursor: pointer;
}

.calendar-mode-tab strong {
  color: #0f172a;
  font-size: 14px;
}

.calendar-mode-tab span {
  color: #64748b;
  font-size: 11px;
}

.calendar-mode-tab.active {
  border-color: var(--teal);
  background: #ecfdf9;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--teal) 20%, transparent);
}

.calendar-primary-actions,
.share-link-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.share-link-actions {
  grid-template-columns: minmax(160px, 1fr) auto auto;
}

.calendar-primary-actions > *,
.calendar-management-actions > *,
.share-management-actions > * {
  min-height: 40px;
  padding: 9px 12px;
  font-size: 13px;
}

.calendar-management-actions,
.share-management-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.calendar-management-actions .revoke-calendar-sub-btn,
.share-management-actions .revoke-share-link-btn {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fff;
}

/* P5.10.3D C2: rotation moved into advanced options, so the management
   actions row has exactly one child — the stop-sync button — which must
   span the full width (no half-width orphan). */
.calendar-management-actions > *:only-child {
  grid-column: 1 / -1;
}

/* P5.10.3D C2: locally rendered subscription QR (token stays on-device). */
.calendar-sub-qr {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
  box-sizing: content-box;
}

.calendar-sub-qr canvas {
  display: block;
  width: 132px;
  height: 132px;
  image-rendering: pixelated;
}

.calendar-sub-qr:empty::before {
  content: "…";
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  font-size: 18px;
}

.calendar-action-status {
  min-height: 18px;
  margin-top: 8px;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.calendar-plain-note {
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 720px) {
  .calendar-primary-actions,
  .share-link-actions {
    grid-template-columns: 1fr;
  }

  .share-link-actions input {
    width: 100%;
    box-sizing: border-box;
  }
}

.detail-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.detail-option strong,
.detail-option span {
  display: block;
}

.detail-option p {
  margin: 5px 0 0;
}

.detail-option em {
  color: var(--ink);
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-links a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.ticket-panel {
  border-color: #b7dbd4;
}

.ticket-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.ticket-row span {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  height: 100%;
  box-sizing: border-box;
}

.ticket-row strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
}

.local-guide-links a {
  flex: 1 1 150px;
  text-align: center;
}

.meal-guide {
  border-color: #f0d8a8;
  background: #fffaf1;
}

.meal-guide h4 {
  color: #8a5600;
}

.poi-guide {
  border-color: #b7dbd4;
  background: #f2fbf8;
}

.poi-story-panel {
  min-height: 0;
  overflow: visible;
}

.poi-story-copy {
  display: grid;
  gap: 6px;
}

.poi-story-copy p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.poi-story-copy strong {
  color: var(--ink);
}

.poi-guide-list {
  margin: 0;
  padding-left: 18px;
}

.poi-guide-list li + li {
  margin-top: 6px;
}

.poi-ticket-panel p {
  margin: 0;
}

.poi-ticket-panel a {
  display: inline-block;
  margin-top: 4px;
}

.poi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.poi-section-head h4 {
  flex: 0 0 auto;
}

.poi-section-head .local-guide-links {
  justify-content: flex-end;
  overflow: visible;
}

.destination-link {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none !important;
  background: transparent !important;
  box-shadow: none;
}

.link-icon {
  display: block;
  width: 20px;
  height: 20px;
}

.site-icon {
  border-radius: 5px;
}

.local-guide-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 0;
}

.official-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #f2fbf8;
  color: var(--teal);
}

.official-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chinese-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #fff4e8;
  color: #9a5a14;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.voice-guide-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.voice-guide-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.voice-guide-button span {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  transform: translateY(-50%);
  display: none;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(23, 32, 28, 0.18);
}

.voice-guide-button:hover span,
.voice-guide-button:focus-visible span {
  display: block;
}

.voice-guide-button.is-playing {
  background: var(--ink);
  border-color: var(--ink);
}

/* P5.9.7: 详情头部语音入口 —— 始终可见、带文字标签、触控 ≥44px。 */
.detail-head-voice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  cursor: pointer;
}

.detail-head-voice span {
  position: static;
  top: auto;
  right: auto;
  transform: none;
  display: inline;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: none;
}

.detail-head-voice:hover span,
.detail-head-voice:focus-visible span {
  display: inline;
}

.detail-head-voice[disabled] {
  opacity: 0.62;
  cursor: default;
}

.detail-head-voice.is-playing {
  background: var(--ink);
  border-color: var(--ink);
}

.detail-head-voice-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.live-tour-guide-button {
  background: #fff;
  color: var(--teal);
}

.live-tour-guide-button.is-live,
.live-tour-guide-button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.live-tour-panel {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 80;
  width: min(420px, calc(100vw - 24px));
  transform: translateX(-50%);
  padding: 14px 16px 16px;
  border: 1px solid #b7dbd4;
  border-radius: 16px;
  background: #f8fcfb;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.live-tour-panel.is-fullscreen {
  display: flex;
  flex-direction: column;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  transform: none;
  z-index: 1500;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.live-tour-fullscreen {
  overflow: hidden;
}

.live-tour-panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}

.live-tour-panel.is-fullscreen .live-tour-panel-head {
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "title expand close"
    "status expand close";
  align-items: start;
}

.live-tour-panel-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-tour-panel.is-fullscreen .live-tour-panel-head strong {
  grid-area: title;
  font-size: 17px;
  white-space: normal;
}

.live-tour-panel-head [data-live-status] {
  font-size: 12px;
  color: var(--muted);
}

.live-tour-panel.is-buffering [data-live-status] {
  opacity: 0.72;
}

.live-tour-panel.is-fullscreen .live-tour-panel-head [data-live-status] {
  grid-area: status;
  font-size: 13px;
}

.live-tour-expand,
.live-tour-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.live-tour-expand svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.live-tour-panel.is-fullscreen .live-tour-expand,
.live-tour-panel.is-fullscreen .live-tour-close {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.06);
}

.live-tour-panel.is-fullscreen .live-tour-expand {
  grid-area: expand;
}

.live-tour-panel.is-fullscreen .live-tour-close {
  grid-area: close;
  background: var(--ink);
  color: #fff;
  font-size: 28px;
}

.live-tour-panel.is-fullscreen .live-tour-expand svg {
  width: 22px;
  height: 22px;
}

.live-tour-preview {
  display: block;
  width: 100%;
  max-height: 180px;
  margin: 10px 0 0;
  border-radius: 10px;
  object-fit: cover;
  background: #0f172a;
}

.live-tour-panel.is-fullscreen .live-tour-preview:not([hidden]) {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: none;
  margin-top: 16px;
  border-radius: 16px;
}

.live-tour-transcript {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}

.live-tour-panel.is-fullscreen .live-tour-transcript {
  flex: 1 1 auto;
  min-height: 4.8em;
  margin-top: 16px;
  overflow-y: auto;
  font-size: 18px;
  line-height: 1.55;
}

.live-tour-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.live-tour-panel.is-fullscreen .live-tour-controls {
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
}

.live-tour-toggle {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.live-tour-panel.is-fullscreen .live-tour-toggle {
  min-height: 48px;
  border-radius: 14px;
  font-size: 15px;
}

.live-tour-toggle.is-on {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

@media (max-width: 768px) {
  .live-tour-panel {
    z-index: 1450;
    width: min(420px, calc(100vw - 16px));
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .live-tour-toggle {
    min-height: 44px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .live-tour-panel.is-fullscreen {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(200px, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 10px 16px;
  }

  .live-tour-panel.is-fullscreen .live-tour-panel-head,
  .live-tour-panel.is-fullscreen .live-tour-controls {
    grid-column: 1 / -1;
  }

  .live-tour-panel.is-fullscreen .live-tour-preview:not([hidden]) {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    height: 100%;
    margin-top: 0;
  }

  .live-tour-panel.is-fullscreen .live-tour-transcript {
    grid-column: 2;
    grid-row: 2;
    min-height: 0;
    margin-top: 0;
  }

  .live-tour-panel.is-fullscreen .live-tour-preview[hidden] ~ .live-tour-transcript {
    grid-column: 1 / -1;
  }

  .live-tour-panel.is-fullscreen .live-tour-controls {
    margin-top: 0;
    padding-top: 0;
  }
}

.live-tour-panel.is-hidden {
  display: none;
}

.voice-link-preview {
  overflow-wrap: anywhere;
}

.voice-link-preview {
  display: block;
  margin-top: 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.voice-player {
  margin: 0 22px 14px;
  gap: 12px;
  padding: 12px 14px;
  border-color: #b7dbd4;
  background: #f8fcfb;
}

.voice-player.is-hidden {
  display: none;
}

.voice-player-inline {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 220px;
  max-width: min(340px, 100%);
  padding: 6px 8px;
  border: 1px solid #b7dbd4;
  border-radius: 8px;
  background: #f8fcfb;
  direction: ltr;
}

.voice-play-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  order: 1;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
}

.voice-play-toggle svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.voice-player-time {
  flex: 0 0 auto;
  order: 3;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
  min-width: 72px;
}

.voice-player-slot {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.voice-progress-hit {
  display: block;
  flex: 1 1 auto;
  order: 2;
  min-width: 56px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.voice-progress-track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #d9ebe7;
  overflow: hidden;
}

.voice-progress-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

/* P5.9.7/P5.9.8 shared mobile surfaces. The chat column remains the one
   source of DOM/state; on small screens it changes presentation into a sheet. */
.mobile-ai-fab,
.mobile-chat-backdrop,
.voice-mini-player-slot,
.mobile-chat-sheet-handle,
.mobile-chat-close,
.chat-context-chip {
  display: none;
}

.voice-player-title {
  order: 0;
  min-width: 0;
  max-width: 180px;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-player-title:hover,
.voice-player-title:focus-visible {
  color: var(--teal);
}

.detail-ask-ai {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--teal);
  border-radius: 10px;
  background: #ecfdf5;
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.detail-ask-ai.active,
.detail-ask-ai[aria-expanded="true"] {
  background: var(--teal);
  color: #fff;
}

.trip-view-page .voice-mini-player-slot {
  display: block;
  position: fixed;
  right: 24px;
  bottom: 18px;
  z-index: 30;
  max-width: min(420px, calc(100vw - 48px));
  pointer-events: none;
}

.trip-view-page .voice-mini-player-slot .voice-player {
  pointer-events: auto;
}

.guide-provenance {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.guide-block small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 960px) {
  .trip-view-page .mobile-chat-backdrop[hidden] {
    display: none;
  }

  .trip-view-page.mobile-chat-open {
    overflow: hidden;
  }

  .trip-view-page .mobile-chat-backdrop {
    display: block;
    position: fixed;
    z-index: 1390;
    inset: 0;
    background: rgba(15, 23, 42, 0.42);
  }

  .trip-view-page .chat-column.mobile-chat-sheet {
    display: grid;
    position: fixed;
    z-index: 1400;
    inset: auto 0 0;
    width: 100%;
    height: min(90dvh, 780px);
    max-height: calc(100dvh - env(safe-area-inset-top));
    padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    border: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.28);
    overscroll-behavior: contain;
  }

  .trip-view-page .chat-column.mobile-chat-sheet .chat-pane-head {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 8px 42px 8px 0;
  }

  .trip-view-page .mobile-chat-sheet-handle {
    display: block;
    position: absolute;
    top: 0;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    content: "";
    transform: translateX(-50%);
  }

  .trip-view-page .mobile-chat-close {
    display: grid;
    position: absolute;
    top: 6px;
    right: 0;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--ink);
    font-size: 26px;
    line-height: 1;
  }

  .trip-view-page .chat-context-chip {
    display: block;
    max-width: min(70vw, 330px);
    overflow: hidden;
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .trip-view-page .chat-column.mobile-chat-sheet .chat-feed {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .trip-view-page .chat-column.mobile-chat-sheet .chat-box {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin: 0 -2px;
    padding-top: 8px;
    padding-bottom: 2px;
    background: var(--surface);
  }

  .trip-view-page .mobile-ai-fab {
    display: grid;
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: calc(92px + env(safe-area-inset-bottom));
    z-index: 1100;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--teal);
    color: #fff;
    box-shadow: 0 10px 26px rgba(15, 118, 110, 0.36);
  }

  .trip-view-page .mobile-ai-fab svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .trip-view-page .mobile-ai-fab-dot {
    display: none;
    position: absolute;
    top: 2px;
    right: 1px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #f97316;
  }

  .trip-view-page .mobile-ai-fab.has-unread .mobile-ai-fab-dot {
    display: block;
  }

  .trip-view-page .mobile-ai-fab.is-working {
    animation: mobile-ai-pulse 1.25s ease-in-out infinite;
  }

  .trip-view-page .voice-mini-player-slot {
    display: block;
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 1300;
    pointer-events: none;
  }

  .trip-view-page .voice-mini-player-slot .voice-player {
    width: 100%;
    margin: 0;
    pointer-events: auto;
  }

  .trip-view-page .voice-mini-player-slot .voice-player-inline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  }

  .trip-view-page .voice-mini-player-slot .voice-player-title {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: none;
    padding: 0 4px 5px;
  }

  .trip-view-page .voice-mini-player-slot .voice-play-toggle,
  .trip-view-page .voice-mini-player-slot .voice-progress-hit,
  .trip-view-page .voice-mini-player-slot .voice-player-time {
    grid-row: 2;
  }
}

/* 移动端 media 中的 display:grid（0,4,0）曾覆盖 .voice-player.is-hidden 的
   display:none（0,2,0）—— idle 时 mini player 一直显示并拦截下方点击。
   用更高特异性（0,5,0）保证 is-hidden 始终隐藏。 */
.trip-view-page .voice-mini-player-slot .voice-player.is-hidden {
  display: none;
}

@keyframes mobile-ai-pulse {
  0%, 100% { box-shadow: 0 10px 26px rgba(15, 118, 110, 0.28); }
  50% { box-shadow: 0 10px 34px rgba(15, 118, 110, 0.62); }
}

.detail-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 8px;
  padding: 8px 12px 10px;
  border-top: 1px solid var(--line);
  background: rgba(251, 252, 251, 0.95);
}

.detail-actions button {
  width: 100%;
}

.detail-confirm.is-confirmed {
  background: var(--surface);
  color: var(--teal);
  border: 1px solid rgba(15, 118, 110, 0.28);
  box-shadow: none;
}

.segment-confirmed-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  color: var(--teal);
  vertical-align: -2px;
}

.segment-confirmed-icon svg {
  width: 14px;
  height: 14px;
}

.plan-cell strong {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.timeline-items {
  position: relative;
  display: grid;
  gap: 0;
  padding: 8px 15px 12px;
}

.timeline-items::before {
  content: "";
  position: absolute;
  left: 91px;
  top: 18px;
  bottom: 20px;
  width: 1px;
  background: var(--line);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 62px 88px minmax(0, 1fr) 88px;
  gap: 12px;
  align-items: start;
  padding: 12px 0;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: 72px;
  top: 20px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 1px var(--teal);
}

.timeline-item time {
  padding-top: 1px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.timeline-item h4 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.35;
}

.timeline-item p {
  margin-bottom: 0;
  font-size: 14px;
  line-height: 1.5;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}

.item-meta span {
  padding: 4px 7px;
  border-radius: 8px;
  background: #f5f7f6;
  white-space: nowrap;
}

.item-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.item-actions strong {
  text-align: right;
  font-size: 14px;
  white-space: nowrap;
}

.duration-badge {
  padding: 3px 7px;
  border-radius: 8px;
  background: #eef3f1;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.adjust-button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.adjust-button:hover,
.adjust-button:focus-visible {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(8, 124, 114, 0.12);
}

.item-type {
  display: inline-flex;
  justify-content: center;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.item-type.long-haul {
  background: #edf2ff;
  color: #3451a3;
}

.item-type.hotel {
  background: #fff2e8;
  color: #9a5a14;
}

.item-type.local {
  background: #eaf5f1;
  color: var(--teal);
}

.item-type.meal {
  background: #fff4de;
  color: #8a5600;
}

.map-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.map-toolbar-compact {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.map-toolbar-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

.map-toolbar-primary .map-tabs {
  flex: 1 1 auto;
  min-width: 0;
}

.map-toolbar-primary .title-actions {
  flex: 0 0 auto;
  margin-left: auto;
  position: relative;
  z-index: 3;
}

.map-toolbar-compact .map-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
}

.map-toolbar-compact .map-hint span {
  padding: 4px 7px;
  font-size: 11px;
}

.map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.map-scope {
  min-width: 42px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.map-scope:hover:not(.active) {
  background: rgba(23, 32, 28, 0.07);
}

.map-scope:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.map-scope.overview-scope {
  min-width: 58px;
}

.map-scope.active {
  background: var(--ink);
  color: #fff;
}

.map-hint {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.map-hint span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
}

.title-action {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.12);
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease;
}

.title-action:hover {
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 10px 22px rgba(8, 124, 114, 0.28);
}

.title-action:active {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(8, 124, 114, 0.2);
}

.title-action:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.title-action.view-mode-toggle:hover,
.title-action.view-mode-toggle:focus-visible,
.title-action.calendar-export-toggle:hover,
.title-action.calendar-export-toggle:focus-visible {
  background: #fff;
  color: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 8px 20px rgba(8, 124, 114, 0.2);
  transform: translateY(-1px);
}

.title-action.view-mode-toggle:active,
.title-action.calendar-export-toggle:active {
  transform: translateY(0);
  background: var(--surface-soft);
}

.title-action.cost-verify {
  display: inline-flex;
  width: auto;
  min-width: 34px;
  padding: 0 11px;
  gap: 6px;
  background: #fff;
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 8px 18px rgba(8, 124, 114, 0.14);
}

.title-action.cost-verify:hover,
.title-action.cost-verify:focus-visible {
  background: var(--teal);
  color: #fff;
}

.title-action.cost-verify > span {
  position: static;
  display: inline;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
  white-space: nowrap;
}

.title-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.title-action span {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: none;
  min-width: max-content;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 9px 10px;
  text-align: left;
  white-space: nowrap;
  box-shadow: 0 10px 24px rgba(23, 32, 28, 0.18);
}

.booking-progress span {
  padding-bottom: 18px;
}

.booking-progress i,
.booking-progress-large i {
  display: block;
  overflow: hidden;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

.booking-progress b,
.booking-progress-large b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2bbf9f;
}

.booking-progress > i {
  position: absolute;
  right: 10px;
  bottom: calc(100% + 14px);
  z-index: 1;
  display: none;
  width: 98px;
}

.title-action:hover span,
.title-action:focus-visible span {
  display: block;
}

.booking-progress:hover > i,
.booking-progress:focus-visible > i {
  display: block;
}

.booking-progress-large {
  display: grid;
  gap: 8px;
  padding: 12px 18px 0;
}

.booking-progress-large i {
  height: 8px;
  background: var(--surface-soft);
}

.booking-progress-large span {
  color: var(--muted);
  font-size: 13px;
}

.booking-manifest {
  display: grid;
  gap: 12px;
  padding-top: 0;
}

.booking-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 22px 10px;
}

.booking-filter {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.booking-filter.active {
  border-color: var(--teal);
  background: #eef8f5;
  color: var(--teal);
}

.detail-drawer.detail-booking.open {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

.detail-drawer.detail-booking .detail-main {
  display: block;
  min-width: 0;
  padding: 0 18px 12px;
  overflow: auto;
}

.detail-drawer.detail-booking .booking-progress-large {
  margin: 0 18px 10px;
}

.detail-drawer.detail-booking .booking-filters {
  padding: 0 18px 12px;
}

.booking-list-head,
.booking-list-main {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 72px 68px;
  align-items: center;
  column-gap: 12px;
}

.booking-list-head {
  padding: 0 0 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.booking-list-head span:last-child {
  justify-self: end;
}

.booking-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.booking-list-row {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.booking-list-row:last-child {
  border-bottom: 0;
}

.booking-tier {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.booking-tier.tier-required {
  background: #fff0ee;
  color: #b42318;
}

.booking-tier.tier-recommended {
  background: #eef3ff;
  color: #3559b8;
}

.booking-tier.tier-onsite {
  background: var(--surface-soft);
  color: var(--muted);
}

.booking-list-copy {
  min-width: 0;
}

.booking-list-title {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  word-break: normal;
  overflow-wrap: anywhere;
}

.booking-list-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.booking-list-price {
  justify-self: end;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.booking-status {
  justify-self: end;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.booking-status.status-pending {
  background: #eef3ff;
  color: #3559b8;
}

.booking-status.status-watching {
  background: #fff4e8;
  color: #9a5a14;
}

.booking-status.status-booked {
  background: #e8f5ef;
  color: #0d6b4e;
}

.booking-status.status-skipped {
  background: var(--surface-soft);
  color: var(--muted);
}

.booking-status.status-onsite {
  background: var(--surface-soft);
  color: var(--muted);
}

.booking-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 64px;
}

.booking-action {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.booking-action.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.booking-action.ghost {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.booking-list-empty {
  margin: 0;
  padding: 12px 0 18px;
  color: var(--muted);
  font-size: 13px;
}

.booking-badge {
  display: inline-flex;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  vertical-align: middle;
}

.booking-badge.status-pending {
  background: #eef3ff;
  color: #3559b8;
}

.booking-badge.status-watching {
  background: #fff4e8;
  color: #9a5a14;
}

.booking-badge.status-booked {
  background: #e8f5ef;
  color: #0d6b4e;
}

.booking-badge.status-skipped {
  background: var(--surface-soft);
  color: var(--muted);
}

.booking-badge.status-onsite {
  background: var(--surface-soft);
  color: var(--muted);
}

@media (max-width: 520px) {
  .booking-list-head,
  .booking-list-main {
    grid-template-columns: 48px minmax(0, 1fr);
    row-gap: 6px;
  }

  .booking-list-head span:nth-child(3),
  .booking-list-head span:nth-child(4),
  .booking-list-price,
  .booking-status {
    justify-self: start;
  }

  .booking-list-head span:nth-child(3),
  .booking-list-price {
    grid-column: 2;
  }

  .booking-list-head span:nth-child(4),
  .booking-status {
    grid-column: 2;
    justify-self: end;
  }

  .booking-list-actions {
    padding-left: 0;
  }
}

.map-canvas {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #dfece8;
}

.real-map {
  width: 100%;
  height: 100%;
}

.map-coverage-status {
  position: absolute;
  z-index: 800;
  left: 12px;
  bottom: 12px;
  max-width: min(560px, calc(100% - 24px));
  padding: 8px 11px;
  border: 1px solid rgba(167, 103, 33, 0.24);
  border-radius: 9px;
  background: rgba(255, 249, 235, 0.94);
  color: #75501f;
  box-shadow: 0 7px 18px rgba(52, 40, 22, 0.12);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.marker-index {
  position: absolute;
  top: -6px;
  left: -6px;
  right: auto;
  /* The number is an interaction cue, not part of the image. Keep it above
     the photo, status tag, and any marker decoration. */
  z-index: 30;
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  font-style: normal;
  box-shadow: 0 4px 10px rgba(8, 124, 114, 0.35);
  pointer-events: none;
  isolation: isolate;
}

.marker-index span {
  position: relative;
  z-index: 2;
}

/* Multiple canonical cards may intentionally share one physical venue
   (hotel + breakfast/dinner). Keep their real Leaflet coordinates identical,
   but expose each card as a stable visual stack so none disappears behind
   another marker. The offset is CSS-only and does not participate in route
   geometry or zoom recalculation. */
.leaflet-marker-icon.map-coincident-stack {
  transition:
    margin-left 140ms cubic-bezier(0.2, 0.8, 0.2, 1),
    margin-top 140ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: margin-left, margin-top;
}

.leaflet-marker-icon.map-coincident-stack:not(.map-coincident-expanded) {
  filter: drop-shadow(0 3px 6px rgba(17, 67, 61, 0.16));
}

.map-marker-leader-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: -1;
}

.map-route-sequence-connector.is-pending {
  color: #9a6a2f;
  background: #fff8e8;
  border: 1px solid rgba(154, 106, 47, 0.38);
}

.map-route-sequence-connector.is-pending em {
  color: #86591f;
}

.photo-marker.city .marker-index {
  top: 6px;
  right: 6px;
  left: auto;
}

.photo-marker {
  position: relative;
  box-sizing: border-box;
  overflow: visible;
  width: 54px;
  height: 54px;
  border: 2px solid #fff;
  border-radius: 14px;
  background-color: var(--surface-soft);
  background-image: var(--fallback-image);
  background-position: center;
  background-size: cover;
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.24);
}

.photo-marker img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  border-radius: 12px;
  object-fit: cover;
}

.leaflet-container .leaflet-marker-pane .photo-marker img {
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  padding: 0;
  object-fit: cover;
}

.photo-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  background: var(--surface-soft);
  transform: translateX(-50%) rotate(45deg);
}

.photo-marker.terminal {
  border-color: rgba(255, 255, 255, 0.98);
  background-color: #eaf3f7;
  box-shadow: 0 10px 22px rgba(31, 73, 92, 0.28);
}

.photo-marker.terminal.airport {
  outline: 2px solid rgba(36, 59, 122, 0.18);
}

.photo-marker.terminal.station {
  outline: 2px solid rgba(52, 81, 163, 0.16);
}

.leaflet-marker-icon:hover {
  z-index: 20000 !important;
}

.photo-marker.cluster {
  border-radius: 14px;
}

.photo-marker.city {
  display: grid;
  grid-template-rows: 78px minmax(0, 1fr);
  width: 120px;
  height: 126px;
  overflow: hidden;
  border-width: 3px;
  border-radius: 8px;
  background-color: var(--surface);
  box-shadow: 0 14px 30px rgba(23, 32, 28, 0.28);
}

.photo-marker.city img {
  width: 100%;
  height: 78px;
  max-height: 78px;
  border-radius: 5px;
}

.leaflet-container .leaflet-marker-pane .photo-marker.city img {
  height: 78px !important;
  max-height: 78px !important;
}

.photo-marker.city::after {
  content: none;
  display: none;
}

.city-caption {
  display: grid;
  align-content: center;
  gap: 3px;
  min-height: 0;
  padding: 6px 7px 8px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  line-height: 1.2;
  text-align: center;
}

.city-caption strong,
.city-caption span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.city-caption strong {
  font-size: 14px;
  font-weight: 900;
}

.city-caption span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.photo-marker em {
  position: absolute;
  left: 50%;
  bottom: -22px;
  max-width: 76px;
  padding: 2px 6px;
  overflow: hidden;
  border: 1px solid rgba(207, 224, 218, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 5px 12px rgba(23, 32, 28, 0.12);
  opacity: 0;
  pointer-events: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, 4px);
  transition:
    opacity 0.14s ease,
    transform 0.14s ease;
}

.photo-marker:hover em,
.photo-marker.is-hovered em {
  opacity: 1;
  transform: translate(-50%, 0);
}

.simple-marker {
  position: relative;
  overflow: visible;
  display: inline-grid;
  place-items: center;
  grid-auto-flow: column;
  gap: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 28, 0.25);
  font-size: 15px;
  font-weight: 900;
}

.simple-marker.endpoint {
  max-width: 104px;
  padding-inline: 9px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-color: rgba(34, 67, 60, 0.18);
  box-shadow: 0 8px 20px rgba(23, 32, 28, 0.2);
}

.simple-marker.endpoint.flight span {
  color: #243b7a;
}

.simple-marker.endpoint.rail span {
  color: #3451a3;
}

.simple-marker.endpoint small {
  max-width: 70px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
}

.simple-marker small {
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.simple-marker.meal {
  background: #fff4de;
  color: #8a5600;
  border-color: #fff;
  box-shadow: 0 8px 18px rgba(138, 86, 0, 0.22);
}

.simple-marker.hotel {
  background: #fff2e8;
  color: #9a5a14;
  border-color: #fff;
  box-shadow: 0 8px 18px rgba(154, 90, 20, 0.24);
}

.photo-marker:hover,
.photo-marker.is-hovered,
.simple-marker:hover,
.simple-marker.is-hovered {
  box-shadow: 0 18px 36px rgba(23, 32, 28, 0.34);
  transform: translateY(-2px);
}

.photo-marker.is-selected,
.simple-marker.is-selected {
  outline: 4px solid rgba(217, 111, 85, 0.42);
  box-shadow: 0 14px 30px rgba(23, 32, 28, 0.34);
  transform: translateY(-2px);
}

.simple-marker.rail {
  background: #3451a3;
}

.simple-marker.flight {
  background: #243b7a;
}

.route-arrow {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  box-shadow: 0 5px 12px rgba(23, 32, 28, 0.2);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.leaflet-pane.leaflet-routeHitPane-pane,
.leaflet-pane.leaflet-routeArrowPane-pane {
  pointer-events: auto !important;
}

.leaflet-pane.leaflet-routeHitPane-pane .leaflet-marker-icon.route-arrow-marker,
.leaflet-pane.leaflet-routeArrowPane-pane .leaflet-marker-icon.route-arrow-marker,
.leaflet-marker-icon.route-arrow-marker,
.route-arrow {
  pointer-events: auto !important;
  cursor: pointer;
}

.map-tooltip {
  min-width: 240px;
  max-width: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(23, 32, 28, 0.16);
  white-space: nowrap;
}

.map-tooltip strong,
.map-tooltip span {
  display: block;
}

.map-tooltip strong {
  margin-bottom: 4px;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-tooltip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.map-route-hit-area {
  cursor: pointer;
}

.leaflet-pane.leaflet-routeHitPane-pane .leaflet-marker-icon.map-route-chip-marker,
.leaflet-pane.leaflet-routeArrowPane-pane .leaflet-marker-icon.map-route-chip-marker {
  pointer-events: auto !important;
  cursor: pointer;
}

.map-route-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  max-width: 96px;
  padding: 4px 10px;
  border: 1px solid rgba(217, 111, 85, 0.45);
  border-radius: 999px;
  background: rgba(255, 252, 250, 0.96);
  color: #b84f38;
  box-shadow: 0 6px 18px rgba(23, 32, 28, 0.18);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.map-route-chip.flight::before {
  content: "✈ ";
}

.map-route-chip.rail::before {
  content: "↔ ";
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-attribution {
  font-size: 10px;
}

.map-details {
  display: none !important;
}

.map-details article {
  flex: 1;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.map-details strong,
.map-details span {
  display: block;
}

.map-details span {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.header-menu-entry {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.header-menu-entry:hover {
  border-color: #b8ddd8;
  background: #f7fbfa;
}

.header-menu-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--teal);
}

.header-menu-link:hover {
  color: var(--teal-dark);
}

.header-menu-link.is-active {
  color: var(--teal-dark);
  font-weight: 700;
}

.account-page-platforms {
  max-width: 720px;
}

.platforms-intro {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid #dce9e7;
  border-radius: 14px;
  background: #f7fbfa;
}

.platforms-connected-count {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--teal-dark);
}

.platforms-intro-lead,
.platforms-intro-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.platforms-intro-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.platforms-intro-note code {
  font-size: 12px;
  padding: 1px 5px;
  border-radius: 4px;
  background: #eef5f4;
}

.platform-auth-boundaries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #dce9e7;
}

.platform-auth-boundaries-compact {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.platform-auth-boundary-block {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #dce9e7;
}

.platform-auth-boundary-block-wont {
  border-color: #f0ddd8;
  background: #fffaf8;
}

.platform-auth-boundary-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--teal-dark);
}

.platform-auth-boundary-block-wont .platform-auth-boundary-title {
  color: #a04432;
}

.platform-auth-boundary-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.platform-connect-dialog {
  padding: 0;
  border: 0;
  border-radius: 16px;
  max-width: 520px;
  width: calc(100% - 32px);
}

.platform-connect-dialog::backdrop {
  background: rgba(15, 35, 32, 0.45);
}

.platform-connect-panel {
  padding: 20px 22px 18px;
}

.platform-connect-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.platform-connect-head h2 {
  margin: 0;
  font-size: 18px;
}

.platform-connect-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.platform-connect-lead {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}

.platform-connect-message {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.platform-connect-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.platform-connect-actions .primary-button,
.platform-connect-actions .ghost-button {
  flex: 1;
}

.platforms-page-groups {
  display: grid;
  gap: 16px;
}

.platform-category {
  padding: 14px 16px 12px;
  border: 1px solid #dce9e7;
  border-radius: 14px;
  background: #fff;
}

.platform-category-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.platform-category-title::before {
  content: "[";
}

.platform-category-title::after {
  content: "]";
}

.platform-row-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.platform-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.platform-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.platform-row-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
}

.platform-row-name strong {
  font-weight: 700;
}

.platform-row-status {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.platform-row-status.is-connected {
  color: var(--teal-dark);
}

.platform-row-action {
  justify-self: end;
  min-width: 64px;
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.platform-manage-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
}

.platform-manage-dialog::backdrop {
  background: rgba(23, 32, 28, 0.42);
}

.platform-manage-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.platform-manage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.platform-manage-head h2 {
  margin: 0;
  font-size: 18px;
}

.platform-manage-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.platform-manage-meta {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.platform-manage-meta-row {
  display: grid;
  gap: 4px;
}

.platform-manage-meta dt {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.platform-manage-meta dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.platform-manage-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.platform-manage-actions .primary-button,
.platform-manage-actions .ghost-button {
  min-height: 40px;
  font-size: 13px;
}

.platform-manage-disconnect {
  color: #b54a3a;
  border-color: #efc8c0;
}

.platforms-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.platforms-page-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid #dce9e7;
  border-radius: 14px;
  background: #fff;
}

.platforms-page-card.is-connected {
  border-color: #b8ddd8;
  background: #f7fbfa;
}

.platforms-page-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.platforms-page-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.platforms-page-scope {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.platforms-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.platforms-page-actions .primary-button,
.platforms-page-actions .ghost-button {
  padding: 8px 14px;
  font-size: 13px;
}

.platforms-save-status {
  margin: 14px 2px 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--teal-dark);
}

.account-page-preferences {
  max-width: 640px;
}

.preferences-panel {
  padding: 18px;
  border: 1px solid #dce9e7;
  border-radius: 14px;
  background: #fff;
}

.preferences-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.preferences-panel-head h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.preferences-panel-head p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.preference-tags-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preference-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 8px 10px 8px 14px;
  border: 1px solid #b8ddd8;
  border-radius: 999px;
  background: #f7fbfa;
  color: var(--teal-dark);
}

.preference-tag-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.preference-tag-remove {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.preference-tag-remove:hover {
  background: #e8f3f1;
  color: var(--teal-dark);
}

.preferences-empty {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.preferences-save-status {
  margin: 14px 2px 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--teal-dark);
}

/* Preference Context MVP: canonical preferences editor */
.preference-add-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
}

.preference-add-input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #b8ddd8;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

.preference-add-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.15);
}

.preference-tag-editable {
  align-items: stretch;
  border-radius: 12px;
  max-width: 100%;
}

.preference-tag-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.preference-tag-text {
  cursor: default;
}

.preference-tag-editable .preference-tag-text {
  cursor: pointer;
}

.preference-tag-source {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.preference-tag-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.preference-tag-action {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.preference-tag-action:hover:not(:disabled) {
  background: #e8f3f1;
  color: var(--teal-dark);
}

.preference-tag-action:disabled {
  opacity: 0.35;
  cursor: default;
}

.preference-tag.is-editing {
  border-radius: 12px;
}

.preference-edit-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
}

.preference-edit-form .preference-add-input {
  flex: 1 1 220px;
}

.preference-candidates-panel {
  margin-top: 18px;
}

.preference-candidates-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preference-candidate {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #dce9e7;
  border-radius: 12px;
  background: #fbfdfc;
}

.preference-candidate-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.preference-candidate-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.preference-candidate-actions button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 13px;
}

.preference-candidate-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.preference-candidate-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 560px) {
  .preference-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .preference-add-row .primary-button {
    min-height: 44px;
  }

  .preference-candidate-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .preference-candidate-actions button {
    width: 100%;
  }
}

.account-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 18px 40px;
}

.account-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.account-page-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.account-page-head h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.account-page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.trips-page-list {
  display: grid;
  gap: 12px;
}

.trips-page-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.trips-page-card.is-current {
  border-color: #9ec5e8;
  background: #f3f9ff;
}

.trips-page-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trips-page-card-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

.trips-page-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.trips-page-card-meta {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.trips-page-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  text-decoration: none;
}

.account-page-auth {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
  padding-top: 40px;
  padding-bottom: 40px;
}

.auth-card {
  width: min(420px, 100%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-card-head h1 {
  margin: 0 0 8px;
  font-size: 24px;
}

.auth-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 18px 0 16px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-soft);
}

.auth-tab {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.is-active {
  background: var(--surface);
  color: var(--teal);
  box-shadow: 0 1px 4px rgba(23, 32, 28, 0.08);
}

.auth-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0 16px;
  padding: 0;
  list-style: none;
}

.auth-step {
  position: relative;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.auth-step.is-active {
  border-color: #b8ddd8;
  background: #f7fbfa;
  color: var(--teal-dark);
}

.auth-step.is-done {
  border-color: #b8ddd8;
  color: var(--teal);
}

.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.auth-code-row input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-code-button {
  min-height: 40px;
  padding: 0 12px;
  white-space: nowrap;
}

.auth-code-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-status {
  min-height: 18px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--teal-dark);
  font-weight: 700;
}

.auth-switch {
  margin: 16px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
}

.auth-switch a {
  color: var(--teal);
  font-weight: 800;
  text-decoration: none;
}

.auth-switch a:hover {
  color: var(--teal-dark);
}

.auth-verified-badge {
  margin: 0 0 4px;
  padding: 10px 12px;
  border: 1px solid #b8ddd8;
  border-radius: 10px;
  background: #f7fbfa;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
}

.auth-form-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.auth-back-button,
.auth-form-actions .auth-submit {
  min-height: 42px;
}

.auth-form-actions .auth-submit {
  width: 100%;
  margin-top: 0;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-field {
  display: grid;
  gap: 6px;
}

.auth-field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.auth-field input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 4px;
}

.auth-footnote {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.account-page-profile {
  max-width: 820px;
}

.profile-completion-nudge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 820px;
  margin: 0 auto;
  padding: 14px 18px;
  border-bottom: 1px solid #dce9e7;
  background: #f7fbfa;
}

.profile-nudge-copy {
  display: grid;
  gap: 4px;
}

.profile-nudge-copy strong {
  font-size: 14px;
  color: var(--ink);
}

.profile-nudge-copy span {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-nudge-action {
  flex-shrink: 0;
  min-height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.profile-welcome-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #b8ddd8;
  border-radius: 12px;
  background: #f7fbfa;
}

.profile-welcome-banner strong {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

.profile-welcome-banner p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.profile-section-highlight {
  border-color: #b8ddd8;
  background: linear-gradient(180deg, #f7fbfa 0%, #fff 100%);
}

.profile-doc-group {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.profile-doc-group-priority h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--teal-dark);
}

.profile-traveler-card-self {
  border-color: #b8ddd8;
}

.profile-empty-companions {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.profile-form {
  display: grid;
  gap: 16px;
}

.profile-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-section h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.profile-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-section-head h2 {
  margin: 0;
}

.profile-section-note {
  margin: -4px 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-field {
  display: grid;
  gap: 6px;
}

.profile-field-span {
  grid-column: 1 / -1;
}

.profile-field span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.profile-field input,
.profile-field select {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.profile-field input[readonly] {
  background: var(--surface-soft);
  color: var(--muted);
}

.profile-doc-grid,
.profile-traveler-grid {
  display: grid;
  gap: 12px;
}

.profile-doc-card,
.profile-traveler-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.profile-doc-card h3 {
  margin: 0 0 10px;
  font-size: 14px;
}

.profile-traveler-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-remove-traveler {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 8px;
}

.profile-save-status {
  margin: 0;
  font-size: 12px;
  color: var(--teal);
  font-weight: 700;
}

.profile-save-button {
  min-height: 42px;
  padding: 0 18px;
}

@media (max-width: 620px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .profile-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-completion-nudge {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-nudge-action {
    width: 100%;
  }

  .platform-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name status"
      "action action";
  }

  .platform-row-name {
    grid-area: name;
  }

  .platform-row-status {
    grid-area: status;
    justify-self: end;
  }

  .platform-row-action {
    grid-area: action;
    width: 100%;
    justify-self: stretch;
  }

  .platform-manage-actions {
    grid-template-columns: 1fr;
  }

  .platform-auth-boundaries {
    grid-template-columns: 1fr;
  }

  .flight-explore-toolbar {
    flex-direction: column;
  }

  .flight-explore-start {
    width: 100%;
  }

  .platform-connect-actions {
    flex-direction: column;
  }

  .auth-code-row {
    grid-template-columns: 1fr;
  }

  .auth-form-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 960px) {
  .app-header,
  .planner-layout {
    grid-template-columns: 1fr;
  }

  .app-header {
    height: auto;
    min-height: 56px;
    padding-top: max(12px, env(safe-area-inset-top, 0px));
    padding-right: max(14px, env(safe-area-inset-right, 0px));
    padding-bottom: 12px;
    padding-left: max(14px, env(safe-area-inset-left, 0px));
  }

  body.home-body .app-header,
  .readonly-share-page .app-header {
    padding-top: max(12px, env(safe-area-inset-top, 0px));
  }

  .planner-layout {
    height: calc(100vh - 56px);
    overflow: hidden;
  }

  .itinerary-column {
    grid-template-rows: minmax(0, 1fr);
    min-height: 0;
  }

  .map-canvas {
    min-height: 0;
  }

  .chat-column {
    display: none;
  }

  .detail-main {
    grid-template-columns: minmax(140px, 0.4fr) minmax(0, 0.6fr);
  }

  .detail-drawer.detail-poi .detail-main,
  .detail-drawer.detail-meal-signature .detail-main {
    grid-template-columns: minmax(160px, 0.44fr) minmax(0, 0.56fr);
  }

  .detail-drawer.open .detail-poi-hero,
  .detail-drawer.open .detail-hero,
  .detail-drawer.open .travel-detail-hero {
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: none;
  }

  .detail-gallery {
    grid-template-rows: minmax(120px, 1fr) minmax(120px, 1fr);
  }

  .detail-hero {
    width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: none;
  }

  .header-nav {
    width: 100%;
    justify-content: flex-end;
  }

  .header-menu-panel {
    right: 0;
    left: auto;
  }
}

@media (max-width: 620px) {
  .planner-layout {
    padding: 10px;
  }

  .chat-column,
  .itinerary-column {
    padding: 14px;
  }

  .pane-head,
  .itinerary-toolbar,
  .day-head,
  .timeline-item {
    min-width: 0;
  }

  .day-side {
    display: grid;
    justify-content: start;
  }

  .poi-strip {
    justify-content: start;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    padding-left: 20px;
  }

  .timeline-items::before {
    left: 5px;
  }

  .timeline-item::before {
    left: 0;
  }

  .item-actions,
  .day-head > strong {
    justify-items: start;
    text-align: left;
  }

  .detail-summary-unified {
    grid-template-columns: 1fr;
  }

  .chat-box {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------------
   P5.9.5 Mobile / Tablet compatibility

   Trip View keeps the same DOM, map projection and interaction handlers at
   every size. These rules only change layout and hit-area presentation.
   Keep this block together so later pages do not accumulate conflicting
   mobile overrides.
---------------------------------------------------------------------------- */
:where(html, body) {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

/* P5.10.4.3 I: explicit HTTPS fallback hint under the webcal CTA. */
.calendar-fallback-note {
  margin: 8px 2px 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.6;
}

/* P5.10.4.3 I: minimal feedback page form controls. */
.feedback-input {
  width: 100%;
  min-height: 132px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}

.feedback-input:focus-visible {
  outline: 2px solid #0d9488;
  outline-offset: 1px;
  border-color: #0d9488;
}

.feedback-count {
  margin: 6px 2px 0;
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
}

.trip-view-page,
.trip-view-page .app-shell {
  min-height: 100dvh;
}

.trip-view-page .planner-layout {
  height: calc(100dvh - 56px);
  min-height: 0;
  min-width: 0;
}

.trip-view-page .chat-column,
.trip-view-page .itinerary-column,
.trip-view-page #mapView,
.trip-view-page .trip-content,
.trip-view-page .trip-panel,
.trip-view-page .map-panel,
.trip-view-page .manifest-panel {
  min-width: 0;
}

.trip-view-page .map-toolbar-primary,
.trip-view-page .map-toolbar-primary .map-tabs,
.trip-view-page .map-toolbar-primary .title-actions {
  min-width: 0;
}

.trip-view-page .map-toolbar-primary .map-tabs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.trip-view-page .map-toolbar-primary .map-scope {
  flex: 0 0 auto;
  min-height: 44px;
}

.trip-view-page .title-action,
.trip-view-page .detail-close,
.trip-view-page .detail-nav,
.trip-view-page .detail-map-icon-link {
  min-width: 44px;
  min-height: 44px;
}

.trip-view-page .map-route-sequence {
  min-width: 0;
  overscroll-behavior-x: contain;
}

.trip-view-page .map-canvas,
.trip-view-page .real-map {
  min-width: 0;
}

.trip-view-page .detail-drawer.open {
  min-width: 0;
}

.trip-view-page .detail-card-scroll,
.trip-view-page .detail-drawer.detail-calendar-sync .detail-main,
.trip-view-page .detail-drawer.detail-share .detail-main {
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 961px) and (max-width: 1120px) {
  .trip-view-page .planner-layout {
    grid-template-columns: minmax(290px, 34vw) minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .trip-view-page .chat-column,
  .trip-view-page .itinerary-column {
    padding: 10px;
  }
}

@media (max-width: 960px) {
  .trip-view-page .app-header {
    min-height: 56px;
    height: auto;
    padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + 4px));
    padding-bottom: 8px;
  }

  .trip-view-page .planner-layout {
    height: calc(100dvh - 56px - env(safe-area-inset-top));
    padding: 10px;
  }

  .trip-view-page .chat-column {
    display: none;
  }

  .trip-view-page .itinerary-column {
    width: 100%;
    overflow: hidden;
    padding: 10px;
  }

  .trip-view-page .map-toolbar-primary {
    align-items: center;
  }

  .trip-view-page .map-toolbar-primary .title-actions {
    gap: 4px;
    align-items: center;
    align-self: center;
  }

  .trip-view-page .map-toolbar-primary .title-action {
    width: 44px;
    height: 44px;
  }

  .trip-view-page .map-hint {
    max-width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .trip-view-page .map-hint span {
    flex: 0 0 auto;
  }

  .trip-view-page .map-canvas {
    min-height: clamp(360px, 56dvh, 660px);
  }

  .trip-view-page .detail-drawer.open {
    position: fixed;
    inset: auto 0 0;
    z-index: 1200;
    width: 100%;
    height: min(88dvh, 760px);
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-right: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -20px 56px rgba(15, 23, 42, 0.22);
  }

  .trip-view-page .detail-drawer.open .detail-head {
    position: relative;
    padding: 12px 14px;
    padding-top: max(18px, env(safe-area-inset-top));
    cursor: grab;
    touch-action: pan-x;
  }

  .trip-view-page .detail-drawer.open .detail-head,
  .trip-view-page .detail-drawer.open .detail-head-main,
  .trip-view-page .detail-drawer.open .detail-title-row,
  .trip-view-page .detail-drawer.open .detail-title-row h3 {
    min-width: 0;
  }

  .trip-view-page .detail-drawer.open .detail-title-row h3 {
    overflow-wrap: break-word;
  }

  .trip-view-page .detail-drawer.open .detail-head::before {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: #94a3b8;
    content: "";
    transform: translateX(-50%);
  }

  .trip-view-page .detail-drawer.open .detail-card-scroll {
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .trip-view-page .detail-drawer.open .detail-main,
  .trip-view-page .detail-drawer.open .detail-summary,
  .trip-view-page .detail-drawer.open .detail-facts {
    min-width: 0;
  }

  .trip-view-page .detail-drawer.detail-card-open .detail-main,
  .trip-view-page .detail-drawer.detail-local .detail-main,
  .trip-view-page .detail-drawer.detail-hotel .detail-main,
  .trip-view-page .detail-drawer.detail-poi .detail-main,
  .trip-view-page .detail-drawer.detail-meal .detail-main,
  .trip-view-page .detail-drawer.detail-meal-signature .detail-main {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .trip-view-page .detail-drawer.open .detail-poi-hero,
  .trip-view-page .detail-drawer.open .detail-hero,
  .trip-view-page .detail-drawer.open .travel-detail-hero {
    width: 100%;
    height: clamp(132px, 24dvh, 220px);
    min-height: 132px;
    max-height: 220px;
  }

  .trip-view-page .detail-drawer.detail-calendar-sync .detail-main,
  .trip-view-page .detail-drawer.detail-share .detail-main {
    padding: 12px 14px calc(20px + env(safe-area-inset-bottom));
  }

  .trip-view-page .enrichment-overview {
    margin-right: 0;
    margin-left: 0;
  }

  /* P5.10.3C B2: when the soft keyboard opens, the visual viewport shrinks;
     --itravel-visual-height (updated on visualViewport resize) caps the
     sheet/drawer height so the input row stays visible. */
  .trip-view-page .chat-column.mobile-chat-sheet {
    height: min(90dvh, 780px, var(--itravel-visual-height, 100vh));
  }

  .trip-view-page .detail-drawer.open {
    height: min(88dvh, 760px, var(--itravel-visual-height, 100vh));
  }

  /* P5.10.3C B1 replaced: phones use the shared compact itinerary cards
     instead of a squeezed 7-column table or a 700px min-width scroller. */
  .trip-view-page .table-wrap {
    overflow-x: hidden;
  }

  .trip-view-page .itinerary-table {
    min-width: 0;
  }

  .trip-view-page .skill-btn {
    min-height: 44px;
    padding: 0 14px;
  }

  /* The drawer's own back button (kept for parity with the close button). */
  .trip-view-page .detail-drawer.open .detail-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    padding: 0 10px;
    border-radius: 8px;
  }
}

@media (max-width: 600px) {
  .trip-view-page .app-header {
    padding-top: max(12px, calc(env(safe-area-inset-top, 0px) + 4px));
    padding-right: max(10px, env(safe-area-inset-right, 0px));
    padding-bottom: 8px;
    padding-left: max(10px, env(safe-area-inset-left, 0px));
  }

  .trip-view-page .brand {
    gap: 8px;
  }

  .trip-view-page .brand strong {
    font-size: 15px;
  }

  .trip-view-page .header-nav {
    gap: 0;
  }

  .trip-view-page .header-menu-trigger {
    min-height: 44px;
    padding: 0 8px;
    font-size: 12px;
  }

  .trip-view-page .planner-layout {
    padding: 8px max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
  }

  .trip-view-page .itinerary-column {
    padding: 8px;
    border-radius: 14px;
  }

  .trip-view-page .map-toolbar-primary {
    gap: 4px;
    align-items: center;
  }

  .trip-view-page .map-toolbar-primary .title-actions {
    flex: 0 0 auto;
    align-items: center;
    align-self: center;
  }

  .trip-view-page .map-toolbar-primary .title-action {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .trip-view-page .map-scope {
    min-width: 44px;
    padding: 0 10px;
    font-size: 12px;
  }

  .trip-view-page .map-canvas {
    min-height: clamp(340px, 52dvh, 520px);
  }

  .trip-view-page .map-search-bar {
    top: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
  }

  .trip-view-page .map-search-input-wrapper {
    min-height: 44px;
  }

  .trip-view-page .map-route-sequence {
    padding: 8px 6px;
  }

  .trip-view-page .calendar-mode-switch {
    grid-template-columns: 1fr;
  }

  .trip-view-page .calendar-primary-actions,
  .trip-view-page .calendar-management-actions,
  .trip-view-page .share-management-actions {
    grid-template-columns: 1fr;
  }

  .trip-view-page .calendar-primary-actions > *,
  .trip-view-page .calendar-management-actions > *,
  .trip-view-page .share-management-actions > * {
    min-height: 44px;
  }

  .trip-view-page .detail-summary,
  .trip-view-page .detail-facts,
  .trip-view-page .detail-summary-unified {
    grid-template-columns: minmax(0, 1fr);
  }

  .trip-view-page .detail-drawer.open .detail-close {
    width: 44px;
    height: 44px;
  }

  .trip-view-page .detail-drawer.open .detail-section,
  .trip-view-page .detail-drawer.open .detail-evidence-section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .trip-view-page .detail-drawer.open .detail-actions,
  .trip-view-page .detail-drawer.open .detail-links,
  .trip-view-page .detail-drawer.open .card-booking-links,
  .trip-view-page .detail-drawer.open .card-search-entries {
    grid-template-columns: minmax(0, 1fr);
  }

  .trip-view-page .detail-drawer.open .detail-actions > *,
  .trip-view-page .detail-drawer.open .detail-links > *,
  .trip-view-page .detail-drawer.open .card-booking-link,
  .trip-view-page .detail-drawer.open .card-search-link {
    min-height: 44px;
  }

  .trip-view-page .detail-drawer.open .detail-card-scroll {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

}

@media (max-width: 960px) {
  /* P5.10.3C B2: the chat send button keeps a 44px touch target while the
     chat pane is the mobile bottom sheet. */
  .trip-view-page .chat-box button.primary-button {
    height: 44px;
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .trip-view-page .map-toolbar-primary .title-action {
    width: 44px;
    min-width: 44px;
  }

  .trip-view-page .title-action svg {
    width: 17px;
    height: 17px;
  }

  .trip-view-page .map-hint span {
    font-size: 10px;
  }
}

/* Share is a read-only projection, but it gets the same touch-first layout
   treatment: the map/list remains one DOM and the drawer owns its scroll. */
.share-view-page,
.share-view-page .share-app-shell,
.share-view-page #shareLoadedView {
  min-height: 100dvh;
}

@media (max-width: 720px) {
  .share-view-page .share-header {
    align-items: flex-start;
    gap: 8px;
    padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  }

  .share-view-page .share-header-left {
    min-width: 0;
    gap: 7px;
  }

  .share-view-page .share-title-group,
  .share-view-page .share-trip-title {
    min-width: 0;
  }

  .share-view-page .share-trip-title {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .share-view-page .share-trip-subtitle,
  .share-view-page .share-updated-at {
    display: none;
  }

  .share-view-page .share-header-right {
    flex: 0 0 auto;
  }

  .share-view-page .share-view-toggle {
    min-height: 44px;
  }

  .share-view-page .share-view-btn {
    min-height: 40px;
    padding: 6px 9px;
    font-size: 12px;
  }

  .share-view-page .share-guide {
    padding: 8px 10px;
    font-size: 11px;
  }

  .share-view-page .share-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 8px 10px;
  }

  .share-view-page .share-day-tabs {
    min-width: 0;
    padding-bottom: 3px;
  }

  .share-view-page .share-day-tab {
    min-height: 44px;
    padding: 8px 12px;
  }

  .share-view-page .share-summary-chips {
    overflow-x: auto;
  }

  .share-view-page .share-map-wrapper,
  .share-view-page #shareMap {
    min-height: 0;
  }

  .share-view-page .share-manifest-wrapper {
    padding: 12px 10px calc(20px + env(safe-area-inset-bottom));
  }

  .share-view-page .share-day-card {
    padding: 12px;
  }

  .share-view-page .share-day-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .share-view-page .share-item-card {
    min-height: 56px;
    padding: 10px;
  }

  .share-view-page .share-drawer {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(82dvh, 720px);
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-right: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -20px 56px rgba(15, 23, 42, 0.22);
  }

  .share-view-page .share-drawer-head {
    padding: 14px 14px 10px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .share-view-page .share-drawer-close {
    width: 44px;
    height: 44px;
  }

  .share-view-page .share-drawer-body {
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }
}

/* Standalone flight search aggregate page (WeChat share link) */
.flight-search-standalone-body {
  background: #eef3f1;
}

.flight-search-shell {
  min-height: 100vh;
}

.flight-search-header-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.flight-search-root.detail-drawer {
  display: grid;
  position: static;
  inset: auto;
  z-index: 1;
  width: min(1000px, calc(100% - 32px));
  min-height: calc(100vh - 120px);
  margin: 20px auto 32px;
  overflow: auto;
}

.flight-search-query-meta {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.flight-search-sync {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.flight-search-root .detail-head {
  padding-right: 18px;
}

.flight-search-root .flight-explore-toolbar {
  align-items: center;
}

@media (max-width: 720px) {
  .flight-search-root.detail-drawer {
    width: calc(100% - 16px);
    margin: 12px auto 24px;
    inset: auto;
  }
}

/* --------------------------------------
   Dashboard Layout (Phase 1) - World Class Atelier Edition
-------------------------------------- */
.dashboard-shell {
  background: radial-gradient(circle at 50% -15%, rgba(15, 118, 110, 0.15) 0%, transparent 65%),
              radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
              radial-gradient(circle at 10% 40%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
              #eaeceb;
  min-height: 100vh;
}

.dashboard-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.dashboard-hero {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dashboard-hero::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 580px;
  height: 280px;
  background: radial-gradient(ellipse at center, rgba(15, 118, 110, 0.14) 0%, rgba(99, 102, 241, 0.08) 50%, transparent 70%);
  filter: blur(45px);
  z-index: 0;
  pointer-events: none;
  animation: heroAuraPulse 8s ease-in-out infinite alternate;
}

@keyframes heroAuraPulse {
  0% { transform: translateX(-50%) scale(0.92); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

.hero-pill-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  border: 1px solid rgba(15, 118, 110, 0.2);
  color: #0f766e;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(15, 118, 110, 0.06);
  backdrop-filter: blur(12px);
}

.hero-greeting {
  position: relative;
  z-index: 1;
  font-size: 46px;
  font-weight: 800;
  margin: 0 0 16px 0;
  color: #0f172a;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.hero-subtext {
  position: relative;
  z-index: 1;
  font-size: 16.5px;
  font-weight: 500;
  color: #334155;
  margin: 0 0 36px 0;
  max-width: 600px;
  line-height: 1.65;
  letter-spacing: -0.01em;
}

/* Brainstorm Chat Container & Message Bubbles */
.brainstorm-workspace {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: start;
  gap: 14px;
  width: 100%;
  max-width: 980px;
  margin: 0 auto 28px;
}

.brainstorm-workspace[hidden] {
  display: none;
}

.brainstorm-chat-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  max-height: 480px;
  overflow-y: auto;
  margin: 0;
  padding: 24px;
  background: #ffffff;
  border-radius: 24px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 24px 48px -16px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.03);
  text-align: left;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.brainstorm-chat-toolbar {
  position: sticky;
  top: -24px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -24px -24px 18px;
  padding: 13px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.brainstorm-chat-toolbar-title {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brainstorm-clear-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.brainstorm-clear-button:hover {
  border-color: #f0a6a6;
  color: #b42318;
  background: #fff7f7;
}

.brainstorm-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brainstorm-new-button,
.brainstorm-sessions-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.brainstorm-new-button:hover,
.brainstorm-sessions-toggle:hover {
  border-color: #7dd3fc;
  color: #0284c7;
  background: #f0f9ff;
}

.brainstorm-sessions {
  position: relative;
}

.brainstorm-sessions:not(.workspace-sidebar) .brainstorm-sessions-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 50;
  min-width: 264px;
  max-width: 340px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.brainstorm-session-item {
  display: flex;
  align-items: center;
  gap: 2px;
  border-radius: 8px;
}

.brainstorm-session-item:hover {
  background: #f8fafc;
}

.brainstorm-session-item.active {
  background: #eff6ff;
}

.brainstorm-session-restore {
  flex: 1;
  min-width: 0;
  padding: 9px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brainstorm-session-meta {
  padding: 0 10px 7px;
  font-size: 11px;
  color: #94a3b8;
}

.brainstorm-session-rename,
.brainstorm-session-delete {
  flex: none;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
}

.brainstorm-session-rename:hover {
  color: #0369a1;
  background: #f0f9ff;
}

.brainstorm-session-delete:hover {
  color: #b42318;
  background: #fff7f7;
}

.brainstorm-sessions-empty {
  padding: 10px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

.draft-pref-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.draft-pref-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.draft-pref-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: #1e293b;
  overflow-wrap: anywhere;
}

.draft-pref-scope {
  flex: none;
  font-size: 10px;
  color: #64748b;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 2px 8px;
}

.draft-pref-remember,
.draft-pref-remove {
  flex: none;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid #d7dde5;
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  cursor: pointer;
}

.draft-pref-remember {
  color: #0369a1;
}

.draft-pref-remember:hover {
  background: #f0f9ff;
  border-color: #7dd3fc;
}

.draft-pref-remove {
  color: #94a3b8;
}

.draft-pref-remove:hover {
  color: #b42318;
  background: #fff7f7;
}

.draft-pref-remember:disabled {
  cursor: wait;
  opacity: 0.6;
}

.brainstorm-clear-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

/* P5.10.4.3 I: 触控设备上，本工作包相关的会话/偏好/日历控件保证 ≥44px 触控目标
   （仅精确命中新控件与日历抽屉按钮，不做整体 UI 改造；card-chat 控件本身已是 44px）。 */
@media (pointer: coarse) {
  .brainstorm-session-rename,
  .brainstorm-session-delete {
    min-height: 44px;
  }
  .draft-pref-line {
    min-height: 44px;
  }
  .draft-pref-remember,
  .draft-pref-remove {
    min-height: 44px;
    padding: 0 12px;
  }
  .calendar-primary-actions > *,
  .calendar-management-actions > *,
  .calendar-other-devices .share-calendar-sub-btn,
  .calendar-other-devices .copy-calendar-sub-url-btn {
    min-height: 44px;
  }
}

.trip-summary-panel {
  position: sticky;
  top: 14px;
  padding: 16px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  text-align: left;
}

.trip-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}

.trip-summary-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
}

.trip-summary-head h2 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
}

.trip-summary-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  color: #64748b;
  background: #f8fafc;
  font-size: 11px;
  font-weight: 700;
}

.trip-summary-status.ready {
  border-color: #99d5cc;
  color: #0f766e;
  background: #edf9f6;
}

.trip-summary-list {
  display: grid;
  gap: 0;
  margin: 10px 0 12px;
}

.trip-summary-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #eef2f6;
}

.trip-summary-item dt {
  color: #64748b;
  font-size: 12px;
}

.trip-summary-item dd {
  min-width: 0;
  margin: 0;
  color: #172033;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.trip-summary-item dd.pending {
  color: #94a3b8;
  font-weight: 500;
}

.trip-summary-edit-button {
  width: 100%;
  min-height: 34px;
  border: 1px solid #b8c3d1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.trip-summary-editor {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e2e8f0;
}

.trip-summary-editor[hidden] {
  display: none;
}

.trip-summary-editor label {
  display: grid;
  gap: 4px;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
}

.trip-summary-editor input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  min-height: 34px;
  padding: 0 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #0f172a;
  background: #fff;
}

.trip-summary-editor-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trip-summary-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trip-summary-editor-actions button {
  min-height: 34px;
  border: 1px solid #b8c3d1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.trip-summary-editor-actions button[type="submit"] {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

@media (max-width: 820px) {
  .dashboard-main {
    padding-inline: 16px;
  }

  .brainstorm-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .brainstorm-chat-container {
    order: 2;
    padding: 18px;
  }

  .brainstorm-chat-toolbar {
    top: -18px;
    margin: -18px -18px 16px;
  }

  .brainstorm-clear-button {
    min-height: 44px;
  }

  .trip-summary-panel {
    position: static;
    order: 1;
  }

  .trip-summary-list {
    grid-template-columns: 1fr 1fr;
    column-gap: 14px;
  }
}

.brainstorm-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brainstorm-msg {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.brainstorm-msg.user {
  align-items: flex-end;
}

.brainstorm-msg.assistant {
  align-items: flex-start;
}

.brainstorm-msg.user .msg-bubble {
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 20px 20px 4px 20px;
  font-size: 15px;
  line-height: 1.55;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.22);
  max-width: 85%;
  word-break: break-word;
}

.brainstorm-msg.assistant .msg-bubble {
  background: #f8fafc;
  color: #0f172a;
  padding: 16px 20px;
  border-radius: 20px 20px 20px 4px;
  border: 1.5px solid #e2e8f0;
  font-size: 15px;
  line-height: 1.68;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
  max-width: 90%;
  word-break: break-word;
}

.msg-bubble strong { font-weight: 600; }
.msg-bubble em { font-style: italic; }
.msg-bubble code {
  background: var(--bg-muted, rgba(0,0,0,0.06));
  padding: 1px 5px;
  border-radius: 3px;
  font-family: monospace;
  font-size: 0.9em;
}
.msg-bubble .md-h3 {
  display: block;
  font-size: 1.05em;
  margin: 12px 0 4px;
}
.msg-bubble .md-h4 {
  display: block;
  font-size: 1em;
  margin: 10px 0 4px;
}
.msg-bubble .md-list {
  margin: 6px 0;
  padding-left: 20px;
}
.msg-bubble .md-list li {
  margin: 4px 0;
  line-height: 1.5;
}
.msg-bubble ol.md-list { list-style: decimal; }
.msg-bubble ul.md-list { list-style: disc; }

.citation-link {
  color: var(--accent, #2563eb);
  text-decoration: none;
  font-size: 0.85em;
  vertical-align: super;
  padding: 0 2px;
  border-radius: 2px;
  transition: background 0.15s;
}
.citation-link:hover {
  background: var(--accent-bg, rgba(37, 99, 235, 0.1));
  text-decoration: underline;
}
.citation-ref {
  color: var(--muted);
  font-size: 0.85em;
  vertical-align: super;
}

/* Standalone system/operation state on the home page: never an Agent reply.
   Used for validation notes, create progress and failure/retry states. */
.brainstorm-msg.system-state {
  align-items: stretch;
}

.brainstorm-msg.agent-progress {
  padding: 10px 0;
  color: var(--text-secondary, #6b7280);
  font-size: 14px;
  animation: brainstorm-pulse 1.5s ease-in-out infinite;
}

@keyframes brainstorm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.brainstorm-msg.system-state .msg-bubble {
  background: #fffbeb;
  color: #7a5a10;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1.5px dashed #d9a441;
  font-size: 14px;
  line-height: 1.6;
  max-width: 100%;
  word-break: break-word;
}

.brainstorm-retry-btn {
  margin-top: 10px;
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #fff;
  color: #0f766e;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

/* Creation CTA Action Card */
.create-trip-cta-card {
  margin-top: 14px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.08), rgba(99, 102, 241, 0.08));
  border: 1.5px solid rgba(15, 118, 110, 0.3);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.1);
  width: 92%;
}

.create-trip-cta-card .cta-badge {
  font-size: 14px;
  font-weight: 700;
  color: #0f766e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brainstorm-msg.trip-change-proposal {
  width: 92%;
}

.brainstorm-msg.trip-change-proposal .proposal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.create-trip-cta-btn {
  width: 100%;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 700;
  background: linear-gradient(135deg, #0f766e 0%, #4338ca 100%);
  border: none;
  color: white;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.3);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.create-trip-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.4);
  filter: brightness(1.06);
}

.create-trip-cta-btn:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

.trip-create-progress {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  width: min(100%, 590px);
  padding: 20px;
  border: 1px solid #b9ddd7;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(235, 249, 246, 0.98), rgba(244, 247, 255, 0.98));
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.1);
}

.trip-create-orbit {
  position: relative;
  width: 72px;
  height: 72px;
  align-self: start;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
}

.trip-create-orbit::before,
.trip-create-orbit::after,
.trip-create-orbit span,
.trip-create-orbit i,
.trip-create-orbit b {
  position: absolute;
  display: block;
  border-radius: 50%;
  content: "";
}

.trip-create-orbit::before {
  inset: 22px;
  background: #0f766e;
  box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.1);
  animation: tripCreatePulse 1.8s ease-in-out infinite;
}

.trip-create-orbit::after {
  inset: 8px;
  border: 1px dashed rgba(67, 56, 202, 0.44);
  animation: tripCreateSpin 8s linear infinite;
}

.trip-create-orbit span { width: 7px; height: 7px; top: 10px; left: 34px; background: #4338ca; }
.trip-create-orbit i { width: 6px; height: 6px; right: 10px; bottom: 19px; background: #f59e0b; }
.trip-create-orbit b { width: 5px; height: 5px; bottom: 11px; left: 17px; background: #0f766e; }

.trip-create-kicker {
  margin: 1px 0 5px;
  color: #0f766e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.trip-create-progress h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.25;
}

.trip-create-progress-copy > p:not(.trip-create-kicker) {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.trip-create-current {
  margin-top: 13px;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.74);
  color: #0f766e;
  font-size: 12px;
  font-weight: 750;
}

.trip-create-stages {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.trip-create-stage {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: #94a3b8;
}

.trip-create-stage-dot {
  display: grid;
  width: 17px;
  height: 17px;
  place-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 50%;
  background: #fff;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.trip-create-stage strong,
.trip-create-stage small {
  display: block;
}

.trip-create-stage strong { font-size: 12px; line-height: 1.25; }
.trip-create-stage small { margin-top: 2px; font-size: 11px; line-height: 1.35; }

.trip-create-stage.is-active { color: #0f766e; }
.trip-create-stage.is-active .trip-create-stage-dot { border-color: #0f766e; background: #0f766e; }
.trip-create-progress--success { border-color: #99d5cc; }
.trip-create-progress--error { border-color: #f3c2bd; background: #fff8f7; }
.trip-create-progress--error .trip-create-orbit::before { background: #c85a54; box-shadow: 0 0 0 8px rgba(200, 90, 84, 0.1); animation: none; }

/* P5.10.4.1: progress meta line (phase / N-M days / elapsed) + action row
   (pause while running; continue + cancel while paused; retry on error). */
.trip-create-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  color: #64748b;
  font-size: 12px;
}

.trip-create-meta b {
  color: #0f766e;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.trip-create-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.create-action-btn {
  min-height: 34px;
  padding: 0 16px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #fff;
  color: #0f766e;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.create-action-btn:hover {
  background: #f0fdfa;
}

.create-action-btn--danger {
  border-color: #c85a54;
  color: #c85a54;
}

.create-action-btn--danger:hover {
  background: #fff8f7;
}

.trip-create-recovered-link {
  margin-left: 6px;
  color: #0f766e;
  font-weight: 700;
}

@keyframes tripCreateSpin { to { transform: rotate(360deg); } }
@keyframes tripCreatePulse { 50% { transform: scale(0.78); opacity: 0.72; } }

@media (max-width: 640px) {
  .trip-create-progress {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .trip-create-orbit { width: 50px; height: 50px; }
  .trip-create-orbit::before { inset: 16px; }
  .trip-create-orbit::after { inset: 5px; }
  .trip-create-orbit span { top: 6px; left: 23px; }
  .trip-create-orbit i { right: 5px; bottom: 12px; }
  .trip-create-orbit b { bottom: 6px; left: 10px; }
}

/* Travel Mode Interactive Pills */
.travel-mode-pills {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.mode-pill {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid #cbd5e1;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mode-pill:hover {
  background: #ffffff;
  border-color: #0f766e;
  color: #0f766e;
  transform: translateY(-1px);
}

.mode-pill.active {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.25);
}

/* Search Form */
.hero-search-form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.09), 0 0 0 1px rgba(15, 23, 42, 0.02);
  border-radius: 999px;
  padding: 6px 8px 6px 24px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-input-wrapper:focus-within {
  border-color: #0f766e;
  box-shadow: 0 24px 56px -12px rgba(15, 118, 110, 0.22), 0 0 0 4px rgba(15, 118, 110, 0.15);
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 16px;
  color: #0f172a;
  padding: 12px 0;
  font-weight: 500;
}

.hero-search-input::placeholder {
  color: #64748b;
  font-weight: 400;
}

.hero-search-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  color: white;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(15, 118, 110, 0.3);
}

.hero-search-button:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.4);
}

/* Infinite Scrolling Inspiration Marquee (24 Items Pixel-Perfect Loop) */
.hero-marquee-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
  margin-top: 32px;
  overflow: hidden;
  padding: 10px 0;
  mask-image: linear-gradient(to right, transparent 0%, black 80px, black calc(100% - 80px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 80px, black calc(100% - 80px), transparent 100%);
  contain: inline-size;
}

.hero-marquee-track {
  display: flex;
  gap: 14px;
  width: max-content;
  animation: marqueeScroll 45s linear infinite;
  will-change: transform;
}

.hero-marquee-wrapper:hover .hero-marquee-track {
  animation-play-state: paused;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.hero-marquee-item {
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  color: #334155;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-marquee-item:hover {
  background: #0f766e;
  color: #ffffff;
  border-color: #0f766e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.28);
}

/* Copilot Chat UI Upgrade */
.chat-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  padding: 5px 6px 5px 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-box:focus-within {
  border-color: #0f766e;
  box-shadow: 0 12px 32px rgba(15, 118, 110, 0.18), 0 0 0 3px rgba(15, 118, 110, 0.12);
}

@keyframes handoff-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
  30% { box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.25); }
  60% { box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); }
}
.chat-box input.handoff-pulse,
.hero-search-input.handoff-pulse,
#heroSearchInput.handoff-pulse {
  animation: handoff-pulse 0.8s ease-out;
}

.chat-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14.5px;
  color: #0f172a;
  padding: 8px 0;
  font-weight: 500;
}

.chat-box button.primary-button {
  height: 38px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
  transition: all 0.2s ease;
}

.chat-box button.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.35);
}

.dashboard-recent {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.dashboard-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.025em;
}

.recent-trips-container {
  display: grid;
  gap: 16px;
}

.dashboard-trip-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: 0 10px 30px -8px rgba(15, 23, 42, 0.05), 0 0 0 1px rgba(15, 23, 42, 0.02);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.dashboard-trip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(15, 118, 110, 0.4);
  box-shadow: 0 18px 40px -10px rgba(15, 118, 110, 0.15), 0 0 0 1px rgba(15, 118, 110, 0.15);
}

.dashboard-trip-link {
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.dashboard-trip-link h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  transition: color 0.2s ease;
}

.dashboard-trip-card:hover .dashboard-trip-link h3 {
  color: #0f766e;
}

.dashboard-trip-link p {
  margin: 0;
  font-size: 13.5px;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.dashboard-trip-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.dashboard-trip-action {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
  box-shadow: 0 4px 12px rgba(15, 118, 110, 0.25);
  transition: all 0.2s ease;
}

.dashboard-trip-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.35);
}

.dashboard-delete-button {
  border: none;
  background: transparent;
  color: #94a3b8;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dashboard-delete-button:hover {
  background: #fff1f2;
  color: #e11d48;
}

.dashboard-more-button {
  justify-self: center;
  padding: 10px 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(203, 213, 225, 0.8);
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.dashboard-more-button:hover {
  background: #ffffff;
  color: #0d9488;
  border-color: rgba(13, 148, 136, 0.3);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.1);
}

.dashboard-more-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.dashboard-more-button:hover {
  color: var(--teal);
}

@media (max-width: 640px) {
  .dashboard-page,
  .dashboard-body {
    max-width: 100%;
    overflow-x: clip;
  }

  .dashboard-brand-copy {
    gap: 0 !important;
  }

  .dashboard-brand-tagline {
    display: none !important;
  }

  .dashboard-main {
    padding: 40px 16px;
    gap: 44px;
  }

  .hero-greeting {
    font-size: 28px;
  }

  .dashboard-trip-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-trip-link p {
    flex-wrap: wrap;
    gap: 4px 8px;
  }
}

/* --------------------------------------
   Login Split Layout (Phase 2)
-------------------------------------- */
.login-body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
}

.login-split-layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  overflow: hidden;
}

.login-hero-side {
  flex: 5;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 60px;
}

.login-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 60%);
  display: flex;
  align-items: flex-end;
  padding: 60px;
}

.login-hero-text {
  color: white;
  z-index: 2;
  animation: fadeInUp 1s ease-out;
}

.login-hero-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 12px;
  text-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.login-hero-subtitle {
  font-size: 20px;
  opacity: 0.9;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.login-panel-side {
  flex: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  box-shadow: -10px 0 30px rgba(0,0,0,0.05);
  z-index: 10;
  min-height: 0;
  overflow-y: auto;
}

.login-panel-content {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box;
}

.login-brand {
  margin-bottom: 40px;
  font-size: 24px;
}

.login-brand .brand-mark {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.auth-field-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-input-minimal {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 16px;
  transition: all 0.2s ease;
}

.auth-input-minimal:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(8, 124, 114, 0.1);
}

.login-submit {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
  border-radius: 12px;
  margin-top: 12px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .login-body {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .login-split-layout {
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
  }
  .login-hero-side {
    flex: 0 0 auto;
    min-height: 120px;
    max-height: 180px;
    padding: 24px 20px;
  }
  .login-hero-overlay {
    padding: 24px 20px;
  }
  .login-hero-title {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .login-hero-subtitle {
    font-size: 13px;
  }
  .login-panel-side {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 24px 24px 0 0;
    margin-top: -20px;
    align-items: flex-start;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
  .login-panel-content {
    padding: 24px 20px max(28px, calc(16px + env(safe-area-inset-bottom)));
    margin: 0 auto;
  }
  .login-brand {
    margin-bottom: 20px;
  }
}

/* --------------------------------------
   AI Memory Layout (Phase 3)
-------------------------------------- */
.memory-shell {
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
}

.memory-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 20px;
}

.memory-head {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeInUp 0.6s ease-out;
}

.memory-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.memory-icon {
  font-size: 36px;
}

.memory-head h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
}

.memory-subtitle {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  animation: fadeInUp 0.8s ease-out;
}

.memory-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.9);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.memory-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(8, 124, 114, 0.08);
  border-color: rgba(8, 124, 114, 0.2);
}

.memory-card-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.memory-tag-icon {
  font-size: 20px;
}

.memory-tag-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.memory-delete-btn {
  background: none;
  border: none;
  color: #caced1;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s ease;
}

.memory-delete-btn:hover {
  color: #ff6b6b;
}

.memory-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
 * 详情小卡片：核实状态区 + AI 导游区 + AI 完善区（轮 3）
 * ------------------------------------------------------------------------- */

/* 核实状态区：按钮即动作，状态落在卡片上 */
.detail-verify-section {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #e5e2dc);
  background: #fafaf7;
}
.verify-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.verify-actions .detail-verify,
.verify-actions .detail-confirm {
  min-height: 36px;
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
}
.verify-state {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  display: grid;
  gap: 4px;
}
.verify-state strong {
  font-size: 13px;
}
.verify-state.is-verifying {
  background: #f3f1ec;
  color: var(--muted, #6f6b63);
  display: flex;
  align-items: center;
  gap: 8px;
}
.verify-state.is-difference {
  background: #fdf3e7;
  border: 1px solid #f0d9b8;
  color: #7a4f12;
}
.verify-state.is-settled {
  background: #eef7f0;
  border: 1px solid #cfe5d4;
  color: #235a33;
}
.verify-state .verify-source {
  color: inherit;
  opacity: 0.75;
}
.verify-state .verify-source a {
  color: inherit;
}
.verify-adopt {
  justify-self: start;
  margin-top: 4px;
  padding: 5px 12px;
  border: 1px solid #d8a64e;
  border-radius: 8px;
  background: #fff;
  color: #8a5a10;
  cursor: pointer;
  font-size: 12px;
}
.verify-adopt:hover {
  background: #fdf3e7;
}
.verify-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(111, 107, 99, 0.25);
  border-top-color: #6f6b63;
  border-radius: 50%;
  animation: verify-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes verify-spin {
  to { transform: rotate(360deg); }
}

/* AI 导游区（景点卡片） */
.detail-guide-section {
  flex-shrink: 0;
  padding: 12px 16px;
  border-top: 1px solid var(--line, #e5e2dc);
  background: #f4f8f7;
}
.guide-intro {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink, #23201b);
}
.guide-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.guide-btn {
  padding: 5px 12px;
  border: 1px solid var(--line, #e5e2dc);
  border-radius: 8px;
  background: #fff;
  color: var(--ink, #23201b);
  font-size: 12px;
  cursor: pointer;
}
.guide-btn:hover {
  border-color: #b8ddd8;
  color: #1f6f64;
}
.guide-extra {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.guide-block {
  display: grid;
  gap: 3px;
  font-size: 12px;
  color: var(--muted, #6f6b63);
}
.guide-block strong {
  color: var(--ink, #23201b);
  font-size: 12px;
}
.guide-narration {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink, #23201b);
}
.guide-narration p {
  margin: 0;
}
.guide-empty {
  color: var(--muted, #6f6b63);
}

.guide-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted, #6f6b63);
  margin-bottom: 6px;
}

.detail-voice-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 4px;
  margin-top: 8px;
  border-top: 1px solid var(--line, rgba(0,0,0,0.06));
}
.detail-voice-play {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--teal, #2563eb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.detail-voice-play:hover {
  background: var(--teal-dark, #1d4ed8);
}
.detail-voice-play svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.detail-voice-progress-wrap {
  flex: 1;
  cursor: pointer;
  padding: 8px 0;
}
.detail-voice-progress-track {
  height: 4px;
  border-radius: 2px;
  background: var(--line, rgba(0,0,0,0.1));
  position: relative;
  overflow: hidden;
}
.detail-voice-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--teal, #2563eb);
  width: 0%;
  transition: width 0.15s linear;
}
.detail-voice-time {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--muted);
  min-width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.evidence-collapsed-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 0;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.evidence-collapsed-summary:hover {
  color: var(--text, var(--ink));
}
.evidence-collapsed-summary .toggle-icon {
  margin-left: auto;
  transition: transform 0.2s;
}
.evidence-expanded[hidden] { display: none; }
.evidence-expanded .evidence-group-heading {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 16px 0 8px;
}
.evidence-link-group-label {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 4px;
}
.evidence-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: inherit;
  text-decoration: none;
}
.evidence-link-row:hover {
  color: var(--text, var(--ink));
}
.evidence-link-row img {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}
.evidence-link-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-muted, #f0f0f0);
  color: var(--muted);
}
.evidence-tip-list,
.evidence-note-list {
  margin: 0;
  padding-left: 18px;
}
.evidence-tip-item,
.evidence-note-item {
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 6px;
}

/* Plan D：degraded 兜底回复的柔和提示，不渲染为错误卡片 */
.message.assistant.is-degraded {
  border-left: 3px solid #d8a64e;
}
.message.assistant.is-degraded::after {
  content: "⚠ 服务压力较大，本次回复为兜底内容";
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #a97d2f;
}

/* 路线板块：清单里交通行单独成节 */
.route-board {
  margin: 4px 14px 12px;
  border: 1px solid #d8e4e0;
  border-left: 3px solid #1f6f64;
  border-radius: 10px;
  overflow: hidden;
  background: #fbfdfc;
}
.route-board-head {
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1f6f64;
  background: #eef5f3;
}
.route-board .itinerary-table tr[data-title] {
  cursor: pointer;
}
.route-board .itinerary-table tr[data-title]:hover {
  background: #eef5f3;
}

/* P0 Ground Truth: Map Natural Language Search Bar */
.map-canvas {
  position: relative;
}

.map-search-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1000;
  width: 320px;
  max-width: calc(100% - 28px);
  background: #ffffff;
  border: 1px solid var(--line, #e2dacd);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
  font-family: inherit;
}

.map-search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.map-search-icon {
  color: var(--muted, #8c8273);
  flex-shrink: 0;
}

#mapPlaceSearchInput {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--ink, #23201b);
  outline: none;
  padding: 0;
}

#mapPlaceSearchInput::placeholder {
  color: var(--muted, #a89f91);
}

.map-search-clear {
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: var(--muted, #8c8273);
  cursor: pointer;
  padding: 0 4px;
}

.map-search-results {
  border-top: 1px solid var(--line, #e2dacd);
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

.map-search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f2ece4;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 0.16s ease;
}

.map-search-item:last-child {
  border-bottom: none;
}

.map-search-item:hover {
  background: #f7f3ec;
}

.map-search-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.map-search-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink, #23201b);
}

.map-search-item-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

.map-search-item-badge.candidate {
  background: #fff3e0;
  color: #e65100;
}

.map-search-item-desc {
  font-size: 11px;
  color: var(--muted, #8c8273);
}

/* Candidate marker style */
.marker-unverified-tag {
  position: absolute;
  top: -8px;
  right: -6px;
  background: #f57c00;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

.marker-unverified-tag.approximate {
  background: #ad6b22;
}

.map-tooltip-unverified {
  max-width: 190px;
}

.map-tooltip-unverified {
  display: inline-block;
  margin-top: 4px;
  color: #e65100;
  font-weight: 600;
  font-size: 11px;
}

.preview-map-marker {
  animation: markerPulse 1.5s infinite alternate;
}

@keyframes markerPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

/* Card Research Rich Enrichment Sections */
.card-synthesis-block,
.card-practical-tips-block,
.card-review-summary-block,
.card-guides-block,
.card-limitations-block,
.card-sources-evaluated-block {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fafaf8;
  border: 1px solid var(--line, #e2ded4);
}

.card-synthesis-heading,
.card-tips-heading,
.card-review-heading,
.card-guides-heading,
.card-limitations-heading,
.card-sources-evaluated-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #23201b);
}

.card-synthesis-heading small,
.card-tips-heading small,
.card-review-heading small,
.card-guides-heading small,
.card-sources-evaluated-heading small {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted, #8c8273);
}

.card-synthesis-text,
.card-estimate-summary-text,
.card-review-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #333;
}

.card-tips-list,
.card-limitations-list {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
}

.card-tips-list li + li,
.card-limitations-list li + li {
  margin-top: 4px;
}

.card-guide-item {
  padding: 6px 8px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #eee;
  margin-bottom: 6px;
}

.card-guide-item:last-child {
  margin-bottom: 0;
}

.card-guide-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
}

.card-guide-quote {
  margin: 4px 0;
  font-size: 11px;
  color: #555;
  font-style: italic;
}

.card-guide-footer {
  text-align: right;
}

.guide-source-link,
.source-eval-link {
  font-size: 11px;
  color: var(--teal-dark, #006666);
  text-decoration: none;
  font-weight: 600;
}

.guide-source-link:hover,
.source-eval-link:hover {
  text-decoration: underline;
}

.card-sources-evaluated-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-source-eval-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}

.badge-source-official {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-source-guide {
  background: #e3f2fd;
  color: #1565c0;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-entity-match {
  background: #e8f5e9;
  color: #2e7d32;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
}

.badge-entity-mismatch {
  background: #ffebee;
  color: #c62828;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
}

.card-estimates-details {
  margin-top: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
  color: #475569;
}

.card-estimates-summary {
  cursor: pointer;
  font-weight: 500;
  color: #0284c7;
}

.card-estimates-rationales {
  margin: 6px 0 0;
  padding-left: 18px;
  line-height: 1.5;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #0f172a);
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.lang-switch-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* ============================================================================
   P5.10.4.6 Conversation-first Workspace Shell
   ============================================================================ */

.workspace-page,
.workspace-body {
  height: 100vh;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.workspace-shell-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.workspace-header {
  flex-shrink: 0;
  height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #334155;
  cursor: pointer;
  padding: 0;
}

.mobile-sidebar-toggle:hover {
  background: #f1f5f9;
}

.mobile-segmented-control {
  display: none;
  background: #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.segmented-tab {
  border: none;
  background: transparent;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.segmented-tab.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.workspace-layout {
  flex: 1;
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
  background: #f8fafc;
  width: 100%;
}

/* --- 1. Left Sidebar: History --- */
.workspace-sidebar {
  width: 250px;
  min-width: 250px;
  max-width: 250px;
  height: 100%;
  border-right: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: static;
  z-index: 50;
  box-sizing: border-box;
}

.sidebar-header {
  padding: 14px 14px 8px;
  flex-shrink: 0;
}

.sidebar-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--teal-dark, #0f766e);
  font-weight: 700;
  font-size: 13px;
  transition: all 0.16s ease;
  cursor: pointer;
}

.sidebar-new-btn:hover {
  background: #f0fdfa;
  border-color: #99f6e4;
  color: #0d9488;
}

.sidebar-new-icon {
  font-size: 16px;
  font-weight: 800;
}

.sidebar-section-title {
  padding: 6px 14px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.sidebar-conversation-list,
.workspace-sidebar .sidebar-conversation-list,
.workspace-sidebar .brainstorm-sessions-dropdown {
  position: static !important;
  right: auto !important;
  top: auto !important;
  left: auto !important;
  bottom: auto !important;
  z-index: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  max-height: none !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-sizing: border-box;
  margin: 0 !important;
}

.sidebar-session-item,
.workspace-sidebar .sidebar-session-item,
.workspace-sidebar .brainstorm-session-item {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
  border: 1px solid transparent;
  position: relative;
  background: transparent;
}

.sidebar-session-item:hover,
.workspace-sidebar .sidebar-session-item:hover,
.workspace-sidebar .brainstorm-session-item:hover {
  background: #f1f5f9;
}

.sidebar-session-item.active,
.workspace-sidebar .sidebar-session-item.active,
.workspace-sidebar .brainstorm-session-item.active {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.sidebar-session-item.active .session-title,
.workspace-sidebar .sidebar-session-item.active .session-title,
.workspace-sidebar .brainstorm-session-item.active .brainstorm-session-restore {
  color: #15803d;
  font-weight: 700;
}

.session-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
}

.session-title {
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.session-actions {
  display: none;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

.sidebar-session-item:hover .session-actions,
.sidebar-session-item.active .session-actions,
.brainstorm-session-item:hover .session-actions,
.brainstorm-session-item.active .session-actions {
  display: flex;
}

.session-action-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}

.session-action-btn:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.session-action-btn--delete:hover {
  color: #dc2626;
  background: #fee2e2;
}

.session-meta {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-empty-hint {
  padding: 18px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

/* --- 2. Middle Column: Conversation --- */
.workspace-conversation {
  width: 440px;
  min-width: 360px;
  max-width: 480px;
  height: 100%;
  border-right: 1px solid var(--line);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.conversation-pane-header {
  height: 48px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #fafafa;
  flex-shrink: 0;
}

.conversation-title-area {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.conversation-workspace-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-rename-trigger {
  border: none;
  background: none;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.conversation-rename-trigger:hover {
  color: #0f172a;
  background: #e2e8f0;
}

.conversation-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conversation-clear-action {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
}

.conversation-clear-action:hover {
  color: #dc2626;
  background: #fee2e2;
}

.conversation-chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation-welcome-hero {
  padding: 12px 4px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.conversation-welcome-hero .hero-greeting {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  margin: 10px 0 6px;
}

.conversation-welcome-hero .hero-subtext {
  font-size: 13px;
  color: #475569;
  margin: 0 0 16px;
}

.conversation-welcome-hero .travel-mode-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.conversation-welcome-hero .hero-marquee-wrapper {
  max-width: 100%;
  overflow: hidden;
}

/* P5.10.4.7 J: warm star-orbit hero — pure CSS decoration behind the welcome
   copy (two counter-rotating rings, twinkling stars, amber core). It is
   aria-hidden, never intercepts clicks, and pauses while the tab is hidden
   or the user prefers reduced motion. */
.conversation-welcome-hero {
  position: relative;
  overflow: hidden;
}

.hero-star-orbit {
  position: absolute;
  top: -12px;
  right: 2%;
  width: 176px;
  height: 176px;
  z-index: 0;
  pointer-events: none;
}

.conversation-welcome-hero > * {
  position: relative;
  z-index: 1;
}

.hero-star-orbit .star-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.hero-star-orbit .ring-a {
  border: 1px dashed rgba(15, 118, 110, 0.35);
  animation: starOrbitSpin 26s linear infinite;
}

.hero-star-orbit .ring-b {
  inset: 26px;
  border: 1px dotted rgba(194, 65, 12, 0.32);
  animation: starOrbitSpin 15s linear infinite reverse;
}

.hero-star-orbit .star-orbit-core {
  position: absolute;
  inset: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fbbf24 0%, #f59e0b 45%, rgba(245, 158, 11, 0.25) 70%, transparent 100%);
  box-shadow: 0 0 18px 4px rgba(245, 158, 11, 0.32);
}

.hero-star-orbit .star-orbit-star {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: starTwinkle 3.2s ease-in-out infinite;
}

.hero-star-orbit .s1 { top: 23px; left: 147px; background: #f59e0b; animation-delay: 0s; }
.hero-star-orbit .s2 { top: 147px; left: 23px; background: #c2410c; animation-delay: 0.5s; }
.hero-star-orbit .s3 { top: 147px; left: 147px; background: #0f766e; animation-delay: 1s; }
.hero-star-orbit .s4 { top: 41px; left: 129px; background: #c2410c; animation-delay: 1.5s; }
.hero-star-orbit .s5 { top: 129px; left: 41px; background: #f59e0b; animation-delay: 2s; }
.hero-star-orbit .s6 { top: 129px; left: 129px; background: #0f766e; animation-delay: 2.5s; }

@keyframes starOrbitSpin {
  to { transform: rotate(360deg); }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Background tabs must not keep burning compositor time. */
body.tab-hidden .hero-star-orbit .star-orbit-ring,
body.tab-hidden .hero-star-orbit .star-orbit-star,
body.tab-hidden .hero-star-orbit .star-orbit-core,
body.tab-hidden .hero-marquee-track {
  animation-play-state: paused;
}

/* Honor prefers-reduced-motion: collapse all animation/transition time. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Small screens: shrink the orbit so it never causes horizontal overflow. */
@media (max-width: 720px) {
  .hero-star-orbit {
    transform: scale(0.55);
    top: -6px;
    right: -8px;
  }
}

.brainstorm-chat-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.conversation-input-box {
  padding: 12px 16px;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
  flex-shrink: 0;
}

.conversation-input-box .hero-search-form {
  margin: 0;
  max-width: 100%;
}

/* §6: ONE singleton Create status component, placed coherently above the
   conversation composer — never appended into the persisted chat feed. The
   single client controller owns this host and renders every machine state
   here (running / pause_requested / paused / error / success). */
.create-operation-host[hidden],
.create-composer-hint[hidden] {
  display: none;
}

.create-operation-host {
  width: 100%;
}

.create-operation-host .trip-create-progress {
  width: 100%;
  margin: 0 0 12px;
}

/* pause_requested is transitional: amber pending ring, never a false
   "paused" claim. */
.trip-create-progress--pause-requested .trip-create-orbit::before {
  background: #b45309;
  box-shadow: 0 0 0 8px rgba(180, 83, 9, 0.12);
  animation: tripCreatePulse 1.1s ease-in-out infinite;
}

/* §4: while Create is active the composer is visibly non-submittable. */
.create-composer-hint {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}

.conversation-input-box .hero-search-input:disabled {
  background: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
  box-shadow: none;
}

.conversation-input-box .hero-search-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- 3. Right Column: Trip Canvas --- */
.workspace-canvas {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.canvas-empty-state {
  height: 100%;
  overflow-y: auto;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.canvas-empty-state[hidden],
.canvas-trip-content[hidden] {
  display: none !important;
}

.canvas-empty-hero {
  text-align: center;
  margin-bottom: 24px;
  max-width: 520px;
}

.canvas-empty-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.canvas-empty-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 8px;
}

.canvas-empty-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

.canvas-empty-state .trip-summary-panel {
  width: 100%;
  max-width: 640px;
}

.canvas-trip-content {
  height: 100%;
  width: 100% !important;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.canvas-trip-content .view-panel {
  height: 100%;
  width: 100% !important;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.canvas-trip-content .trip-content {
  flex: 1;
  width: 100% !important;
  min-width: 0;
  display: flex;
  overflow: hidden;
  position: relative;
}

.canvas-trip-content .trip-panel {
  display: none !important;
  width: 100% !important;
  min-width: 0;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

.canvas-trip-content .trip-panel.active:not([hidden]) {
  display: flex !important;
  flex-direction: column;
}

.canvas-trip-content .trip-panel[hidden] {
  display: none !important;
}

.canvas-trip-content .map-canvas {
  flex: 1;
  width: 100% !important;
  min-width: 0;
  position: relative;
  height: 100%;
  min-height: 280px;
}

.canvas-trip-content .real-map {
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  flex: 1;
}

.canvas-trip-content .manifest-panel {
  overflow-y: auto;
}

/* --- Responsive & Mobile (390px) Rules --- */
@media (max-width: 960px) {
  .workspace-header {
    height: 52px;
    padding: 0 8px;
    gap: 6px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .header-left-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #ffffff;
    color: #334155;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  .brand-mark {
    width: 28px;
    height: 28px;
    line-height: 28px;
    font-size: 13px;
    flex-shrink: 0;
  }

  .dashboard-brand-copy {
    display: none !important;
  }

  .dashboard-brand-tagline {
    display: none !important;
  }

  .mobile-segmented-control {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
    margin: 0 auto;
  }

  .segmented-tab {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.16s ease;
    white-space: nowrap;
  }

  .header-nav,
  .workspace-header .header-nav {
    width: auto !important;
    max-width: auto;
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    margin-left: 0 !important;
  }

  .header-menu-lang {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
  }

  .readonly-share-page .header-menu-lang {
    display: flex !important;
    align-items: center;
  }

  .lang-switch-btn {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .header-menu-auth {
    display: none !important;
  }

  .trip-view-page .header-menu-auth {
    display: flex !important;
    align-items: center;
    flex-shrink: 0;
  }

  .trip-view-page .header-menu-auth .header-menu-trigger {
    min-width: 44px;
    min-height: 44px;
  }

  .header-menu-mine {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: auto !important;
  }

  .header-menu-mine .header-menu-trigger {
    min-width: 44px;
    min-height: 44px;
  }

  .header-menu.is-open .header-menu-panel,
  .header-menu.is-open .header-menu-panel-mine {
    display: block !important;
  }

  .workspace-layout {
    flex-direction: column;
    height: calc(100vh - 52px);
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .workspace-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 80vw;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.15);
    background: #ffffff !important;
    display: flex;
    flex-direction: column;
  }

  .workspace-sidebar.drawer-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: block;
  }

  .sidebar-backdrop[hidden] {
    display: none !important;
  }

  .workspace-conversation,
  .workspace-canvas {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1;
    border-right: none;
  }

  /* Body toggle for mobile views */
  body.mobile-view--conversation .workspace-conversation {
    display: flex;
  }

  body.mobile-view--conversation .workspace-canvas {
    display: none !important;
  }

  body.mobile-view--canvas .workspace-conversation {
    display: none !important;
  }

  body.mobile-view--canvas .workspace-canvas {
    display: flex;
  }

  .conversation-input-box {
    position: sticky;
    bottom: 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 20;
    background: #ffffff;
  }
}

@media (min-width: 961px) {
  .mobile-sidebar-toggle,
  .mobile-segmented-control,
  .sidebar-backdrop {
    display: none !important;
  }

  .workspace-sidebar {
    transform: none !important;
    position: static !important;
  }

  body.mobile-view--conversation .workspace-conversation,
  body.mobile-view--conversation .workspace-canvas,
  body.mobile-view--canvas .workspace-conversation,
  body.mobile-view--canvas .workspace-canvas {
    display: flex !important;
  }
}

/* P5.10.4.7 K: boot recovery card — the only hard-stop surface. Rendered for
   release/build mismatch and unrecoverable boot failures. Deliberately NOT an
   Assistant message and never inside a chat feed. */
.boot-recovery-card {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 248, 246, 0.92);
  backdrop-filter: blur(4px);
}

.boot-recovery-inner {
  width: min(400px, calc(100vw - 48px));
  padding: 28px 26px;
  border-radius: 16px;
  border: 1px solid #fcd34d;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  text-align: center;
}

.boot-recovery-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fffbeb;
  color: #b45309;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 12px;
}

.boot-recovery-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.boot-recovery-detail {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: #475569;
}

.boot-recovery-action {
  min-height: 44px;
  padding: 0 26px;
  border: none;
  border-radius: 10px;
  background: #0f766e;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.boot-recovery-action:hover {
  background: #115e59;
}

/* --------------------------------------
   Two-region Workspace + spacious Home
-------------------------------------- */
body.home-body .app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% -15%, rgba(15, 118, 110, 0.15) 0%, transparent 65%),
              radial-gradient(circle at 85% 85%, rgba(99, 102, 241, 0.08) 0%, transparent 55%),
              radial-gradient(circle at 10% 40%, rgba(20, 184, 166, 0.08) 0%, transparent 50%),
              #eaeceb;
}

body.surface-home .workspace-surface,
body.surface-home .mobile-segmented-control,
body.surface-home #workspaceHomeButton {
  display: none !important;
}

body.surface-workspace .home-surface {
  display: none !important;
}

body.surface-workspace .app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
}

body.surface-workspace .workspace-surface {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

body.surface-workspace #workspaceHomeButton {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 8px;
  min-height: 36px;
  padding: 0 10px 0 6px;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  background: #fff;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

body.surface-workspace #workspaceHomeButton:hover {
  border-color: #7dd3fc;
  color: #0284c7;
  background: #f0f9ff;
}

.home-composer-slot,
.workspace-composer-slot {
  width: 100%;
}

.home-composer-slot .hero-search-form {
  width: min(720px, 100%);
  margin: 0 auto 28px;
}

.workspace-layout {
  --workspace-conversation-pct: 62%;
  display: flex;
  flex: 1;
  min-height: 0;
  height: calc(100vh - 56px);
  overflow: hidden;
  background: #f8fafc;
  width: 100%;
  position: relative;
}

body.workspace-context--trip .workspace-layout {
  --workspace-conversation-pct: 29%;
}

.workspace-conversation {
  flex: 0 0 var(--workspace-conversation-pct);
  width: auto;
  min-width: 280px;
  max-width: 80%;
  height: 100%;
}

.workspace-canvas {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
}

.workspace-splitter {
  flex: 0 0 10px;
  width: 10px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 4;
}

.workspace-splitter-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: #cbd5e1;
}

.workspace-splitter:hover .workspace-splitter-grip,
body.workspace-splitting .workspace-splitter-grip {
  background: #0f766e;
}

body.workspace-splitting {
  cursor: col-resize;
  user-select: none;
}

@media (max-width: 960px) {
  .workspace-splitter {
    display: none !important;
  }

  body.surface-workspace .workspace-layout {
    display: block;
    height: calc(100vh - 56px);
  }

  body.surface-workspace .workspace-conversation,
  body.surface-workspace .workspace-canvas {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 100%;
  }

  body.surface-workspace.mobile-view--conversation .workspace-canvas {
    display: none;
  }

  body.surface-workspace.mobile-view--canvas .workspace-conversation {
    display: none;
  }

  body.surface-home .mobile-segmented-control {
    display: none !important;
  }
}

/* Shared Trip presentation: enrichment, evidence, Card Research, Card Chat extras.
   Consumed by Workspace (#workspaceCanvas.trip-presentation-surface) and the
   legacy private Trip page (body.trip-presentation-surface). Do not attach
   .trip-view-page to the Home/Workspace shell. */
.trip-presentation-surface .enrich-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: 1px;
  background: #f1f5f9;
  color: #475569;
}

.trip-presentation-surface .enrich-queued { background: #f1f5f9; color: #64748b; }
.trip-presentation-surface .enrich-running { background: #e0f2fe; color: #0369a1; }
.trip-presentation-surface .enrich-running::before { content: "⟳ "; }
.trip-presentation-surface .enrich-enriched { background: #dcfce7; color: #15803d; }
.trip-presentation-surface .enrich-partial { background: #fef9c3; color: #a16207; }
.trip-presentation-surface .enrich-conflict { background: #fee2e2; color: #b91c1c; }
.trip-presentation-surface .enrich-blocked { background: #f3e8ff; color: #7e22ce; }
.trip-presentation-surface .enrich-failed { background: #fee2e2; color: #b91c1c; }
.trip-presentation-surface .enrich-cancelled { background: #f1f5f9; color: #64748b; }
.trip-presentation-surface .enrich-stale { background: #f1f5f9; color: #64748b; }

.trip-presentation-surface .enrichment-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px 10px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 13px;
  color: #334155;
}

.trip-presentation-surface .enrichment-overview.is-active {
  border-color: #bfdbfe;
  background: #eff6ff;
}

.trip-presentation-surface .enrichment-overview-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trip-presentation-surface .enrichment-overview-title {
  font-weight: 700;
  color: #0f172a;
}

.trip-presentation-surface .enrichment-overview-current {
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-presentation-surface .enrichment-activity-toggle {
  flex: none;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.trip-presentation-surface .enrichment-activity-toggle:hover { background: #f1f5f9; }

.trip-presentation-surface .enrichment-overview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.trip-presentation-surface .enrichment-control-toggle {
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  min-height: 34px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.trip-presentation-surface .enrichment-control-toggle:hover { background: #f8fafc; }
.trip-presentation-surface .enrichment-control-toggle[data-state="paused"] {
  border-color: #0f766e;
  color: #0f766e;
}
.trip-presentation-surface .enrichment-control-toggle:disabled {
  cursor: wait;
  opacity: 0.6;
}

.trip-presentation-surface .enrichment-activity {
  position: absolute;
  right: 14px;
  top: 74px;
  z-index: 800;
  width: min(360px, calc(100% - 28px));
  max-height: 60vh;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  font-size: 13px;
}

.trip-presentation-surface .enrichment-activity-head {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.trip-presentation-surface .enrichment-activity-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: #64748b;
}

.trip-presentation-surface .enrichment-activity-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.trip-presentation-surface .enrichment-activity-list li {
  display: flex;
  gap: 8px;
  padding: 5px 14px;
  color: #475569;
  line-height: 1.5;
}

.trip-presentation-surface .enrichment-activity-list li .activity-time {
  flex: none;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.trip-presentation-surface .enrichment-activity-empty {
  padding: 14px;
  color: #94a3b8;
  text-align: center;
}

.trip-presentation-surface .detail-evidence-section {
  border-top: 1px solid #eef2f7;
  padding: 18px;
  background: linear-gradient(180deg, #fbfefd 0%, #fff 100%);
}

.trip-presentation-surface .card-research-panel {
  --card-accent: #0f9488;
  --card-soft: #f0fdfa;
  --card-border: #ccfbf1;
}

.trip-presentation-surface .card-research-transport {
  --card-accent: #2563eb;
  --card-soft: #eff6ff;
  --card-border: #bfdbfe;
}

.trip-presentation-surface .card-research-lodging {
  --card-accent: #b45309;
  --card-soft: #fffbeb;
  --card-border: #fde68a;
}

.trip-presentation-surface .detail-evidence-section h4 {
  margin: 3px 0 0;
  font-size: 15px;
  color: #0f172a;
}

.trip-presentation-surface .card-research-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.trip-presentation-surface .card-research-eyebrow {
  color: var(--card-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.trip-presentation-surface .card-research-updated {
  flex: none;
  color: #94a3b8;
  font-size: 11px;
}

.trip-presentation-surface .evidence-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  flex-wrap: wrap;
}

.trip-presentation-surface .evidence-field-row {
  display: flex;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}

.trip-presentation-surface .evidence-field-label {
  flex: none;
  color: #94a3b8;
  min-width: 5.5em;
}

.trip-presentation-surface .evidence-source-line {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
  line-height: 1.6;
}

.trip-presentation-surface .evidence-missing { color: #94a3b8; }

.trip-presentation-surface .card-ai-intro {
  margin: 12px 0;
  padding: 13px 14px;
  border-radius: 12px;
  background: var(--card-soft);
  border: 1px solid var(--card-border);
}

.trip-presentation-surface .card-ai-intro-label {
  color: var(--card-accent);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 5px;
}

.trip-presentation-surface .card-ai-intro p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}

.trip-presentation-surface .card-ai-intro .card-canonical-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trip-presentation-surface .card-canonical-note span {
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.trip-presentation-surface .card-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}

.trip-presentation-surface .evidence-collapsed-summary {
  color: #64748b;
}
.trip-presentation-surface .evidence-collapsed-summary:hover {
  color: #0f172a;
}
.trip-presentation-surface .evidence-group-heading {
  color: #64748b;
}
.trip-presentation-surface .evidence-link-row {
  color: #334155;
}
.trip-presentation-surface .evidence-link-badge {
  background: #f1f5f9;
  color: #64748b;
}

.trip-presentation-surface .card-knowledge-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 16px;
}

.trip-presentation-surface .card-knowledge-strip .card-info-cell strong {
  white-space: normal;
}

.trip-presentation-surface .detail-gallery { margin: 0 0 16px; }

.trip-presentation-surface .card-info-cell {
  min-width: 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
}

.trip-presentation-surface .card-info-cell span,
.trip-presentation-surface .card-info-cell small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
}

.trip-presentation-surface .card-info-cell strong {
  display: block;
  overflow: hidden;
  margin: 3px 0;
  color: #0f172a;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-presentation-surface .card-booking-heading,
.trip-presentation-surface .card-search-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.trip-presentation-surface .card-booking-heading {
  margin: 5px 0 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.trip-presentation-surface .card-search-heading {
  margin: 12px 0 8px;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.trip-presentation-surface .card-booking-heading small,
.trip-presentation-surface .card-search-heading small {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
}

.trip-presentation-surface .card-booking-links,
.trip-presentation-surface .card-search-entries {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trip-presentation-surface .card-booking-link,
.trip-presentation-surface .card-search-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-decoration: none;
}

.trip-presentation-surface .card-booking-link {
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.trip-presentation-surface .card-booking-link:hover {
  border-color: var(--card-border);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--card-accent) 12%, transparent);
  transform: translateY(-1px);
}

.trip-presentation-surface .card-booking-link img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: contain;
  flex: none;
}

.trip-presentation-surface .card-booking-link-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.trip-presentation-surface .card-booking-link-copy strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-presentation-surface .card-booking-link-copy small {
  color: #94a3b8;
  font-size: 10px;
}

.trip-presentation-surface .card-booking-link-arrow {
  color: var(--card-accent);
  font-size: 16px;
}

.trip-presentation-surface .card-booking-empty {
  padding: 11px 12px;
  border-radius: 10px;
  color: #94a3b8;
  font-size: 12px;
  background: #f8fafc;
}

.trip-presentation-surface .card-search-link {
  padding: 8px 10px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #334155;
  background: #f8fafc;
  transition: all 0.15s;
}

.trip-presentation-surface .card-search-link:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  transform: translateY(-1px);
}

.trip-presentation-surface .card-search-icon {
  font-size: 14px;
  opacity: 0.7;
}

.trip-presentation-surface .badge-search-candidate,
.trip-presentation-surface .badge-platform-search,
.trip-presentation-surface .badge-official-info,
.trip-presentation-surface .badge-direct-booking {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
}

.trip-presentation-surface .badge-search-candidate {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.trip-presentation-surface .badge-platform-search {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.trip-presentation-surface .badge-official-info {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.trip-presentation-surface .badge-direct-booking {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.trip-presentation-surface .card-estimates-block {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fdfbf7;
  border: 1px solid #f0e6d2;
}

.trip-presentation-surface .card-estimates-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: #78350f;
  font-size: 12px;
  font-weight: 800;
}

.trip-presentation-surface .card-estimates-heading small {
  color: #a16207;
  font-size: 10px;
  font-weight: normal;
}

.trip-presentation-surface .card-estimate-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  margin: 4px 0;
  color: #451a03;
}

.trip-presentation-surface .estimate-field { color: #92400e; }
.trip-presentation-surface .estimate-value { font-weight: 700; color: #78350f; }
.trip-presentation-surface .badge-estimate {
  padding: 1px 4px;
  border-radius: 4px;
  font-size: 9px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}
.trip-presentation-surface .estimate-rationale {
  color: #b45309;
  font-size: 11px;
  margin-left: 2px;
}

.trip-presentation-surface .evidence-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.trip-presentation-surface .evidence-quick-action {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #334155;
  cursor: pointer;
}

.trip-presentation-surface .evidence-quick-action:hover { background: #f1f5f9; }

.trip-presentation-surface .card-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 4px;
}

.trip-presentation-surface .card-chat-suggestion {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 44px;
  font-size: 13px;
  color: #1d4ed8;
  cursor: pointer;
  touch-action: manipulation;
}

.trip-presentation-surface .card-chat-suggestion:hover { background: #dbeafe; }
.trip-presentation-surface .card-chat-loading { color: #94a3b8; font-size: 12px; padding: 6px 0; }
.trip-presentation-surface .card-chat-error { color: #b91c1c; font-size: 12px; padding: 6px 0; }

.trip-presentation-surface .card-chat-goto-main {
  display: inline-block;
  margin-top: 6px;
  border: none;
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}

@media (max-width: 960px) {
  .trip-presentation-surface .detail-drawer.open {
    position: fixed;
    inset: auto 0 0;
    z-index: 1200;
    width: 100%;
    height: min(88dvh, 760px, var(--itravel-visual-height, 100vh));
    max-height: calc(100dvh - env(safe-area-inset-top));
    border-right: 0;
    border-bottom: 0;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -20px 56px rgba(15, 23, 42, 0.22);
  }

  .trip-presentation-surface .detail-drawer.open .detail-head {
    position: relative;
    padding: 12px 14px;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .trip-presentation-surface .detail-drawer.open .detail-head,
  .trip-presentation-surface .detail-drawer.open .detail-head-main,
  .trip-presentation-surface .detail-drawer.open .detail-title-row,
  .trip-presentation-surface .detail-drawer.open .detail-title-row h3 {
    min-width: 0;
  }

  .trip-presentation-surface .detail-drawer.open .detail-title-row h3 {
    overflow-wrap: break-word;
  }

  .trip-presentation-surface .detail-drawer.open .detail-head::before {
    position: absolute;
    top: 6px;
    left: 50%;
    width: 42px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    content: "";
    transform: translateX(-50%);
  }

  .trip-presentation-surface .detail-drawer.open .detail-card-scroll {
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom);
    -webkit-overflow-scrolling: touch;
  }

  .trip-presentation-surface .detail-drawer.open .detail-main,
  .trip-presentation-surface .detail-drawer.open .detail-summary,
  .trip-presentation-surface .detail-drawer.open .detail-facts {
    min-width: 0;
  }

  .trip-presentation-surface .detail-drawer.detail-card-open .detail-main,
  .trip-presentation-surface .detail-drawer.detail-local .detail-main,
  .trip-presentation-surface .detail-drawer.detail-hotel .detail-main,
  .trip-presentation-surface .detail-drawer.detail-poi .detail-main,
  .trip-presentation-surface .detail-drawer.detail-meal .detail-main,
  .trip-presentation-surface .detail-drawer.detail-meal-signature .detail-main {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  .trip-presentation-surface .detail-drawer.open .detail-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
  }

  .trip-presentation-surface .enrichment-overview {
    margin-right: 0;
    margin-left: 0;
  }
}

@media (max-width: 680px) {
  .trip-presentation-surface .card-info-grid,
  .trip-presentation-surface .card-knowledge-strip,
  .trip-presentation-surface .card-booking-links,
  .trip-presentation-surface .card-search-entries,
  .detail-unified-facts .detail-facts {
    grid-template-columns: 1fr;
  }
  .detail-unified-facts .detail-fact-row:nth-child(odd) {
    border-right: none;
  }
  .detail-unified-facts .detail-fact-row:nth-last-child(2):nth-child(odd) {
    border-bottom: 1px solid var(--line, rgba(0,0,0,0.06));
  }
  .detail-unified-facts .detail-fact-row:last-child {
    border-bottom: none;
  }

  .trip-presentation-surface .card-booking-heading,
  .trip-presentation-surface .card-search-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }
}

@media (max-width: 600px) {
  .trip-presentation-surface .detail-drawer.open .detail-section,
  .trip-presentation-surface .detail-drawer.open .detail-evidence-section {
    padding-right: 12px;
    padding-left: 12px;
  }

  .trip-presentation-surface .detail-drawer.open .detail-actions,
  .trip-presentation-surface .detail-drawer.open .detail-links,
  .trip-presentation-surface .detail-drawer.open .card-booking-links,
  .trip-presentation-surface .detail-drawer.open .card-search-entries {
    grid-template-columns: minmax(0, 1fr);
  }

  .trip-presentation-surface .detail-drawer.open .detail-actions > *,
  .trip-presentation-surface .detail-drawer.open .detail-links > *,
  .trip-presentation-surface .detail-drawer.open .card-booking-link,
  .trip-presentation-surface .detail-drawer.open .card-search-link {
    min-height: 44px;
  }

  .trip-presentation-surface .detail-drawer.open .detail-card-scroll {
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

/* Mobile itinerary cards, card header, and toolbar — owner workspace,
   trip-view, and share reuse one layout. Permission CSS only hides private
   controls; do not maintain a second share-only schedule renderer. */
@media (max-width: 960px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
  }

  body.home-body .app-shell,
  body.home-body .home-surface,
  body.home-body .dashboard-main,
  body.home-body .dashboard-hero {
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .dashboard-hero::before {
    max-width: 100%;
  }

  .map-toolbar-primary {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .map-toolbar-primary .map-tabs {
    flex: 1 1 auto;
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .map-toolbar-primary .map-scope,
  .map-toolbar-primary .title-action {
    flex: 0 0 auto;
  }

  .map-toolbar-primary .title-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .map-toolbar-compact .map-hint,
  .map-route-sequence {
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .day-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .day-head > div,
  .day-head-copy,
  .day-head-copy h3,
  .day-side {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .day-head-copy h3 {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .table-wrap {
    overflow-x: hidden;
  }

  .itinerary-table,
  .itinerary-table tbody,
  .itinerary-table tbody tr,
  .itinerary-table td {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .itinerary-table thead {
    display: none;
  }

  .itinerary-table th:nth-child(n),
  .itinerary-table td:nth-child(n) {
    width: auto !important;
    min-width: 0 !important;
    max-width: none;
  }

  .itinerary-table tbody tr {
    display: grid !important;
    grid-template-columns: 4.2rem 2.6rem minmax(0, 1fr) 4.6rem;
    grid-template-areas:
      "time type plan budget"
      "time type meta meta";
    align-items: start;
    column-gap: 8px;
    row-gap: 4px;
    width: 100%;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 10px 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }

  .itinerary-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .itinerary-table td {
    display: block !important;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .itinerary-table .plan-cell {
    grid-area: plan;
    min-width: 0;
    width: auto !important;
    max-width: 100%;
  }

  .itinerary-table td::before {
    content: none;
    display: none;
  }

  .itinerary-table .time-cell {
    grid-area: time;
    align-self: center;
    white-space: nowrap;
    font-size: 12px;
  }

  .itinerary-table .type-cell {
    grid-area: type;
    align-self: center;
    text-align: center;
    width: 2.6rem;
    overflow: hidden;
  }

  .itinerary-table .table-photo-icon,
  .itinerary-table .type-icon {
    width: 34px;
    height: 34px;
  }

  .itinerary-table .plan-cell {
    grid-area: plan;
    min-width: 0;
  }

  .itinerary-table .plan-cell strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .itinerary-table .plan-cell span {
    display: none;
  }

  .itinerary-table .duration-cell {
    grid-area: meta;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }

  .itinerary-table .budget-cell {
    grid-area: budget;
    text-align: right;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .itinerary-table .budget-cell > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .itinerary-table .estimate-rationale,
  .itinerary-table .route-cell,
  .itinerary-table .booking-cell {
    display: none !important;
  }

  .detail-drawer.open .detail-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .detail-drawer.open .detail-head-main,
  .detail-drawer.open .detail-place-meta,
  .detail-drawer.open .detail-head-kicker {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .detail-drawer.open .detail-head-kicker {
    overflow-wrap: break-word;
    word-break: normal;
  }

  .detail-drawer.open .detail-title-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    gap: 8px;
  }

  .detail-drawer.open .detail-title-row h3 {
    width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
  }

  .detail-drawer.open .detail-head-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    width: 100%;
    gap: 8px;
  }

  .detail-drawer.open .detail-head-actions > * {
    flex: 0 0 auto;
  }
}

body.readonly-share .planner-layout,
.readonly-share-page .planner-layout {
  grid-template-columns: minmax(0, 1fr);
}

.readonly-share-page .map-hint .share-trip-title {
  flex: 0 1 auto;
  margin: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  max-width: min(100%, 28rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.readonly-share .chat-column,
body.readonly-share .mobile-ai-fab,
body.readonly-share .mobile-chat-backdrop,
body.readonly-share #tripShareButton,
body.readonly-share .rotate-calendar-sub-btn,
body.readonly-share .revoke-calendar-sub-btn,
body.readonly-share .create-calendar-sub-btn,
body.readonly-share .reopen-calendar-sub-btn,
body.readonly-share .calendar-management-actions,
body.readonly-share .enrichment-overview,
body.readonly-share .enrichment-activity,
body.readonly-share .map-search-bar,
body.readonly-share .header-menu-auth,
body.readonly-share [data-card-open-chat],
body.readonly-share [data-card-chat-panel],
body.readonly-share [data-live-tour-guide],
body.readonly-share [data-guide-generate] {
  display: none !important;
}

.share-header-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.3;
}

.readonly-share-page .app-header {
  gap: 8px;
}

.share-readonly-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.share-boot-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  color: #64748b;
  font-size: 15px;
}

.share-error-card {
  max-width: 440px;
  margin: 100px auto;
  padding: 32px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.share-error-card[hidden] {
  display: none !important;
}

.share-error-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.share-error-title {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}

.share-error-desc {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin: 0 0 20px;
}

.share-primary-btn {
  display: inline-block;
  padding: 8px 18px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.share-primary-btn[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  body.readonly-share .planner-layout,
  .readonly-share-page .planner-layout {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .readonly-share-page .brand span:not(.brand-mark) {
    display: none;
  }

  .readonly-share-page .share-readonly-badge {
    font-size: 11px;
    padding: 2px 7px;
  }

  .readonly-share-page .map-toolbar-primary {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }

  .readonly-share-page .title-actions {
    display: flex;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    gap: 6px;
    justify-content: flex-end;
    align-items: center;
    align-self: center;
  }

  .readonly-share-page #viewModeToggle {
    display: inline-flex !important;
    min-width: 44px;
    min-height: 44px;
  }

  .readonly-share-page .share-trip-title {
    font-size: 12px;
    flex: 0 1 auto;
    max-width: min(100%, 70vw);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .readonly-share-page .map-route-sequence {
    padding: 6px 8px;
    gap: 4px;
  }

  .readonly-share-page .map-route-sequence-stop b {
    min-width: 20px;
    min-height: 20px;
    font-size: 11px;
  }

  .readonly-share-page .map-route-sequence-stop span {
    font-size: 12px;
  }

  .readonly-share-page .day-side,
  .readonly-share-page .poi-strip {
    justify-content: flex-start;
  }
}
