/* Twipe 1.6.1 — карта */
.tmap { position: absolute; inset: 0; overflow: hidden; background: #e9e6df; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
html[data-theme="dark"] .tmap { background: #1b1f29; }
.tmap.is-grab { cursor: grabbing; }
.tmap-tiles, .tmap-markers { position: absolute; inset: 0; }
.tmap-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; transform-origin: 0 0; opacity: 0; transition: opacity .25s ease; pointer-events: none; image-rendering: auto; }
.tmap-tile.is-in { opacity: 1; }
.tmap-trails { position: absolute; inset: 0; pointer-events: none; }
.tmap-trail { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1 8; opacity: .8; }
.tmap-marker { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.tmap-acc { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(79, 124, 255, .14); border: 1.5px solid rgba(79, 124, 255, .35); }
.tmap-pin { position: absolute; left: 0; top: 0; transform: translate(-50%, -100%); }
.tmap-marker--me .tmap-pin { transform: translate(-50%, -50%); }
.tmap-zoom { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .45); z-index: 3; }
.tmap-zbtn { width: 40px; height: 40px; border: 0; background: color-mix(in srgb, var(--bg-elevated, #fff) 92%, transparent); color: var(--text, #0f172a); font-size: 20px; font-weight: 700; cursor: pointer; backdrop-filter: blur(10px); }
.tmap-zbtn + .tmap-zbtn { border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); }
.tmap-attr { position: absolute; right: 6px; bottom: 4px; font-size: 10px; opacity: .55; background: rgba(255, 255, 255, .6); color: #334155; padding: 1px 5px; border-radius: 6px; z-index: 3; pointer-events: none; }

/* маркеры */
.tmv-pin-ava, .loc-pin b { position: relative; display: grid; place-items: center; width: 40px; height: 40px; color: #fff; font-weight: 800; font-size: 16px; z-index: 0; }
.tmv-pin-ava::before, .loc-pin b::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: linear-gradient(135deg, #4f7cff, #8b5cf6); border: 3px solid #fff; box-shadow: 0 8px 18px -6px rgba(15, 23, 42, .55); }
.tmv-pin-ava { margin-bottom: 6px; }
.tmap-marker--peer.is-live .tmap-pin::before, .loc-pin.is-live::before { content: ""; position: absolute; left: 50%; bottom: -6px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: rgba(79, 124, 255, .5); animation: tmapPulse 1.8s ease-out infinite; }
.tmap-marker--self .tmv-pin-ava::before { background: linear-gradient(135deg, #10b981, #06b6d4); }
.tmap-marker.is-stale .tmv-pin-ava, .loc-pin.is-stale b { filter: grayscale(.8); opacity: .75; }
@keyframes tmapPulse { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.4); opacity: 0; } }
.tmv-me-dot { display: block; width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(59, 130, 246, .25), 0 4px 10px rgba(0, 0, 0, .3); }

/* полноэкранная карта */
.tmv { position: fixed; inset: 0; z-index: 1450; background: #0f172a; opacity: 0; transform: scale(.98); transition: opacity .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1); }
.tmv.is-open { opacity: 1; transform: none; }
.tmv.hidden { display: none; }
html.tmv-open { overflow: hidden; }
.tmv-map { position: absolute; inset: 0; }
.tmv-head { position: absolute; left: 12px; right: 12px; top: max(12px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 10px; z-index: 4; pointer-events: none; }
.tmv-head > * { pointer-events: auto; }
.tmv-round { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; font-size: 18px; font-weight: 800; color: var(--text, #0f172a);
  background: color-mix(in srgb, var(--bg-elevated, #fff) 90%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .45); }
.tmv-back { width: 11px; height: 11px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: translateX(2px) rotate(45deg); }
.tmv-title { flex: 1; min-width: 0; padding: 7px 14px; border-radius: 16px; background: color-mix(in srgb, var(--bg-elevated, #fff) 90%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 8px 22px -10px rgba(0, 0, 0, .45); display: flex; flex-direction: column; color: var(--text, #0f172a); }
.tmv-title b { font-size: 15px; }
.tmv-title small { font-size: 12px; opacity: .6; }
.tmv-fabs { position: absolute; right: 12px; bottom: 170px; display: flex; flex-direction: column; gap: 10px; z-index: 4; }
.tmv-gps { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; position: relative; }
.tmv-gps::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #3b82f6; }
.tmv-card { position: absolute; left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 4; max-width: 520px; margin: 0 auto; padding: 14px; border-radius: 22px; color: var(--text, #0f172a);
  background: color-mix(in srgb, var(--bg-elevated, #fff) 92%, transparent); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); animation: tmvCard .4s cubic-bezier(.22, 1, .36, 1); }
@keyframes tmvCard { from { transform: translateY(30px); opacity: 0; } }
.tmv-card-row { display: flex; align-items: center; gap: 12px; }
.tmv-ava { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; background: linear-gradient(135deg, #4f7cff, #8b5cf6); flex: 0 0 auto; position: relative; }
.tmv-ava.is-live::after { content: ""; position: absolute; right: 0; bottom: 0; width: 12px; height: 12px; border-radius: 50%; background: #ef4444; border: 2px solid var(--bg-elevated, #fff); }
.tmv-card-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tmv-card-title { font-size: 16px; }
.tmv-card-sub { font-size: 12.5px; opacity: .6; font-variant-numeric: tabular-nums; }
.tmv-dist { font-weight: 800; font-size: 14px; color: var(--accent, #4f7cff); white-space: nowrap; }
.tmv-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tmv-card-actions:empty { display: none; }
.tmv-btn { border: 0; border-radius: 12px; padding: 10px 14px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; color: inherit; background: color-mix(in srgb, currentColor 8%, transparent); }
.tmv-btn--primary { flex: 1; color: #fff; background: linear-gradient(135deg, #4f7cff, #8b5cf6); box-shadow: 0 10px 22px -12px #4f7cff; }
.tmv-btn--danger { color: #ef4444; background: rgba(239, 68, 68, .1); }
.tmv-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 800; color: #ef4444; margin-right: auto; }
.tmv-live i, .loc-chip--live i { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: tmvBlink 1.2s ease-in-out infinite; }
@keyframes tmvBlink { 50% { opacity: .3; } }
.tmv-center-pin { display: none; position: absolute; left: 50%; top: 50%; z-index: 3; pointer-events: none; transform: translate(-50%, -100%); }
.tmv[data-mode="pick"] .tmv-center-pin { display: block; }
.tmv-center-pin span { display: block; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: linear-gradient(135deg, #ef4444, #f97316); border: 3px solid #fff; box-shadow: 0 10px 18px -6px rgba(0, 0, 0, .5); }
.tmv-center-pin::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 4px; margin-left: -5px; border-radius: 50%; background: rgba(0, 0, 0, .35); }
.tmv[data-mode="pick"] .tmv-fabs [data-tmv="fit"] { display: none; }
html[data-theme="dark"] .tmv-title, html[data-theme="dark"] .tmv-card, html[data-theme="dark"] .tmv-round, html[data-theme="dark"] .tmap-zbtn { background: color-mix(in srgb, #0f172a 86%, transparent); color: #f1f5f9; }

/* пузырь с мини-картой */
.msg-bubble--locmap { padding: 4px !important; overflow: hidden; }
.loc-card { position: relative; display: block; width: 264px; max-width: 72vw; padding: 0; border: 0; border-radius: 14px; overflow: hidden; cursor: pointer; background: #e9e6df; color: inherit; font: inherit; text-align: left; }
html[data-theme="dark"] .loc-card { background: #1b1f29; }
.tmap-static { position: relative; overflow: hidden; max-width: 100%; }
.tmap-static-tile { position: absolute; width: 256px; height: 256px; pointer-events: none; }
.tmap-static-pin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -100%); }
.loc-pin { position: relative; display: block; }
.loc-pin b { width: 34px; height: 34px; font-size: 14px; }
.loc-chip { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #fff; background: rgba(15, 23, 42, .62); backdrop-filter: blur(8px); }
.loc-chip--live { background: rgba(239, 68, 68, .9); }
.loc-chip--live i { background: #fff; }
.loc-card-foot { display: flex; flex-direction: column; padding: 8px 10px 6px; background: var(--bg-elevated, #fff); }
.msg.out .loc-card-foot { background: color-mix(in srgb, #fff 16%, transparent); color: #fff; }
html[data-theme="dark"] .msg:not(.out) .loc-card-foot { background: #111827; }
.loc-card-title { font-weight: 700; font-size: 13.5px; }
.loc-card-sub { font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }
.loc-stop { display: block; width: 100%; margin-top: 4px; border: 0; border-radius: 10px; padding: 8px; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; color: #ef4444; background: rgba(239, 68, 68, .1); }
.msg.out .loc-stop { color: #fff; background: rgba(255, 255, 255, .18); }
.loc-nomap { padding: 30px; text-align: center; opacity: .6; }

/* панель «Место» */
.loc-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 12px; }
.loc-act { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--line, #e2e8f0) 80%, transparent); background: color-mix(in srgb, var(--bg-elevated, #fff) 90%, transparent); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease; }
.loc-act:active { transform: scale(.97); }
.loc-act--primary { color: #fff; border-color: transparent; background: linear-gradient(135deg, #10b981, #06b6d4); box-shadow: 0 12px 24px -14px #06b6d4; }
.loc-act-ico { font-size: 22px; margin-bottom: 4px; }
.loc-act b { font-size: 14.5px; }
.loc-act small { font-size: 12px; opacity: .7; }
.tmv-theme { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.tmap-tiles { z-index: 0; }
.tmap-trails { z-index: 1; }
.tmap-markers { z-index: 2; }
.msg.out .loc-card-foot { background: #2f6fe0; color: #fff; }
