body {
  margin: 0;
  background: #f5f7fb;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", Segoe UI, Roboto, Arial, sans-serif;
  color: #1f2933;
  display: flex;
  flex-direction: column;
  height: 100vh;
}
body.modal-open{overflow:hidden;}
body.modal-open{overflow:hidden;}

.chat-wrapper {
  flex: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  max-width: 1300px;
  margin: 16px auto;
  border: 1px solid #e4e9f2;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .08);
  overflow: hidden;
  background: #fff;
}
.chat-wrapper.with-checklist {
  grid-template-columns: 280px minmax(0, 1fr);
}

.chat-sidebar {
  background: #f7f9fd;
  border-right: 1px solid #e0e7f3;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}
.chat-sidebar-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.ghost-btn{
  border:1px solid #cfd8f3;
  background:#fff;
  color:#1d3a58;
  border-radius:999px;
  padding:6px 12px;
  font-weight:600;
  font-size:12px;
  cursor:pointer;
}
.ghost-btn:hover{background:#eef3ff;}

.chat-sidebar h2 {
  margin: 0;
  font-size: 18px;
  color: #1d3a58;
}

.chat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
}

.chat-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.chat-item:hover {
  border-color: #d7e3f8;
  background: #f0f6ff;
}

.chat-item.active {
  border-color: #2563eb;
  background: #e6efff;
  box-shadow: inset 0 0 0 1px rgba(37,99,235,.35);
}

.chat-item img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.chat-item .name {
  font-weight: 700;
  font-size: 14px;
  color: #1f2933;
}

.chat-item .meta {
  font-size: 12px;
  color: #64748b;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}

.chat-back{
  display:none;
  position:absolute;
  left:12px;
  top:14px;
  padding:6px 10px;
  border-radius:10px;
  border:1px solid #dbe3f5;
  background:#fff;
  color:#1d3a58;
  font-weight:700;
  cursor:pointer;
  z-index:2;
}

.chat-header {
  padding: 18px 22px;
  border-bottom: 1px solid #e0e7f3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.chat-owner-card.compact{
  width:100%;
}
.collab-entry{
  margin:0;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid #dbe4ff;
  background:#eef2ff;
  color:#1e293b;
  padding:10px 14px;
  border-radius:14px;
  font-weight:700;
  cursor:pointer;
}
.collab-entry__status{
  font-size:13px;
  color:#475569;
  flex:1;
  text-align:left;
}
.collab-entry__cta{
  font-size:12px;
  color:#4338ca;
  background:#e0e7ff;
  padding:4px 10px;
  border-radius:999px;
}
.collab-entry.disabled{
  cursor:not-allowed;
  opacity:.6;
}

.chat-request-id {
  font-size: 13px;
  font-weight: 800;
  color: #1d3a58;
}

.chat-owner-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #e4ecf7;
  background: #fff;
  text-decoration: none;
  color: inherit;
  max-width: 360px;
  transition: box-shadow .2s ease, transform .2s ease;
  flex: 1;
}

.chat-owner-card:hover {
  box-shadow: 0 12px 28px rgba(37, 99, 235, .18);
  transform: translateY(-2px);
}

.chat-owner-card img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, .15);
}

.chat-owner-name {
  font-size: 15px;
  font-weight: 800;
  color: #1d3a58;
}

.chat-owner-card.compact {
  gap: 16px;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
  max-width: none;
}

.chat-owner-card.compact:hover {
  box-shadow: none;
  transform: none;
}

.chat-owner-card.compact img {
  width: 56px;
  height: 56px;
  box-shadow: none;
}

.chat-owner-line {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: #475569;
}

.chat-owner-score {
  font-size: 13px;
  font-weight: 700;
  color: #10b981;
}

.chat-header .chat-request-id {
  color: #2563eb;
}

.chat-confirm-btn{display:none;}

.chat-messages {
  flex: 1;
  padding: 22px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fbff;
  min-height: 0;
}

.bubble-line{
  display:flex;
  align-items:flex-end;
  gap:10px;
}
.bubble-line.me{
  justify-content:flex-end;
}
.bubble-line.me .bubble-avatar{
  order:2;
}
.bubble-line.me .bubble{
  order:1;
}
.bubble-line.other{
  justify-content:flex-start;
}
.bubble-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  object-fit:cover;
  box-shadow:0 4px 10px rgba(15,23,42,.12);
}
.bubble {
  max-width: 60%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  display:flex;
  flex-direction:column;
  gap:6px;
}

.bubble.me {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.bubble.other {
  background: #fff;
  border-bottom-left-radius: 4px;
  border: 1px solid #e4ecf7;
}
.bubble-meta{
  display:flex;
  justify-content:flex-end;
  font-size:11px;
  color:#cbd5f5;
}
.bubble.other .bubble-meta{
  color:#94a3b8;
}
.bubble-body{
  word-break:break-word;
}
.bubble.image{
  padding:6px;
  background:#fff;
  border:1px solid #dbe3f5;
}
.bubble.image img{
  max-width:220px;
  border-radius:12px;
  display:block;
}
.bubble.image figcaption{
  margin-top:4px;
  font-size:11px;
  color:#475569;
}

.bubble-date{
  align-self:center;
  font-size:12px;
  color:#94a3b8;
  background:#fff;
  border:1px solid #e4ecf7;
  border-radius:999px;
  padding:4px 12px;
}

.chat-item .brief{
  font-size:12px;
  color:#94a3b8;
  margin-top:2px;
}

.chat-input {
  padding: 16px 22px;
  border-top: 1px solid #e0e7f3;
  display: flex;
  gap: 12px;
  background: #fff;
  align-items:flex-start;
}
.chat-input.disabled {
  opacity: .75;
}
.chat-input.disabled textarea {
  background: #f3f4f6;
  cursor: not-allowed;
}
.chat-input.disabled button {
  background: #cbd5f5;
  cursor: not-allowed;
}

.chat-input textarea {
  flex: 1;
  border: 1.6px solid #d8e1f1;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  min-height: 72px;
  resize: vertical;
}

.chat-input button {
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
}

.chat-input button:hover {
  background: #1d4ed8;
}
.chat-collab {
  border:1px solid #e4e9f2;
  background:#fdfefe;
  display:flex;
  flex-direction:column;
  min-height:0;
  position:fixed;
  left:50%;
  bottom:20px;
  transform:translate(-50%, 20px);
  width:min(980px, 94vw);
  max-height:86vh;
  border-radius:18px;
  box-shadow:0 24px 60px rgba(15,23,42,.22);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease, transform .2s ease;
  z-index:1205;
}
.collab-modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  backdrop-filter:blur(2px);
  opacity:0;
  transition:opacity .2s ease;
  z-index:1200;
}
body.collab-modal-open .collab-modal-overlay{
  opacity:1;
}
body.collab-modal-open .chat-collab{
  opacity:1;
  pointer-events:auto;
  transform:translate(-50%, 0);
}
.collab-head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid #e7edf7;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.collab-meta{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:6px;
}
.collab-head h3 {
  margin: 0;
  font-size: 18px;
  color: #1d3a58;
}
.collab-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #94a3b8;
}
.collab-status{
  padding:6px 12px;
  border-radius:20px;
  background:#eef2ff;
  color:#4338ca;
  font-weight:700;
  font-size:12px;
  text-align:center;
  white-space:nowrap;
}
.collab-editing{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-end;
  min-height:24px;
  font-size:12px;
}
.collab-close{
  border:none;
  background:transparent;
  color:#64748b;
  font-size:18px;
  cursor:pointer;
  padding:4px 6px;
}
.collab-tabs{
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 22px 0;
  flex-wrap:wrap;
}
.collab-tab{
  border:1px solid #e2e8f0;
  background:#fff;
  color:#475569;
  padding:6px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.collab-tab.active{
  border-color:#f59e0b;
  background:#fff7ed;
  color:#b45309;
}
.collab-tab-hidden{
  display:none;
}
.editing-pill{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 10px;
  border-radius:999px;
  background:rgba(99,102,241,.12);
  color:#374151;
  font-weight:600;
  line-height:20px;
}
.editing-pill::before{
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--editing-color, #6366f1);
  box-shadow:0 0 0 4px rgba(99,102,241,.12);
}
.editing-pill.idle{
  background:#f1f5f9;
  color:#94a3b8;
}
[data-editing="true"]{
  position:relative;
  border-color:var(--editing-color, #f59e0b) !important;
  box-shadow:0 0 0 2px rgba(245,158,11,.2);
}
[data-editing="true"]::after{
  content:'正在协作编辑';
  position:absolute;
  top:-20px;
  right:0;
  font-size:10px;
  color:#fb923c;
}
.collab-body {
  flex: 1;
  padding: 18px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.collab-section {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  background: #fff;
  padding: 16px;
}
.collab-section h4 {
  margin: 0 0 10px;
  font-size: 15px;
  color: #1d3a58;
}
.collab-section h5{
  margin:12px 0 8px;
  font-size:13px;
  color:#334155;
}
.collab-section summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-weight:500;
}
.post-trip-section {
  border: 1px solid #e4e9f2;
  border-radius: 12px;
  margin-bottom: 12px;
  background: #fafbff;
}
.post-trip-section summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  font-weight: 500;
  color: #1e3a5f;
}

@media (max-width: 768px){
  body{background:#f5f7fb;}
  .chat-wrapper{
    display:flex;
    flex-direction:column;
    grid-template-columns:1fr;
    max-width:none;
    margin:0;
    border:none;
    border-radius:0;
    height:calc(100vh - var(--topbar-height,64px));
    box-shadow:none;
  }
  .chat-sidebar{
    width:100%;
    border-right:none;
    padding:12px;
  }
  .chat-main,.chat-collab{
    display:none;
  }
  body.chat-mobile-open .chat-sidebar{
    display:none;
  }
  body.chat-mobile-open .chat-main{
    display:flex;
    height:calc(100vh - var(--topbar-height,64px));
  }
  .chat-back{display:inline-flex;}
  .chat-header{padding-top:46px;}
  .collab-entry{margin:0;}
  .chat-main{display:flex;height:calc(100vh - var(--topbar-height,64px));}
}
@media (max-width: 700px){
  .chat-collab{
    width:100%;
    left:0;
    right:0;
    bottom:0;
    transform:translateY(20px);
    max-height:90vh;
    border-radius:18px 18px 0 0;
  }
  body.collab-modal-open .chat-collab{
    transform:translateY(0);
  }
  .collab-entry{
    margin:0;
    width:100%;
  }
}
.post-trip-section summary::-webkit-details-marker { display:none; }
.post-trip-section .summary-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.post-trip-section .section-status {
  padding: 2px 6px;
  border-radius: 999px;
  background: #e4e9f2;
  color: #475569;
}
.post-trip-section .section-status.status-done {
  background: #d1fae5;
  color: #047857;
}
.post-trip-section .section-status.status-pending {
  background: #fef3c7;
  color: #b45309;
}
.post-trip-section .collapse-arrow {
  transition: transform .2s ease;
  display: inline-block;
}
.post-trip-section[open] .collapse-arrow {
  transform: rotate(180deg);
}
.post-trip-section .section-body {
  padding: 0 16px 16px;
}
.collab-shell {
  border: 1px solid #e4e9f2;
  border-radius: 14px;
  background: #fff;
  margin-bottom: 14px;
}
.collab-shell summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  font-weight: 600;
  color: #1e293b;
}
.collab-shell summary::-webkit-details-marker {
  display: none;
}
.collab-shell .summary-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: #64748b;
}
.collab-shell .section-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}
.collab-shell .section-status.status-done {
  background: #d1fae5;
  color: #047857;
}
.collab-shell .section-status.status-pending {
  background: #fef3c7;
  color: #b45309;
}
.collab-shell .collapse-arrow {
  transition: transform .2s ease;
  display: inline-block;
  font-size: 12px;
  color: #94a3b8;
}
.collab-shell[open] .collapse-arrow {
  transform: rotate(180deg);
}
.collab-shell .section-body {
  padding: 0 16px 16px;
}
.collab-section-sub{
  margin-top:8px;
}
.collab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.collab-row label {
  flex: 1;
  font-size: 13px;
  color: #475569;
  display: flex;
  flex-direction: column;
}
.collab-row input{
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cfd8f3;
  font-size: 15px;
}
.collab-row select{
  margin-top: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cfd8f3;
  font-size: 16px;
}
.travel-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.travel-table th,
.travel-table td {
  border: 1px solid #e4e9f2;
  padding: 6px 8px;
}
.travel-table th {
  background: #f6f8fc;
  color: #475569;
}
.travel-table button{
  border:none;
  background:#f1f5f9;
  border-radius:6px;
  padding:4px 8px;
  cursor:pointer;
}
.collab-alert {
  padding: 12px 14px;
  background: #fff4e6;
  border: 1px solid #f7c08a;
  border-radius: 10px;
  font-size: 12px;
  color: #a0520d;
  margin-top: 12px;
}
.collab-alert.success{
  background:#ecfdf5;
  border-color:#6ee7b7;
  color:#047857;
}
.collab-alert.aa-hint{
  text-align:center;
  font-size:13px;
  font-weight:600;
  margin-bottom:8px;
}
.collab-action {
  text-align: right;
}
.collab-action button {
  border: none;
  background: #2563eb;
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.destinations-list,
.aa-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.destination-row,
.aa-row{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.destination-row button,
.aa-row button{
  border:none;
  background:#f1f5f9;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
}
.aa-row select{
  flex:0 0 120px;
  font-size:16px;
}
.aa-row input[type="text"],
.aa-row input[type="number"]{
  flex:1;
}
.aa-proof{
  display:flex;
  align-items:center;
  gap:6px;
}
.aa-proof-name{
  font-size:12px;
  color:#1d3a58;
  font-weight:600;
}
.upload-btn{
  border:1px dashed #93c5fd;
  border-radius:999px;
  padding:6px 12px;
  background:#eff6ff;
  color:#2563eb;
  font-size:12px;
  cursor:pointer;
}
.upload-btn input{
  display:none;
}
.editing-foreign{
  box-shadow:0 0 0 2px rgba(245,158,11,.6);
}
.collab-notes{
  width:100%;
  min-height:180px;
  border:1px solid #cfd8f3;
  border-radius:10px;
  padding:12px;
  font-size:13px;
  resize:vertical;
}
.chat-upload{
  flex:0 0 auto;
  width:44px;
  height:44px;
  border:1px solid #d9e2f3;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  cursor:pointer;
  background:#fff;
}
.chat-upload input{display:none;}
.chat-empty {
  margin: auto;
  padding: 24px 28px;
  border-radius: 16px;
  border: 1px dashed #cbd5f5;
  color: #64748b;
  background: #fff;
  text-align: center;
  font-size: 14px;
  max-width: 280px;
}
.chat-checklist {
  border-left: 1px solid #e0e7f3;
  background: #f7f9fd;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  box-sizing: border-box;
  padding-right: 12px;
}
.chat-checklist.hidden {
  display: none;
}
.chat-checklist::-webkit-scrollbar {
  width: 6px;
}
.chat-checklist::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .35);
  border-radius: 999px;
}
.chat-checklist::-webkit-scrollbar-track {
  background: transparent;
}
.checklist-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: #f7f9fd;
  padding-bottom: 8px;
  border-bottom: 1px solid #dbe3f5;
  z-index: 2;
  gap:12px;
}
.checklist-head-titles h3 {
  margin: 0;
  font-size: 17px;
  color: #1d3a58;
}
.checklist-head-titles p{
  margin:4px 0 0;
  color:#64748b;
  font-size:12px;
}
.checklist-head-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.history-btn{
  border:none;
  background:#fff;
  border-radius:20px;
  padding:6px 12px;
  font-size:12px;
  font-weight:600;
  color:#2563eb;
  cursor:pointer;
  box-shadow:0 4px 12px rgba(37,99,235,.18);
}
.history-btn.active{
  background:#2563eb;
  color:#fff;
}
.history-btn.active{
  background:#2563eb;
  color:#fff;
}
.checklist-status {
  font-size: 13px;
  color: #2563eb;
  background: #e0edff;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.checklist-history{
  background:#fff;
  border:1px solid #dbe3f5;
  border-radius:12px;
  padding:10px 12px;
  font-size:12px;
  color:#475569;
  max-height:320px;
  overflow:auto;
  margin-bottom:12px;
}
.checklist-history.hidden{display:none;}
.history-entry{
  display:flex;
  flex-direction:column;
  gap:2px;
  padding:6px 0;
  border-bottom:1px dashed #e2e8f0;
}
.history-entry:last-child{border-bottom:none;}
.history-entry strong{color:#1d3a58;font-size:12px;}
.checklist-participants{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:10px;
}
.participant-chip{
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#fff;
  border:1px solid #dbe3f5;
}
.participant-chip small{
  font-size:11px;
  color:#64748b;
}
.participant-chip[data-status=\"pending\"]{
  border-color:#fcd34d;
  background:#fff7e6;
}
.participant-chip[data-status=\"accepted\"]{
  border-color:#bbf7d0;
  background:#ecfdf5;
  color:#065f46;
}
.participant-chip[data-status=\"declined\"]{
  border-color:#fecaca;
  background:#fff5f5;
  color:#b91c1c;
}
.participant-chip button{
  border:none;
  background:#2563eb;
  color:#fff;
  border-radius:14px;
  padding:2px 8px;
  font-size:11px;
  cursor:pointer;
}
.participant-chip button.decline{background:#f87171;}
.chat-checklist.history-mode .checklist-body,
.chat-checklist.history-mode .checklist-participants{
  display:none;
}
.chat-checklist.history-mode .checklist-history{
  display:block;
}
.checklist-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 8px;
}
.todo-card {
  background: #fff;
  border: 1px solid #dce6f5;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}
.todo-card h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #1f3b5a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.todo-card.pretrip-lock{
  border-style:dashed;
  background:#fdf7ef;
}
.todo-approvals{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:6px;
  font-size:11px;
}
.todo-approvals span{
  padding:2px 8px;
  border-radius:999px;
  background:#edf2ff;
  color:#1e40af;
}
.todo-approvals span.waiting{
  background:#fff4e6;
  color:#b45309;
}
.todo-approvals span.done{
  background:#dcfce7;
  color:#047857;
}
.todo-card .todo-status {
  font-size: 12px;
  color: #64748b;
}
.todo-card label {
  font-size: 13px;
  color: #1f2933;
  font-weight: 600;
}
.todo-card input[type="date"],
.todo-card input[type="number"],
.todo-card textarea {
  width: 100%;
  max-width: 100%;
  border: 1.6px solid #d8e1f1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  background: #fdfcff;
  box-sizing: border-box;
}
.todo-card textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}
.todo-attachments {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.upload-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e0edff;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  width: fit-content;
  overflow: hidden;
}
.upload-pill input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-pill.disabled {
  background: #e2e8f0;
  color: #94a3b8;
  cursor: not-allowed;
}
.upload-pill.disabled input[type="file"] {
  cursor: not-allowed;
}
.attachment-empty {
  font-size: 12px;
  color: #94a3b8;
}
.attachment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.attachment-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.attachment-list a {
  color: #2563eb;
  text-decoration: none;
}
.attachment-list a:hover {
  text-decoration: underline;
}
.attachment-remove {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  cursor: pointer;
}
.attachment-remove:hover {
  background: #fecaca;
}
.todo-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.todo-actions button {
  border: none;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.todo-actions button.primary {
  background: #2563eb;
  color: #fff;
}
.todo-actions button.secondary {
  background: #eef2ff;
  color: #1d4ed8;
}
.todo-actions button.waiting {
  background: #e2e8f0;
  color: #475569;
  cursor: not-allowed;
}
.todo-actions button.done {
  background: #bbf7d0;
  color: #047857;
  cursor: not-allowed;
}
.todo-actions button.dismiss {
  background: #fee2e2;
  color: #b91c1c;
}
.pretrip-confirm{
  min-width:180px;
  background:#16a34a!important;
  color:#fff!important;
}
.pretrip-confirm[disabled]{
  background:#a7f3d0!important;
  color:#065f46!important;
  cursor:not-allowed;
}

.intrip-panel{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.intrip-card{
  background:#fff;
  border:1px solid #d9e2f3;
  border-radius:16px;
  padding:16px;
  box-shadow:0 12px 24px rgba(15,23,42,.08);
  display:flex;
  flex-direction:column;
  gap:10px;
}
.intrip-card h4{
  margin:0;
  font-size:15px;
  color:#1d3a58;
}
.doc-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.doc-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  background:#f8fbff;
}
.doc-row .status{
  font-size:12px;
  font-weight:700;
}
.doc-row .status.auto{color:#059669;}
.doc-row .status.pending{color:#b45309;}
.doc-row .status.uploaded{color:#2563eb;}
.doc-row button{
  border:none;
  background:#2563eb;
  color:#fff;
  border-radius:10px;
  padding:6px 12px;
  font-size:12px;
  cursor:pointer;
}
.doc-row button[disabled]{background:#cbd5f5;color:#475569;cursor:not-allowed;}
.deposit-callout{
  font-size:13px;
  color:#475569;
  line-height:1.5;
  background:#fff7ed;
  border:1px dashed #fdba74;
  border-radius:12px;
  padding:10px 12px;
}
.deposit-status{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  font-size:12px;
}
.deposit-status span{
  padding:4px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#1e40af;
}
.deposit-status span.paid{
  background:#dcfce7;
  color:#047857;
}
.todo-actions button[disabled] {
  opacity: .6;
  cursor: not-allowed;
}
.todo-summary {
  font-size: 13px;
  color: #334155;
  line-height: 1.4;
  background: #f8fbff;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e0e7f3;
}

.group-modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:1000;
}
.group-modal[hidden]{display:none;}
.group-modal-card{
  width:420px;
  max-width:90vw;
  background:#fff;
  border-radius:18px;
  box-shadow:0 24px 48px rgba(15,23,42,.25);
  padding:20px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.group-modal-card header{
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.group-modal-card header h3{
  margin:0;
  font-size:18px;
  color:#1d3a58;
}
.group-modal-close{
  border:none;
  background:#f1f5f9;
  border-radius:999px;
  width:32px;
  height:32px;
  font-size:16px;
  cursor:pointer;
}
.group-modal-card form{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.group-modal-card input{
  border:1px solid #d9e2f3;
  border-radius:12px;
  padding:10px 12px;
  font-size:14px;
}
.group-add-row{
  display:flex;
  gap:8px;
}
.group-add-row button{
  border:none;
  background:#2563eb;
  color:#fff;
  border-radius:12px;
  padding:0 16px;
  cursor:pointer;
}
.group-participant-chips{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  min-height:32px;
}
.group-participant-chips .chip{
  background:#eef2ff;
  color:#312e81;
  border-radius:999px;
  padding:6px 10px;
  font-size:12px;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.group-participant-chips .chip button{
  border:none;
  background:transparent;
  color:#4c1d95;
  cursor:pointer;
}
.group-modal-card .primary{
  border:none;
  border-radius:12px;
  background:#10b981;
  color:#fff;
  padding:12px 16px;
  font-weight:700;
  cursor:pointer;
}
.group-hint{
  margin:0;
  font-size:12px;
  color:#475569;
}
.empty-hint{
  font-size:12px;
  color:#94a3b8;
}

@media (max-width: 900px) {
  .chat-wrapper {
    grid-template-columns: 1fr;
  }
}
.collab-editing{
  font-size:12px;
  color:#475569;
  background:#e6efff;
  border-radius:999px;
  padding:4px 10px;
  min-height:24px;
}
.collab-section.locked{
  background:#f8fafc;
  border-style:dashed;
}
.collab-note{
  font-size:13px;
  color:#475569;
  margin-bottom:12px;
}
.collab-waiting{
  padding:10px 12px;
  border-radius:10px;
  background:#fef3c7;
  color:#92400e;
  font-size:13px;
  margin-bottom:10px;
}
.collab-system{
  border:1px dashed #94a3b8;
  padding:12px;
  border-radius:12px;
  background:#f8fafc;
  font-size:13px;
  color:#0f172a;
}
.collab-system strong{
  color:#2563eb;
}
.collab-system .time-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:2px 10px;
  margin-right:6px;
  border-radius:999px;
  background:#dbeafe;
  color:#1d4ed8;
  font-weight:700;
}
.collab-system ul{
  margin:8px 0 0;
  padding-left:18px;
  color:#475569;
}
.safety-cards{
  display:grid;
  gap:12px;
  margin-top:12px;
}
.safety-card{
  border:1px solid #cbd5f5;
  border-radius:12px;
  padding:14px;
  background:#fdfcff;
  box-shadow:0 4px 12px rgba(15,23,42,.05);
  font-size:13px;
  color:#1f2937;
}
.safety-card-title{
  font-size:15px;
  font-weight:800;
  color:#0f172a;
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:8px;
}
.safety-card-title span{
  font-size:12px;
  color:#6366f1;
}
.safety-card ul{
  margin:8px 0 0;
  padding-left:18px;
  color:#475569;
}
.safety-card.warn{
  border-color:#fb923c;
  background:#fff7ed;
}
.safety-card.ok{
  border-color:#86efac;
  background:#ecfdf5;
}
.safety-card.deposit{
  border-color:#bfdbfe;
  background:#eff6ff;
}
.safety-card-warn{
  margin:8px 0 0;
  color:#9a3412;
  font-weight:600;
}
.safety-card-ok{
  margin:8px 0 0;
  color:#047857;
  font-weight:600;
}
.safety-card-tips{
  margin-top:8px;
  font-size:12px;
  color:#0f172a;
  font-weight:600;
}
.trip-end-panel{
  margin-top:14px;
  padding:14px;
  border:1px solid #cbd5f5;
  border-radius:12px;
  background:#f8fbff;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.trip-end-panel.ended{
  background:#f1f5f9;
  border-color:#cbd5f5;
}
.trip-status-text{
  font-weight:800;
  color:#0f172a;
}
.trip-end-note{
  font-size:13px;
  color:#475569;
}
.trip-end-summary{
  font-size:13px;
  color:#0f172a;
  font-weight:600;
}
.trip-end-btn{
  align-self:flex-start;
  border:none;
  background:#2563eb;
  color:#fff;
  border-radius:999px;
  padding:8px 16px;
  font-weight:700;
  cursor:pointer;
}
.trip-end-btn:hover{
  background:#1d4ed8;
}
.post-trip-wrapper{
  display:flex;
  flex-direction:column;
  gap:18px;
}
.post-trip-section{
  border:1px solid #e4e9f2;
  border-radius:12px;
  padding:14px;
  background:#fdfefe;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.post-trip-section textarea{
  width:100%;
  min-height:80px;
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:8px;
  font-size:13px;
}
.post-trip-section input[type="number"]{
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:6px 8px;
  font-size:15px;
  width:200px;
}
.post-trip-section select{
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:6px 8px;
  font-size:16px;
  width:200px;
}
.post-trip-note{
  font-size:12px;
  color:#475569;
}
.post-trip-note.warn{
  color:#b45309;
  font-weight:600;
}
.post-trip-section.review.completed{
  background:#ecfdf5;
  border-color:#86efac;
}
.review-row{
  display:flex;
  gap:12px;
}
.review-row label{
  flex:1;
  display:flex;
  flex-direction:column;
  font-size:13px;
  color:#0f172a;
  gap:4px;
}
.review-actions{
  display:flex;
  justify-content:flex-end;
}
.review-actions button{
  border:none;
  background:#2563eb;
  color:#fff;
  padding:8px 18px;
  border-radius:999px;
  font-weight:700;
  cursor:pointer;
}
.review-actions button:disabled{
  background:#cbd5f5;
  color:#94a3b8;
  cursor:not-allowed;
}
.review-overall{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.review-overall label{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  color:#0f172a;
}
.review-overall input{
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:6px 8px;
  font-size:15px;
}
.review-overall select{
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:6px 8px;
  font-size:16px;
}
.category-grid{
  margin-top:12px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(150px,1fr));
  gap:10px;
}
.category-grid label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:12px;
  color:#0f172a;
}
.category-grid input{
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:6px;
  font-size:13px;
}
.persona-section,
.prompt-section,
.review-comment{
  margin-top:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.persona-section h6,
.prompt-section h6,
.review-comment h6{
  margin:0;
  font-size:13px;
  color:#1d3a58;
}
.persona-section label,
.prompt-section label{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:13px;
  color:#0f172a;
}
.persona-section select,
.prompt-section textarea,
.review-comment textarea{
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:8px;
  font-size:15px;
}
.persona-section select{
  font-size:16px;
}
.review-comment textarea{
  min-height:80px;
}
.evidence-box{
  border:1px dashed #cbd5f5;
  border-radius:10px;
  padding:10px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.evidence-list{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.evidence-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  background:#eef2ff;
  color:#1d3a58;
  font-size:12px;
  font-weight:600;
}
.evidence-chip button{
  border:none;
  background:transparent;
  color:#ef4444;
  cursor:pointer;
  font-weight:700;
}
.evidence-box .upload-btn{
  align-self:flex-start;
}
.evidence-box .empty-hint{
  font-size:12px;
  color:#94a3b8;
}
/** Trip End Modal **/
.trip-end-modal{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.55);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:1000;
}
.trip-end-modal[hidden]{
  display:none;
}
.trip-end-card{
  width:520px;
  max-width:90vw;
  background:#fff;
  border-radius:18px;
  padding:24px;
  box-shadow:0 25px 60px rgba(15,23,42,.35);
  position:relative;
}
.trip-end-card h3{
  margin:0 0 8px;
  color:#0f172a;
}
.trip-end-tip{
  margin:0 0 12px;
  color:#475569;
  font-size:14px;
}
.trip-end-card fieldset{
  border:none;
  padding:0;
  margin:0 0 12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.trip-end-card legend{
  font-weight:700;
  margin-bottom:6px;
  color:#0f172a;
}
.trip-end-card label{
  font-size:14px;
  color:#0f172a;
  display:flex;
  align-items:center;
  gap:8px;
}
.trip-end-other{
  gap:8px;
}
.trip-end-other input[type="text"]{
  flex:1;
  border:1px solid #cbd5f5;
  border-radius:8px;
  padding:6px 8px;
}
.trip-end-notice{
  font-size:13px;
  color:#b45309;
  margin-bottom:12px;
}
.trip-end-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
.trip-end-actions button{
  border:none;
  border-radius:8px;
  padding:8px 16px;
  font-weight:600;
  cursor:pointer;
}
.trip-end-actions button.primary{
  background:#2563eb;
  color:#fff;
}
.trip-end-actions button:not(.primary){
  background:#e2e8f0;
  color:#0f172a;
}
.trip-end-close{
  position:absolute;
  top:14px;
  right:14px;
  border:none;
  background:transparent;
  font-size:18px;
  cursor:pointer;
  color:#94a3b8;
}
.trip-end-close:hover{
  color:#475569;
}
.collab-section.pending{
  opacity:.8;
  position:relative;
}
.collab-section .pending-mask{
  margin-top:12px;
  border:1px dashed #cbd5f5;
  border-radius:10px;
  padding:12px;
  text-align:center;
  color:#475569;
  background:#f8fafc;
}
.collab-note.warn{
  color:#b45309;
  font-weight:600;
}
.star-group{
  display:flex;
  align-items:center;
  gap:4px;
}
.star-btn{
  border:none;
  background:transparent;
  font-size:20px;
  color:#d1d5db;
  cursor:pointer;
}
.star-btn.active{
  color:#fbbf24;
}
.star-btn:disabled{
  cursor:not-allowed;
  opacity:.4;
}
.star-score{
  font-size:12px;
  color:#475569;
  margin-left:6px;
}
.rating-help{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:16px;
  height:16px;
  margin-left:6px;
  border-radius:50%;
  background:#e2e8f0;
  color:#475569;
  font-size:10px;
  font-weight:700;
  cursor:pointer;
  position:relative;
}
.rating-help:focus-visible{
  outline:2px solid #94a3b8;
  outline-offset:2px;
}
.rating-help::after{
  content:attr(data-tip);
  position:absolute;
  left:50%;
  top:calc(100% + 8px);
  transform:translate(-50%,-10px);
  width:220px;
  max-width:70vw;
  padding:8px 10px;
  border-radius:8px;
  background:#0f172a;
  color:#fff;
  font-size:12px;
  line-height:1.4;
  opacity:0;
  pointer-events:none;
  transition:.15s ease;
  z-index:5;
  box-shadow:0 8px 20px rgba(15,23,42,.25);
}
.rating-help:hover::after,
.rating-help:focus::after{
  opacity:1;
  transform:translate(-50%,0);
}
