:root {
  --bg: #07100f;
  --panel: rgba(14, 22, 21, 0.88);
  --panel-strong: rgba(11, 18, 17, 0.96);
  --line: rgba(255,255,255,0.08);
  --text: #edf1ed;
  --muted: #a6b0aa;
  --green: #2f8f5b;
  --green-dark: #236a43;
  --red: #d1453d;
  --red-dark: #ae3029;
  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --radius: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Arial, Helvetica, sans-serif; color: var(--text); }
body { background: #050808; }
body::before {
  content: "";
  position: fixed; inset: 0;
  background: linear-gradient(rgba(5,8,8,.86), rgba(5,8,8,.9)), url("images/orq-logo.png") center center / min(60vw, 600px) no-repeat;
  pointer-events: none; z-index: -2;
}
body::after { content: ""; position: fixed; inset: 0; backdrop-filter: blur(3px); pointer-events: none; z-index: -1; }
.hidden { display:none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-size: 1.1rem; font-weight: 700; }
.eyebrow { color: #c8a55a; font-size: 12px; letter-spacing: 1.5px; }
button, input, select, textarea { font: inherit; }
button { border:0; border-radius: 14px; padding: 12px 16px; color:white; cursor:pointer; }
button:hover { opacity:.96; }
input, select, textarea { width:100%; background: rgba(255,255,255,.05); color: var(--text); border:1px solid var(--line); border-radius:14px; padding:13px 14px; }
label { font-weight:700; margin-top:6px; }
.primary-btn { background: linear-gradient(180deg, var(--green), var(--green-dark)); }
.secondary-btn { background: #33423d; }
.danger-btn { background: linear-gradient(180deg, var(--red), var(--red-dark)); }
.ghost-btn { background: transparent; border:1px solid var(--line); }
.full { width:100%; }
.cardish { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(10px); }

.auth-shell { min-height:100vh; display:grid; place-items:center; padding:24px; }
.auth-card { width:min(720px,100%); background:var(--panel); border:1px solid var(--line); border-radius:28px; padding:28px; box-shadow:var(--shadow); backdrop-filter:blur(12px); }
.auth-logo { width:120px; display:block; margin:0 auto 18px; }
.auth-tabs { display:flex; gap:8px; margin-bottom:18px; }
.tab-btn { flex:1; background: rgba(255,255,255,.05); }
.tab-btn.active { background:#23322d; }
.auth-form { display:none; gap:10px; }
.auth-form.active { display:grid; }
.message { margin-top:14px; padding:12px; border-radius:14px; background: rgba(255,255,255,.05); }

.app-shell { min-height:100vh; }
.topbar { position:sticky; top:0; z-index:3000; display:flex; align-items:center; gap:16px; justify-content:space-between; padding:16px 18px; background: rgba(4,8,8,.84); backdrop-filter: blur(10px); border-bottom:1px solid var(--line); }
.topbar h1 { margin:0; font-size: clamp(1.4rem,2.2vw,2rem); cursor:pointer; }
.topbar-user { color: var(--muted); text-align:right; }
.hamburger-btn { position:relative; z-index:5100; width:52px; height:52px; border-radius:16px; background:rgba(255,255,255,.08); }
.menu-drawer { position:fixed; top:0; left:0; bottom:0; width:min(320px,86vw); transform:translateX(-100%); transition:transform .2s ease; background:var(--panel-strong); border-right:1px solid var(--line); padding:20px; z-index:5000; display:flex; flex-direction:column; gap:18px; box-shadow:var(--shadow); }
.menu-drawer.open { transform:translateX(0); }
.menu-backdrop { position:fixed; inset:0; background: rgba(0,0,0,.45); z-index:4900; }
.drawer-head { display:flex; gap:12px; align-items:center; }
.drawer-logo { width:56px; }
.drawer-title { font-size:1.2rem; font-weight:700; }
.drawer-nav { display:grid; gap:10px; }
.drawer-nav button { text-align:left; background: rgba(255,255,255,.05); }
.drawer-nav button.active { background:#24332e; }

.main-shell { padding:18px; }
.view { display:none; }
.view.active { display:block; }

.map-stage { position:relative; min-height: calc(100vh - 120px); overflow:hidden; }
#map { width:100%; height: calc(100vh - 120px); min-height:620px; border-radius:20px; overflow:hidden; z-index:1; }
.leaflet-container { z-index:1; }
.map-overlay { position:absolute; z-index:2000; display:flex; gap:12px; flex-wrap:wrap; pointer-events:none; }
.map-overlay > * { pointer-events:auto; }
.left-overlay { top:24px; left:24px; right:360px; }
.right-overlay { top:24px; right:24px; width:300px; flex-direction:column; }
.overlay-card { background: rgba(20,26,24,.86); border:1px solid var(--line); backdrop-filter: blur(12px); border-radius:18px; padding:16px; box-shadow: var(--shadow); }
.user-card { min-width:240px; }
.stat-card-small { min-width:130px; }
.stat-card-small { cursor:pointer; user-select:none; }
.stat-card-small.is-off { opacity:.45; }
.stat-card-small strong { font-size:2rem; }
.overlay-toggle { display:none !important; }
.detail-side { position:absolute; top:24px; right:24px; bottom:24px; width:340px; padding:18px; z-index:1999; overflow:auto; background: rgba(10,17,16,.9); }
.section-title { font-size:1.2rem; font-weight:700; margin-bottom:12px; }
.toolbar, .actions-row { display:flex; gap:10px; flex-wrap:wrap; }
.cards-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(330px,1fr)); gap:16px; }
.alert-card, .trail-card, .rating-card { background: var(--panel); border:1px solid var(--line); border-radius:22px; overflow:hidden; box-shadow: var(--shadow); }
.card-photo { width:100%; height:220px; object-fit:cover; display:block; }
.card-body { padding:16px; display:grid; gap:12px; }
.chips, .meta-list { display:flex; gap:8px; flex-wrap:wrap; }
.chip, .badge { background: rgba(255,255,255,.08); border:1px solid var(--line); border-radius:999px; padding:6px 10px; font-size:13px; }
.status-pill { border-radius:999px; padding:7px 10px; font-size:12px; font-weight:700; display:inline-block; }
.status-waiting { background: rgba(209,69,61,.16); color:#ffaba4; }
.status-coming { background: rgba(200,165,90,.18); color:#ffd595; }
.status-resolved { background: rgba(47,143,91,.18); color:#a9e9c6; }
.meta-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.meta-box { background: rgba(255,255,255,.04); border:1px solid var(--line); border-radius:16px; padding:12px; }
.meta-label { font-size:12px; text-transform:uppercase; letter-spacing:.7px; color: var(--muted); margin-bottom:6px; }
.coord-box { background: rgba(209,69,61,.12); border:1px solid rgba(209,69,61,.26); border-radius:18px; padding:14px; }
.coord-value { font-size:1.05rem; font-weight:700; margin-bottom:10px; word-break:break-word; }
.section-header { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:16px; }
.form-card { padding:18px; display:grid; gap:10px; max-width:720px; }
.no-border { border:0; box-shadow:none; background: transparent; padding:0; }
.setup-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px,1fr)); gap:10px; padding:12px; border:1px solid var(--line); border-radius:16px; background: rgba(255,255,255,.03); }
.setup-grid label { margin:0; font-weight:400; display:flex; gap:8px; align-items:center; }
.preview, .detail-photo { width:100%; max-height:240px; object-fit:cover; border-radius:16px; border:1px solid var(--line); }
.detail-photo { margin-bottom:12px; }
.detail-block { margin-bottom:12px; }
.message-stream { display:grid; gap:8px; margin-top:10px; }
.chat-message { background: rgba(255,255,255,.05); border:1px solid var(--line); border-radius:14px; padding:10px 12px; }
.chat-meta { font-size:12px; color: var(--muted); margin-bottom:6px; }
.empty-state { color: var(--muted); }
.modal { position:fixed; inset:0; background: rgba(0,0,0,.55); z-index:6000; display:grid; place-items:center; padding:20px; }
.modal-card { width:min(780px,100%); max-height:90vh; overflow:auto; background: var(--panel-strong); border:1px solid var(--line); border-radius:24px; padding:20px; box-shadow: var(--shadow); }
.modal-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }

.mobile-detail-close { display:none; }

@media (max-width: 1180px) {
  .left-overlay { right:24px; }
  .detail-side { position:relative; top:auto; right:auto; bottom:auto; width:auto; margin:16px; }
  #map { height:60vh; min-height:540px; }
}
@media (max-width: 820px) {
  .main-shell { padding:12px; }
  .map-stage { min-height:auto; }
  #map { height:58vh; min-height:460px; }
  .left-overlay, .right-overlay { position:absolute; left:16px; right:16px; width:auto; }
  .right-overlay { top:auto; bottom:16px; }
  .topbar-user { display:none; }
  .meta-grid { grid-template-columns:1fr; }
}


/* V5.1 fixes */
select, option {
  background: #0f1513;
  color: var(--text);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.inline-btn { width: auto; }
.map-stage { padding-right: 410px; }
.right-overlay { right: 430px; width: 320px; }
.detail-side { width: 380px; max-height: calc(100vh - 180px); overflow: auto; }
#detailMessageInput { flex: 1 1 240px; min-width: 0; }
.actions-row { flex-wrap: wrap; }
.action-note { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.mine-note { color: #d8b07a; }
@media (max-width: 1320px) {
  .map-stage { padding-right: 380px; }
  .right-overlay { right: 398px; width: 290px; }
  .detail-side { width: 350px; }
}
@media (max-width: 1180px) {
  .map-stage { padding-right: 0; }
  .right-overlay { left: auto; right: 24px; width: 300px; }
}


.topbar-user-wrap{display:flex;align-items:center;gap:12px;}
.icon-btn{display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.08);border:1px solid var(--line);padding:10px 14px;border-radius:14px;}
.notif-count{display:inline-grid;place-items:center;min-width:22px;height:22px;padding:0 6px;border-radius:999px;background:var(--red);font-size:12px;font-weight:700;}
.notif-drawer{position:fixed;top:86px;right:18px;width:min(420px,calc(100vw - 24px));max-height:calc(100vh - 110px);overflow:auto;background:var(--panel-strong);border:1px solid var(--line);border-radius:22px;box-shadow:var(--shadow);padding:18px;z-index:5200;}
.notif-drawer-head{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;flex-wrap:wrap;}
.activity-feed{display:grid;gap:10px;}
.activity-item{background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:16px;padding:12px;}
.activity-item.unread{border-color:rgba(209,69,61,.35);background:rgba(209,69,61,.08);}
.activity-meta{font-size:12px;color:var(--muted);margin-bottom:6px;}
.compact-feed{max-height:300px;overflow:auto;}
.setup-grid label,.overlay-toggle label{display:grid;grid-template-columns:18px 1fr;align-items:center;column-gap:8px;}
.setup-grid input[type="checkbox"],.overlay-toggle input[type="checkbox"]{margin:0;justify-self:start;}
@media (max-width: 820px){
  .topbar{padding:12px;}
  .topbar h1{font-size:1.25rem;}
  .eyebrow{font-size:10px;}
  .topbar-user-wrap{margin-left:auto;gap:8px;}
  .icon-btn{padding:10px 12px;}
  .notif-drawer{top:76px;right:12px;left:12px;width:auto;max-height:60vh;}
  .map-stage{padding-right:0;display:flex;flex-direction:column;gap:12px;background:none;border:none;box-shadow:none;}
  #map{height:62vh;min-height:420px;border-radius:20px;}
  .left-overlay{top:14px;left:14px;right:14px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;}
  .user-card{grid-column:1 / -1;min-width:0;padding:12px;}
  .stat-card-small{min-width:0;padding:12px;}
  .stat-card-small strong{font-size:1.5rem;}
  .right-overlay{left:14px;right:14px;bottom:14px;top:auto;width:auto;gap:8px;}
  .right-overlay button,.overlay-toggle{width:100%;}
  .right-overlay button{padding:12px 14px;}
  .overlay-toggle{display:grid;grid-template-columns:1fr 1fr;padding:12px;}
  .detail-side{position:relative;margin:0;width:auto;top:auto;right:auto;bottom:auto;max-height:none;background:var(--panel);}
  .cards-grid{grid-template-columns:1fr;}
  .meta-grid{grid-template-columns:1fr;}
  .setup-grid{grid-template-columns:1fr 1fr;}
}
@media (max-width: 560px){
  .main-shell{padding:10px;}
  .topbar-user{display:none;}
  .left-overlay{grid-template-columns:1fr 1fr;}
  .user-card{grid-column:1 / -1;}
  .overlay-toggle{grid-template-columns:1fr;gap:10px;}
  .setup-grid{grid-template-columns:1fr;}
  .actions-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
  .actions-row button,.actions-row input{width:100%;}
}


/* V6.5.7 mobile map-first pass */
@media (max-width: 820px) {
  .topbar {
    padding: 12px 14px;
    gap: 12px;
  }

  .topbar h1 {
    font-size: 1.15rem;
    line-height: 1.1;
  }

  .hamburger-btn,
  .icon-btn {
    width: 56px;
    height: 56px;
    padding: 0;
    display: inline-grid;
    place-items: center;
  }

  .icon-btn {
    font-size: 0;
  }

  .icon-btn::before {
    content: '🔔';
    font-size: 30px;
  }

  .notif-count {
    position: absolute;
    top: 8px;
    right: 8px;
  }

  .main-shell {
    padding: 10px;
  }

  .map-stage {
    display: block;
    min-height: auto;
    padding-right: 0;
    background: none;
    border: 0;
    box-shadow: none;
    overflow: visible;
  }

  #map {
    height: 67vh;
    min-height: 500px;
    border-radius: 24px;
  }

  .left-overlay,
  .right-overlay {
    position: absolute;
    left: 12px;
    right: 12px;
    width: auto;
  }

  .left-overlay {
    top: 12px;
    min-height: 0;
    display: block;
    right: 12px;
  }

  .left-overlay .overlay-card {
    position: absolute;
    margin: 0;
    box-shadow: none;
  }

  .user-card {
    display: none;
  }

  .stat-card-small {
    background: rgba(255,255,255,.72);
    border: 0;
    backdrop-filter: blur(6px);
    box-shadow: 0 8px 20px rgba(0,0,0,.12);
    padding: 4px 8px;
    min-width: 0;
    width: fit-content;
    color: #111;
    text-align: right;
    line-height: 1.15;
    border-radius: 12px;
    z-index: 2200;
  }

  .stat-card-small:first-of-type {
    top: 8px;
    right: 8px;
  }

  .stat-card-small:last-of-type {
    top: 38px;
    right: 8px;
  }

  .stat-card-small .muted {
    display: none;
  }

  .stat-card-small strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.15;
    font-weight: 900;
    color: #111;
    text-shadow: none;
  }

  .stat-card-small.alerts-stat strong::before {
    content: 'Alertes: ';
  }

  .stat-card-small.trails-stat strong::before {
    content: 'Trails: ';
  }

  .stat-card-small.is-off {
    opacity: .48;
  }

  .right-overlay {
    top: calc(67vh - 72px);
    bottom: auto;
    height: 60px;
    display: block;
    pointer-events: none;
    z-index: 2200;
  }

  .right-overlay > * {
    pointer-events: auto;
  }

  #refreshBtn,
  .overlay-toggle {
    display: none !important;
  }

  #centerMeBtn,
  #openAlertBtn {
    position: absolute;
    bottom: 0;
    width: 58px;
    height: 58px;
    padding: 0;
    border-radius: 18px;
    font-size: 0;
    box-shadow: 0 12px 28px rgba(0,0,0,.28);
  }

  #centerMeBtn {
    left: 0;
  }

  #centerMeBtn::before {
    content: '📍';
    font-size: 28px;
  }

  #openAlertBtn {
    right: 0;
    width: 72px;
  }

  #openAlertBtn::before {
    content: 'SOS';
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .02em;
  }


  .detail-side {
    position: relative;
    margin: 12px 0 0;
    width: auto;
    max-height: 36vh;
    padding: 16px;
    border-radius: 24px;
    background: rgba(10,17,16,.94);
  }

  .compact-feed {
    max-height: 160px;
  }
}

@media (max-width: 560px) {
  #map {
    height: 66vh;
    min-height: 470px;
  }

  .topbar {
    padding: 10px 12px;
  }

  .hamburger-btn,
  .icon-btn {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }

  .stat-card-small strong {
    font-size: 0.9rem;
  }

  .right-overlay {
    top: calc(66vh - 72px);
  }

  #openAlertBtn {
    width: 68px;
  }

  #openAlertBtn::before {
    font-size: 20px;
  }
}


/* V6.5.9 mobile map fit + floating detail */
@media (max-width: 820px) {
  #view-map {
    min-height: 0;
  }

  .main-shell {
    padding: 10px;
  }

  .map-stage {
    position: relative;
    min-height: 0;
    margin: 0;
  }

  #map {
    height: calc(100dvh - 138px);
    min-height: 0;
    max-height: calc(100dvh - 138px);
    border-radius: 24px;
  }

  .left-overlay {
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    pointer-events: none;
    z-index: 2200;
  }

  .left-overlay .overlay-card {
    position: static;
    pointer-events: auto;
  }

  .user-card {
    display: none !important;
  }

  .stat-card-small {
    padding: 4px 10px;
    background: rgba(255,255,255,.82);
    color: #111;
    border-radius: 12px;
  }

  .stat-card-small strong {
    color: #111 !important;
    font-weight: 900;
    font-size: 0.95rem;
  }

  .right-overlay {
    top: auto;
    left: 12px;
    right: 12px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    height: 58px;
  }

  .detail-side {
    display: none;
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
    margin: 0;
    width: auto;
    max-height: calc(100% - 150px);
    overflow: auto;
    z-index: 2300;
    border-radius: 22px;
    background: rgba(10,17,16,.96);
    box-shadow: 0 20px 50px rgba(0,0,0,.38);
  }

  .detail-side.is-open {
    display: block;
  }

  .detail-side .section-title:nth-of-type(2),
  #activityFeed,
  #activityCount {
    display: none !important;
  }

  .mobile-detail-close {
    display: inline-grid;
    place-items: center;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    z-index: 5;
  }
}

@media (max-width: 560px) {
  #map {
    height: calc(100dvh - 132px);
    max-height: calc(100dvh - 132px);
  }

  .detail-side {
    bottom: 68px;
    max-height: min(60dvh, 540px);
  }
}


/* V6.6.1 mobile map height + no page scroll + taller popup */
@media (max-width: 820px) {
  html, body {
    height: 100dvh;
  }

  body.mobile-map-lock {
    overflow: hidden;
  }

  body.mobile-map-lock .app-shell,
  body.mobile-map-lock #view-map,
  body.mobile-map-lock .main-shell,
  body.mobile-map-lock .map-stage {
    height: calc(100dvh - 74px);
    min-height: 0;
  }

  body.mobile-map-lock .main-shell {
    padding: 8px 10px 0;
    overflow: hidden;
  }

  body.mobile-map-lock #map {
    height: calc(100dvh - 94px);
    max-height: calc(100dvh - 94px);
  }

  body.mobile-map-lock .detail-side {
    left: 8px;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
    top: 54px;
    max-height: none;
    min-height: 0;
    width: auto;
    border-radius: 24px;
    padding: 18px 16px 16px;
  }

  body.mobile-map-lock .detail-side.is-open {
    display: block;
  }
}

@media (max-width: 560px) {
  body.mobile-map-lock .main-shell {
    padding: 6px 8px 0;
  }

  body.mobile-map-lock #map {
    height: calc(100dvh - 88px);
    max-height: calc(100dvh - 88px);
  }

  body.mobile-map-lock .right-overlay {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  }

  body.mobile-map-lock .detail-side {
    top: 54px;
    left: 4px;
    right: 4px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 88px);
    border-radius: 22px;
  }
}

/* ORQ admin patch */
.admin-grid {
  display: grid;
  gap: 16px;
}
.admin-panel {
  max-width: none;
}
.admin-users-list {
  display: grid;
  gap: 12px;
}
.admin-user-card {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
}
.admin-user-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
#adminStatusPill.is-live {
  background: rgba(47,143,91,.18);
  color: #a9e9c6;
}
@media (min-width: 980px) {
  .admin-grid {
    grid-template-columns: minmax(280px, 380px) 1fr;
    align-items: start;
  }
}
@media (max-width: 820px) {
  .admin-user-head {
    flex-direction: column;
  }
  .admin-user-card .actions-row {
    grid-template-columns: 1fr;
  }
}

#interventionViewContent {
  display: grid;
  gap: 16px;
}

.system-message {
  border: 1px dashed rgba(255,255,255,.18);
  background: rgba(255,255,255,.05);
}

#view-intervention .message-stream {
  max-height: 48vh;
}



/* v6.8 chat rebuild */
.chat-page-shell{display:grid;grid-template-columns:300px 1fr;gap:16px;align-items:start}
.chat-list-pane{display:grid;gap:10px;align-content:start}
.chat-list-item{width:100%;text-align:left;background:rgba(255,255,255,.04);border:1px solid var(--line);border-radius:18px;padding:12px;display:grid;gap:4px}
.chat-list-item.active{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.18)}
.chat-list-title{font-weight:700}
.chat-list-meta,.chat-list-preview{font-size:13px;color:var(--muted)}
.chat-thread-pane{min-width:0}
.intervention-thread-stream{max-height:42vh;overflow:auto;padding-right:6px}
.desktop-chat-drawer{position:fixed;left:18px;right:18px;bottom:18px;z-index:5500;background:rgba(10,17,16,.96);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:16px;transform:translateY(calc(100% + 40px));opacity:0;transition:transform .18s ease,opacity .18s ease}
.desktop-chat-drawer.open{transform:translateY(0);opacity:1}
.desktop-chat-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.desktop-chat-shell{display:grid;grid-template-columns:280px 1fr;gap:14px;align-items:start}
.desktop-chat-shell .chat-thread-pane{max-height:45vh;overflow:auto}
.chat-thread-card{max-width:none}
@media (max-width: 820px){
  .chat-page-shell{grid-template-columns:1fr;gap:12px}
  .desktop-chat-drawer{display:none!important}
  #view-intervention .message-stream,.intervention-thread-stream{max-height:52vh}
}


.add-member-panel { margin-bottom: 14px; }
.add-member-row input { flex: 1; }
.add-member-results { display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.add-member-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(255,255,255,.03); }
.add-member-item .strong { margin-bottom: 2px; }
@media (max-width: 860px) {
  .add-member-item { align-items:flex-start; flex-direction:column; }
  .add-member-item .primary-btn { width:100%; }
}
