/* =========================================================
   RDFRLTM — Shared styles (index + route only)
   ========================================================= */

/* === Base reset === */
html, body {
  height: 100%;
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
#app { display: flex; height: 100vh; width: 100vw; }
#map { flex: 2; min-width: 0; }

/* === Sidebar === */
#sidebar {
  flex: 1;
  max-width: 460px;
  border-left: 1px solid #e6e6e6;
  padding: 14px 14px;
  box-sizing: border-box;
  overflow-y: auto;
  background: #fafafa;
}
#sidebar h1 { font-size: 20px; margin: 0 0 6px; }

/* === Panels === */
.panel {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 12px 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.03);
  overflow: visible;
}

/* === Record cards === */
.record {
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  background: #fff;
}

/* === Header row (title left, nav links right) === */
.header-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
  align-items: start;
}
.header-left { min-width: 0; }
.header-links {
  width: 180px;
  max-width: 180px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  text-align: right;
}
.header-links a { text-decoration: none; }

.header-btn {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #d6d6d6;
  background: rgba(0,0,0,0.04);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.header-btn:hover { background: rgba(0,0,0,0.07); }

/* === Mobile drawer toggle + backdrop === */
#sidebarToggle {
  position: fixed;
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 1200;
  display: none;
  height: 42px;
  width: 42px;
  border-radius: 12px;
  border: 1px solid #d6d6d6;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
  cursor: pointer;
  user-select: none;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  color: #111;
}

#sidebarBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1100;
  display: none;
}
#sidebarBackdrop.open { display: block; }

body.no-scroll { overflow: hidden; }

/* === Mobile breakpoint (index + route) === */
@media (max-width: 900px) {
  #app { display: block; }
  #map { height: 100vh; width: 100vw; }

  #sidebarToggle { display: inline-flex; }

  #sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(460px, 92vw);
    max-width: 92vw;
    z-index: 1150;
    border-left: none;
    box-shadow: 0 18px 38px rgba(0,0,0,0.18);
    transform: translateX(105%);
    transition: transform 180ms ease;
  }
  #sidebar.open { transform: translateX(0); }

  /* Prevent iOS auto-zoom on input focus */
  .search-input,
  input[type="text"],
  input[type="search"],
  input:not([type]) {
    font-size: 16px !important;
  }

  /* Header stacks on mobile */
  .header-row { grid-template-columns: 1fr; }
  .header-links {
    width: 100%;
    max-width: none;
    align-items: stretch;
    text-align: left;
  }
}