:root {
  --bg: #FBF6EC;
  --card: #fffef9;
  --text: #2C221E;
  --muted: #64748b;
  --border: #e2d6c4;
  --primary: #059669;
  --primary-soft: #d1fae5;
  --accent: #047857;
  --danger: #ef4444;
  --warn: #d97706;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

/* VIP 主題：boot／core 寫入 --bg-main 等；獨立網元件多用 --bg／--card */
html[data-vip-theme] {
  --bg: var(--bg-main, #FBF6EC);
  --card: var(--card-bg, #fffef9);
  --text: var(--text-main, #2C221E);
  --muted: var(--text-muted, #64748b);
  --border: var(--border-soft, #e2d6c4);
  --primary: var(--color-brand, #059669);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "Segoe UI", sans-serif;
}
body { padding-top: var(--safe-top); }
button, textarea, input { font: inherit; }
a { color: var(--primary); }
.lang-en { display: none; }
body.lang-en .lang-zh { display: none; }
body.lang-en .lang-en { display: inline; }

.tm-lfg-app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.tm-lfg-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.tm-lfg-top h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-lfg-icon-btn {
  appearance: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
  box-sizing: border-box;
}
.tm-lfg-icon-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tm-lfg-icon-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tm-lfg-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tm-lfg-panel { display: none; flex: 1; flex-direction: column; min-height: 0; }
.tm-lfg-panel.is-on { display: flex; }

.tm-lfg-auth, .tm-lfg-empty, .tm-lfg-boot {
  margin: 1.25rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.tm-lfg-auth h2, .tm-lfg-boot h2, .tm-lfg-empty h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 900;
}
.tm-lfg-auth p, .tm-lfg-empty p, .tm-lfg-boot p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.tm-lfg-auth .tm-lfg-btn { width: 100%; margin-bottom: 0.55rem; }
.tm-lfg-auth__alt {
  margin: 1rem 0 0 !important;
  font-size: 0.85rem !important;
}
.tm-lfg-empty__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
}
.tm-lfg-empty__actions .tm-lfg-btn {
  width: 100%;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.tm-lfg-temp-login {
  margin: 0.75rem 0 0;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  background: var(--card);
}
.tm-lfg-temp-login summary {
  cursor: pointer;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
}
.tm-lfg-temp-login input {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.tm-lfg-temp-login .tm-lfg-btn { margin-top: 0.55rem; margin-bottom: 0; }

.tm-lfg-btn {
  appearance: none;
  border-radius: 999px;
  border: 2px solid var(--text);
  background: var(--text);
  color: #fff;
  font-weight: 800;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(44, 34, 30, 0.25);
}
.tm-lfg-btn--ghost {
  background: var(--card);
  color: var(--text);
}
.tm-lfg-btn--danger {
  background: #fff;
  color: var(--danger);
  border-color: var(--danger);
}
.tm-lfg-btn--ok {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 2px 2px 0 rgba(4, 120, 87, 0.25);
}
.tm-lfg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.tm-lfg-toolbar {
  padding: 0.75rem 1rem 0.35rem;
}
.tm-lfg-toolbar input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  color: var(--text);
}

.tm-lfg-filter-boxes {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 1rem 0.35rem;
}
.tm-lfg-fbox {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.tm-lfg-fbox[open] {
  box-shadow: 0 1px 0 rgba(44, 34, 30, 0.04);
}
.tm-lfg-fbox__sum {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  user-select: none;
  min-height: 2.6rem;
}
.tm-lfg-fbox__sum::-webkit-details-marker { display: none; }
.tm-lfg-fbox__label {
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 900;
  color: var(--accent);
  min-width: 2.4rem;
}
.tm-lfg-fbox__value {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-lfg-fbox__value.is-active {
  color: #047857;
}
.tm-lfg-fbox__chev {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-bottom: 0.2rem;
}
.tm-lfg-fbox[open] .tm-lfg-fbox__chev {
  transform: rotate(-135deg);
  margin-bottom: -0.15rem;
}
.tm-lfg-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.55rem 1rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.tm-lfg-chips--drawer {
  padding: 0 0.75rem 0.7rem;
  gap: 0.4rem;
}
.tm-lfg-chips--district {
  padding-top: 0;
  border-top: 1px dashed var(--border);
  margin: 0 0.55rem 0.55rem;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
  padding-bottom: 0.55rem;
}
.tm-lfg-chips--secondary {
  padding-top: 0;
}
.tm-lfg-dist-city {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent);
  margin-right: 0.15rem;
  flex-shrink: 0;
}
.tm-lfg-guest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.65rem 1rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.82rem;
  font-weight: 700;
}
.tm-lfg-guest[hidden],
.tm-lfg-signed[hidden],
.tm-lfg-user-chip[hidden],
.tm-lfg-icon-btn[hidden],
.tm-lfg-composer[hidden],
.tm-lfg-btn[hidden],
.tm-lfg-fab[hidden],
.tm-lfg-fabs[hidden] {
  display: none !important;
}
.tm-lfg-guest .tm-lfg-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  box-shadow: none;
}
.tm-lfg-signed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.65rem 1rem 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 1px solid #a7f3d0;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.82rem;
  font-weight: 700;
}
.tm-lfg-signed .tm-lfg-btn {
  padding: 0.35rem 0.8rem;
  font-size: 0.78rem;
  box-shadow: none;
}
.tm-lfg-pulse {
  margin: 0.65rem 1rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary-soft) 70%, var(--card)) 0%, var(--card) 100%);
}
.tm-lfg-pulse__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-bottom: 0.65rem;
}
.tm-lfg-pulse__stat {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.tm-lfg-pulse__stat strong {
  display: inline-block;
  min-width: 1.1rem;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--accent);
  margin-right: 0.15rem;
}
.tm-lfg-pulse__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.tm-lfg-pulse__link {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
}
.tm-lfg-pulse__link svg {
  flex-shrink: 0;
}
.tm-lfg-user-chip {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 7.5rem;
  border: 1px solid var(--border);
  background: var(--primary-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.55rem 0.2rem 0.25rem;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 1;
  min-width: 0;
}
.tm-lfg-user-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}
.tm-lfg-user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-lfg-btn--block {
  display: block;
  margin: 0.75rem auto 0;
  text-decoration: none;
  text-align: center;
  max-width: 280px;
}
.tm-lfg-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.tm-lfg-map-full {
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.tm-lfg-map {
  flex: 1;
  min-height: 280px;
  width: 100%;
  background: #e2e8f0;
  z-index: 0;
}
.tm-lfg-map-legend {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 0.45rem 1rem calc(0.45rem + var(--safe-bottom));
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--card);
  border-top: 1px solid var(--border);
}
.tm-lfg-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.25rem;
  vertical-align: middle;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
}
.tm-lfg-dot--lfg { background: #16a34a; }
.tm-lfg-dot--store { background: #2563eb; }
.tm-lfg-card__kinds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.15rem;
}
.tm-lfg-kind {
  display: inline-block;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.4;
}
.tm-lfg-kind--fixed {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #34d399;
}
.tm-lfg-kind--temp {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
}
.tm-lfg-actions--count,
.tm-lfg-actions--host {
  flex-wrap: wrap;
}
.tm-lfg-count {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
}
.tm-lfg-count input {
  width: 3.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.45rem 0.4rem;
  background: var(--card);
}
.tm-lfg-roster {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tm-lfg-roster__row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.tm-lfg-roster__av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  flex-shrink: 0;
}
.tm-lfg-roster__av--empty { display: inline-block; }
.tm-lfg-roster__name {
  font-size: 0.88rem;
  font-weight: 700;
}
.tm-lfg-roster__name em {
  font-style: normal;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
}
.tm-lfg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.tm-lfg-chip {
  appearance: none;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}
.tm-lfg-chip.is-on {
  background: var(--primary-soft);
  border-color: #6ee7b7;
  color: #065f46;
}

.tm-lfg-cards {
  list-style: none;
  margin: 0;
  padding: 0.35rem 1rem calc(1rem + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow-y: auto;
}
.tm-lfg-card {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 14px;
  padding: 0.9rem 0.95rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.tm-lfg-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}
.tm-lfg-card__title {
  margin: 0;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tm-lfg-card__meta {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
}
.tm-lfg-card__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text);
}
.tm-lfg-status {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #065f46;
}
.tm-lfg-status--hot {
  background: #ffedd5;
  color: #c2410c;
}
.tm-lfg-status--done {
  background: #f1f5f9;
  color: #64748b;
}
.tm-lfg-seats {
  margin-top: 0.15rem;
}
.tm-lfg-seats__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}
.tm-lfg-seats__track {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}
.tm-lfg-seats__fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
}
.tm-lfg-seats__fill.is-hot { background: var(--warn); }
.tm-lfg-seats__fill.is-full { background: var(--danger); }

.tm-lfg-detail {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem calc(0.5rem + var(--safe-bottom));
}
.tm-lfg-detail__title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.35;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.tm-lfg-detail__block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.75rem;
}
.tm-lfg-detail__block h3 {
  margin: 0 0 0.45rem;
  font-size: 0.85rem;
  color: #065f46;
}
.tm-lfg-detail__kv {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.45;
}
.tm-lfg-detail__kv strong { color: var(--muted); font-weight: 700; font-size: 0.78rem; display: block; }
.tm-lfg-detail__content {
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
  font-size: 0.92rem;
}
.tm-lfg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}
.tm-lfg-actions .tm-lfg-btn {
  flex: 1;
  min-width: 110px;
  font-size: 0.88rem;
  padding: 0.65rem 0.8rem;
  box-shadow: none;
  border-radius: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.tm-lfg-session {
  border-top: 1px dashed var(--border);
  padding-top: 0.65rem;
  margin-top: 0.65rem;
}
.tm-lfg-session:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.tm-lfg-comments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.tm-lfg-comment {
  font-size: 0.88rem;
  line-height: 1.45;
  word-break: break-word;
}
.tm-lfg-comment__who {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.tm-lfg-composer {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.65rem 0.85rem calc(0.65rem + var(--safe-bottom));
  background: var(--card);
  border-top: 1px solid var(--border);
}
.tm-lfg-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: var(--bg);
  color: var(--text);
}
.tm-lfg-composer .tm-lfg-btn {
  border-radius: 14px;
  min-width: 72px;
  box-shadow: none;
}

.tm-lfg-create {
  padding: 1rem 1rem calc(1rem + var(--safe-bottom));
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.tm-lfg-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 800;
  color: #065f46;
}
.tm-lfg-field input,
.tm-lfg-field textarea {
  font-weight: 400;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  background: var(--card);
}
.tm-lfg-create__actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.tm-lfg-create__actions .tm-lfg-btn { flex: 1; }
.tm-lfg-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

/* 貼上辨識（對標主站揪團導入） */
.tm-lfg-paste {
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem;
  background: #f0fdf4;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.tm-lfg-paste__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tm-lfg-paste__head strong {
  font-size: 0.9rem;
  font-weight: 800;
  color: #065f46;
}
.tm-lfg-paste__head span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
}
.tm-lfg-paste__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tm-lfg-paste textarea {
  width: 100%;
  min-height: 7.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  background: var(--card);
  color: var(--text);
  resize: vertical;
  font-weight: 400;
}
.tm-lfg-paste__review {
  margin: 0;
  font-size: 0.78rem;
  color: #047857;
  line-height: 1.45;
  white-space: pre-wrap;
}
.tm-lfg-paste__review.is-err { color: #b91c1c; }
.tm-lfg-loc-types {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
#createLocTypes .tm-lfg-chip {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  box-shadow: none;
}
#createLocTypes .tm-lfg-chip.is-on {
  background: #d1fae5;
  border-color: #059669;
  color: #065f46;
}
.tm-lfg-session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.tm-lfg-session-list li {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 0.7rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
.tm-lfg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tm-lfg-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  background: var(--card);
  cursor: pointer;
}
.tm-lfg-tag input { accent-color: #059669; }
.tm-lfg-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #065f46;
  cursor: pointer;
}
.tm-lfg-check input { width: auto; accent-color: #059669; }
.tm-lfg-check--in-time {
  margin-top: 0.55rem;
  padding: 0.55rem 0.65rem;
  border: 1px dashed #a7f3d0;
  border-radius: 10px;
  background: color-mix(in srgb, #d1fae5 40%, var(--card));
}
.tm-lfg-field--nested {
  margin-top: 0.55rem;
}
.tm-lfg-field select,
.tm-lfg-field--nested select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, #d1d5db);
  border-radius: 10px;
  font: inherit;
  background: var(--card);
  color: inherit;
}
.tm-lfg-time-quick {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.55rem;
}
.tm-lfg-chips--weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.tm-lfg-chip--weekday {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-width: 3.1rem;
  line-height: 1.15;
  padding: 0.4rem 0.55rem;
}
.tm-lfg-chip__wd {
  font-weight: 800;
  font-size: 0.78rem;
}
.tm-lfg-chip__sub {
  font-size: 0.65rem;
  font-weight: 600;
  opacity: 0.88;
}
#createDateWeekdays .tm-lfg-chip.is-on {
  background: #10b981;
  color: #fff;
  border-color: #10b981;
}
.tm-lfg-opentime__summary {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 12px;
  border: 1px solid #a7f3d0;
  background: color-mix(in srgb, #ecfdf5 55%, var(--card, #fff));
  color: #047857;
  cursor: pointer;
  text-align: left;
  font: inherit;
  box-sizing: border-box;
}
.tm-lfg-opentime__summary.is-empty {
  border-style: dashed;
}
.tm-lfg-opentime__summary.is-open {
  border-style: solid;
}
.tm-lfg-opentime__icon {
  display: inline-flex;
  flex-shrink: 0;
}
.tm-lfg-opentime__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.tm-lfg-opentime__main strong {
  font-size: 0.86rem;
  font-weight: 800;
}
.tm-lfg-opentime__main span {
  font-size: 0.78rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tm-lfg-opentime__action {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.tm-lfg-opentime__panel {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.55rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px dashed #a7f3d0;
  background: var(--card, #fff);
}
.tm-lfg-opentime__panel[hidden] {
  display: none !important;
}
.tm-lfg-opentime__panel > #createWhen {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, #d1d5db);
  border-radius: 10px;
  font: inherit;
  background: var(--card);
  color: inherit;
}
.tm-lfg-time-quick__group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.tm-lfg-time-quick__label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}
#createTimeQuick .tm-lfg-chip {
  border-color: #a7f3d0;
  color: #047857;
  background: var(--card);
}
#createTimeQuick .tm-lfg-chip.is-on {
  background: #10b981;
  border-color: #059669;
  color: #fff;
}

.tm-lfg-footer {
  padding: 0.5rem 1rem calc(0.75rem + var(--safe-bottom));
  text-align: center;
  font-size: 0.78rem;
  color: var(--muted);
}
.tm-lfg-footer a { font-weight: 700; text-decoration: none; }

/* 右下角懸浮：地圖／新增 */
.tm-lfg-fabs {
  position: fixed;
  z-index: 45;
  right: max(0.85rem, env(safe-area-inset-right, 0px));
  bottom: calc(1rem + var(--safe-bottom));
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 0.55rem;
  pointer-events: none;
}
.tm-lfg-fabs[hidden] { display: none !important; }
.tm-lfg-fabs--lift {
  bottom: calc(3.6rem + var(--safe-bottom));
}
.tm-lfg-fab {
  pointer-events: auto;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  border: 2px solid var(--text);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(44, 34, 30, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.tm-lfg-fab:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(44, 34, 30, 0.18);
}
.tm-lfg-fab[hidden] { display: none !important; }
.tm-lfg-fab svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.tm-lfg-fab--map {
  background: var(--card);
  color: #065f46;
  border-color: #059669;
}
.tm-lfg-fab--create {
  background: var(--accent);
  color: #fff;
  border-color: #065f46;
}
#panelList {
  padding-bottom: calc(5.5rem + var(--safe-bottom));
}
#panelDetail {
  padding-bottom: calc(4.5rem + var(--safe-bottom));
}

.tm-lfg-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + var(--safe-bottom));
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  max-width: min(92vw, 360px);
  text-align: center;
}
.tm-lfg-toast.is-on { opacity: 1; }

.tm-lfg-dialog {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 1rem;
}
.tm-lfg-dialog.is-on { display: flex; }
.tm-lfg-dialog__card {
  width: min(100%, 360px);
  background: var(--card);
  border: 2px solid var(--text);
  border-radius: 16px;
  padding: 1.1rem;
  box-shadow: 4px 4px 0 rgba(44, 34, 30, 0.2);
}
.tm-lfg-dialog__card h3 { margin: 0 0 0.5rem; }
.tm-lfg-dialog__card p { margin: 0 0 0.85rem; color: var(--muted); font-size: 0.9rem; }
.tm-lfg-dialog__card input {
  width: 100%;
  margin-bottom: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}
.tm-lfg-dialog__actions { display: flex; gap: 0.5rem; }
.tm-lfg-dialog__actions .tm-lfg-btn { flex: 1; }
