/* ==========================================================================
   Ammonit Quan trắc — khung giao diện (bản đồ + danh sách + chi tiết)
   Giao diện sáng, phẳng, kiểu dashboard kỹ thuật.
   ========================================================================== */

@font-face {
  font-family: "RobotoV";
  src: url("../vendor/fonts/roboto-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  --bg: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-2: #0ea5e9;
  --ok: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
  --font: "RobotoV", "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;
  --sidebar-w: 312px;
  --topbar-h: 58px;
  --detail-w: 560px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 9999;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ============================ Layout ============================ */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 0;
  background: var(--panel); border-right: 1px solid var(--line);
  z-index: 30;
}

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* ============================ Sidebar ============================ */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px 12px; border-bottom: 1px solid var(--line);
}
.brand__logo { display: flex; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand__txt strong { font-size: 14px; letter-spacing: .06em; }
.brand__txt strong span { color: var(--accent); }
.brand__txt small { color: var(--muted); font-size: 11.5px; }
.sidebar__close { display: none; margin-left: auto; }

.side-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 14px 6px; }
.side-stat {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; display: flex; flex-direction: column; gap: 1px;
}
.side-stat b { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.side-stat span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.v-ok { color: var(--ok); }
.v-warn { color: var(--warn); }
.v-danger { color: var(--danger); }

.side-search {
  display: flex; align-items: center; gap: 8px; margin: 10px 14px 8px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 12px; color: var(--muted);
}
.side-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.side-search input { border: 0; background: transparent; outline: 0; width: 100%; color: var(--text); }
.side-search input::-webkit-search-cancel-button { cursor: pointer; }

.site-list { list-style: none; margin: 0; padding: 0 10px 10px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }

.site-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 10px 10px; border: 1px solid transparent; border-radius: var(--radius);
  background: transparent; margin-bottom: 2px; position: relative;
}
.site-item:hover { background: var(--panel-2); }
.site-item.is-active { background: #eff6ff; border-color: #bfdbfe; }
.site-item.is-active::before {
  content: ""; position: absolute; left: -10px; top: 12px; bottom: 12px; width: 3px;
  background: var(--accent); border-radius: 0 3px 3px 0;
}
.site-item__pin { flex: 0 0 auto; margin-top: 2px; }
.site-item__txt { min-width: 0; flex: 1 1 auto; }
.site-item__name { display: block; font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-item__sub { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11.5px; margin-top: 1px; }
.site-item__val { margin-top: 6px; display: flex; align-items: baseline; gap: 4px; }
.site-item__val b { font-size: 17px; font-variant-numeric: tabular-nums; }
.site-item__val small { color: var(--muted); font-size: 11px; }
.site-item__spark { width: 66px; height: 24px; flex: 0 0 auto; align-self: center; opacity: .9; }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.pill.warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.pill.danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.pill.unknown { color: var(--muted); background: var(--panel-2); border-color: var(--line); }
.pill.live::before { animation: pulse 2s infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.site-skel { height: 74px; border-radius: var(--radius); margin-bottom: 6px; background: linear-gradient(100deg, #f1f5f9 30%, #e8eef6 50%, #f1f5f9 70%); background-size: 220% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

.site-list__empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13px; }

.side-foot { border-top: 1px solid var(--line); padding: 9px 14px; font-size: 11px; color: var(--muted); display: grid; gap: 2px; }
.src b { color: var(--text-2); font-weight: 500; }

/* ============================ Topbar ============================ */
.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); z-index: 20;
}
.topbar__spacer { flex: 1 1 auto; }
.crumb { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted); }
.crumb__cur { font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.serial-chip { font-family: var(--mono); font-size: 11.5px; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; color: var(--text-2); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(100,116,139,.15); }
.live-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.live-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.live-dot.danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.18); }

.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 999px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.seg button.is-active { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(15,23,42,.12); font-weight: 500; }
.seg.small button { padding: 4px 9px; font-size: 11.5px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text-2);
}
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.is-spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.only-mobile { display: none; }

.clock { font-family: var(--mono); font-size: 12px; color: var(--muted); min-width: 62px; text-align: right; font-variant-numeric: tabular-nums; }

/* ============================ Split ============================ */
.split { flex: 1 1 auto; display: flex; min-height: 0; }

.map-wrap {
  position: relative; flex: 1 1 auto; min-width: 0; min-height: 0;
  /* chiều cao xác định để con đo được ngay, không phụ thuộc nội dung */
  background: #dfe6ee;
  overflow: hidden;
}
.map {
  /* OpenLayers đo trực tiếp phần tử này. Dùng kích thước 100% của cha (không absolute)
     để phép đo hội tụ ngay; absolute + inset:0 từng gây vòng resize vô hạn làm TREO tab
     trên điện thoại (trace: treo đúng trong map.setTarget). */
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.glass {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(8px);
  -webkit-backdrop-filter: saturate(160%) blur(8px);
  border: 1px solid rgba(226, 232, 240, .9);
  box-shadow: var(--shadow);
  border-radius: 10px;
}

.map-toolbar { position: absolute; top: 12px; left: 12px; display: flex; gap: 2px; padding: 3px; z-index: 5; }
.map-btn {
  border: 0; background: transparent; color: var(--text-2); padding: 6px 11px;
  border-radius: 7px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px;
}
.map-btn:hover { background: var(--panel-2); }
.map-btn.is-active { background: var(--accent); color: #fff; }
.map-fab { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; padding: 3px; gap: 2px; z-index: 5; }
.map-fab .map-btn { padding: 7px; }

.map-legend { position: absolute; left: 12px; bottom: 12px; padding: 9px 11px; font-size: 11.5px; color: var(--text-2); z-index: 5; }
.legend__row { display: flex; align-items: center; gap: 7px; }
.legend__hint { margin-top: 5px; padding-top: 5px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 10.5px; max-width: 190px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--warn); }
.dot.danger { background: var(--danger); }
.dot.unknown { background: #94a3b8; }

.map-status {
  position: absolute; right: 12px; bottom: 12px; padding: 6px 11px; font-size: 12px;
  color: var(--text-2); z-index: 5; display: flex; align-items: center; gap: 7px;
}
.map-status.is-error { color: #b91c1c; }
.map-status:empty, .map-status[hidden] { display: none; }

/* --- Popup ghim --- */
.map-popup {
  position: absolute; z-index: 10; min-width: 236px; max-width: 300px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .28); padding: 12px 13px;
  transform: translate(-50%, calc(-100% - 46px));
}
.map-popup::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px;
  background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}
.map-popup h4 { font-size: 13.5px; margin-bottom: 2px; }
.map-popup .pp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 2px 0; }
.map-popup .pp-row span { color: var(--muted); }
.map-popup .pp-row b { font-variant-numeric: tabular-nums; }
.map-popup__btn {
  margin-top: 8px; width: 100%; border: 0; background: var(--accent); color: #fff;
  border-radius: 8px; padding: 7px; font-size: 12.5px; font-weight: 500;
}
.map-popup__btn:hover { background: #1d4ed8; }

/* --- Ghim datalogger (HTML overlay) --- */
.pin-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; }
.pin {
  position: relative; width: 34px; height: 34px; border-radius: 11px 11px 11px 3px;
  transform: rotate(0);
  background: #fff; border: 2px solid var(--ok);
  display: grid; place-items: center; color: #047857;
  box-shadow: 0 4px 10px -2px rgba(15, 23, 42, .35);
  transition: transform .16s ease, box-shadow .16s ease, border-color .2s;
  cursor: grab;
}
.pin svg { width: 18px; height: 18px; }
.pin__badge {
  position: absolute; top: -7px; right: -9px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}
.pin__tip { width: 8px; height: 8px; border-radius: 50%; margin-top: 2px; background: var(--ok); box-shadow: 0 0 0 3px rgba(16,185,129,.25); }
.pin-wrap[data-state="warn"] .pin { border-color: var(--warn); color: #b45309; }
.pin-wrap[data-state="warn"] .pin__tip { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.25); }
.pin-wrap[data-state="danger"] .pin { border-color: var(--danger); color: #b91c1c; }
.pin-wrap[data-state="danger"] .pin__tip { background: var(--danger); box-shadow: 0 0 0 3px rgba(239,68,68,.25); }
.pin-wrap[data-state="unknown"] .pin { border-color: #94a3b8; color: #64748b; }
.pin-wrap[data-state="unknown"] .pin__tip { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.25); }

.pin-wrap:hover .pin, .pin-wrap.is-selected .pin { transform: translateY(-3px) scale(1.06); box-shadow: 0 10px 18px -6px rgba(15, 23, 42, .45); }
.pin-wrap.is-selected .pin { outline: 3px solid rgba(37,99,235,.28); outline-offset: 1px; }
.pin-wrap.is-selected .pin__label { opacity: 1; transform: translateY(0); }
.pin-wrap.is-dragging .pin { cursor: grabbing; transform: scale(1.1); }

.pin__label {
  margin-top: 3px; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: rgba(15, 23, 42, .86); color: #fff; font-size: 11px; font-weight: 500;
  opacity: 0; transform: translateY(-3px); transition: opacity .15s, transform .15s;
  pointer-events: none;
}
.pin__label b { font-variant-numeric: tabular-nums; }
.pin-wrap:hover .pin__label { opacity: 1; transform: translateY(0); }

.pin-label-static .ol-layer canvas, .pin-static .pin { cursor: pointer; }

/* ============================ Detail panel ============================ */
.detail {
  width: var(--detail-w); flex: 0 0 var(--detail-w);
  background: var(--panel); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.detail__empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 36px; text-align: center; color: var(--muted); }
.detail__empty h2 { color: var(--text); font-size: 17px; }
.detail__empty p { max-width: 330px; font-size: 13px; }
.detail__body { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.detail__head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--panel);
}
.detail__id { display: flex; gap: 11px; align-items: center; min-width: 0; }
.detail__icon {
  width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto;
  display: grid; place-items: center; background: #eff6ff; color: var(--accent);
  border: 1px solid #dbeafe;
}
.detail__id h2 { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail__meta { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.detail__badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em;
  color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap;
}
.badge.ok { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.badge.warn { color: #b45309; background: #fffbeb; border-color: #fde68a; }
.badge.danger { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.badge.ghost { text-transform: none; letter-spacing: 0; font-family: var(--mono); font-size: 10.5px; }

.detail__scroll { overflow-y: auto; flex: 1 1 auto; padding: 0 14px 20px; min-height: 0; scroll-behavior: smooth; }
.detail.is-full { position: fixed; inset: 12px; width: auto; flex: none; z-index: 40; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 24px 60px -20px rgba(15,23,42,.45); }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-top: 12px; overflow: hidden;
}
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px 8px; }
.card__head h3 { font-size: 13.5px; }
.card__head p { font-size: 11.5px; }
.card__tools { display: flex; gap: 6px; align-items: center; }
.card__tools select {
  border: 1px solid var(--line); background: var(--panel-2); border-radius: 8px;
  padding: 4px 7px; font-size: 12px; color: var(--text-2);
}
.chart-host { padding: 4px 8px 8px; min-height: 250px; }

.table-scroll { overflow-x: auto; }
.sensor-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sensor-table th, .sensor-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sensor-table thead th {
  position: sticky; top: 0; background: var(--panel-2); z-index: 1;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500;
}
.sensor-table .num { text-align: right; font-variant-numeric: tabular-nums; }

.detail__foot { padding: 12px 2px 0; font-size: 11px; line-height: 1.5; }

/* ============================ Toast ============================ */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: #0f172a; color: #fff; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; z-index: 999; box-shadow: 0 12px 30px -10px rgba(0,0,0,.5);
  max-width: min(90vw, 460px);
}
.toast.is-error { background: #b91c1c; }

/* ============================ Responsive ============================ */
@media (max-width: 1280px) {
  :root { --detail-w: 470px; --sidebar-w: 280px; }
}

@media (max-width: 1024px) {
  :root { --detail-w: 400px; }
  .crumb__cur { max-width: 24vw; }
  .seg.small button { padding: 4px 7px; }
  .clock { display: none; }
}

@media (max-width: 900px) {
  .only-mobile { display: inline-flex; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); flex-basis: auto;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 60px rgba(15,23,42,.25);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar__close { display: inline-flex; }
  .split { flex-direction: column; }
  /* Trên di động cấp chiều cao tường minh: OpenLayers đo phần tử con, nên cha phải có
     chiều cao chắc chắn. Trước đây dùng flex % trong khung flex cột gây vòng đo. */
  .map-wrap { flex: 0 0 auto; height: 42vh; min-height: 260px; max-height: 60vh; }
  .detail { width: 100%; flex: 1 1 58%; border-left: 0; border-top: 1px solid var(--line); }
  .detail__empty { padding: 18px; }
  .detail__empty svg { width: 32px; height: 32px; }
  .detail.is-full { position: fixed; inset: 0; border-radius: 0; }
  .crumb__root, .topbar .seg { display: none; }
  .crumb__cur { max-width: 52vw; }
}

@media (max-width: 560px) {
  .detail__head { padding: 10px 12px; }
  .detail__scroll { padding: 0 10px 24px; }
  .map-legend { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@media print {
  .sidebar, .topbar, .map-toolbar, .map-fab, .map-legend, .map-status { display: none !important; }
  .app, .split { display: block; height: auto; }
  .detail { width: 100%; border: 0; }
}

/* OpenLayers ghi đè nhỏ */
.ol-zoom { top: auto; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: row; background: rgba(255,255,255,.94); border-radius: 9px; padding: 3px; box-shadow: var(--shadow); }
.ol-zoom button { border: 0 !important; background: transparent !important; color: var(--text-2) !important; border-radius: 6px; font-size: 17px; width: 30px; height: 28px; margin: 0 !important; }
.ol-zoom button:hover { background: var(--panel-2) !important; }
.ol-attribution { background: rgba(255,255,255,.82) !important; border-radius: 6px 0 0 0; font-size: 10px !important; }
.ol-attribution ul { color: #475569 !important; }
.ol-attribution a { color: #2563eb !important; }
.ol-scale-line { background: rgba(15, 23, 42, .72) !important; border-radius: 5px; padding: 1px 4px; bottom: 8px !important; left: 8px !important; }
.ol-scale-line-inner { border-color: #fff !important; color: #fff !important; font-size: 10px !important; }
.ol-control button:focus-visible { outline: 2px solid var(--accent); }
.ol-overlay-container { z-index: 4; }

/* ==========================================================================
   Chế độ KHÔNG BẢN ĐỒ (dự phòng khi bản đồ không khởi tạo được trên thiết bị)
   app.js thêm class "no-map" vào <body>; phần số liệu chiếm toàn bộ chỗ.
   ========================================================================== */
body.no-map .map-wrap { display: none; }
body.no-map .split { flex-direction: column; }
body.no-map .detail { width: 100%; flex: 1 1 auto; border-left: 0; }
@media (max-width: 900px) {
  body.no-map .detail { flex: 1 1 auto; }
}
