
/* qgis2web Sidebar ULTRA — Province default, left-aligned controls with action row below */
#q2w-sidebar {
  position: fixed; top: 10px; left: 10px;
  width: 370px; height: calc(100% - 20px);
  background: #fff; border: 1px solid #e5e5e5;
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  border-radius: 10px; display: flex; flex-direction: column;
  z-index: 9999; overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, 'Noto Sans';
}
#q2w-sidebar header { padding: 10px 12px 8px; border-bottom: 1px solid #eee; }
#q2w-sidebar h1 { font-size: 16px; margin: 0 0 4px 0; }
#q2w-sidebar .hint { font-size: 12px; color: #666; }

#q2w-controls {
  padding: 8px 12px; border-bottom: 1px solid #eee;
}
#q2w-controls .inline-controls {
  display:flex; align-items:center; gap:8px; flex-wrap: nowrap; white-space: nowrap;
}
#q2w-controls .field { display:flex; align-items:center; gap:6px; }
#q2w-controls .field label { font-size:12px; color:#555; }
#q2w-controls select {
  border:1px solid #ccc; border-radius:6px; padding:4px 8px; font-size:12px; background:#fff;
}
#q2w-controls .action-row {
  margin-top:8px;
  display:flex; align-items:center; gap:8px; flex-wrap: wrap;
}
#q2w-controls .btn {
  font-size: 12px; border:1px solid #ccc; background:#fff;
  border-radius:20px; padding:4px 10px; cursor:pointer;
}

#q2w-search {
  padding: 8px 12px; border-bottom: 1px solid #eee; position: sticky; top: 0;
  background:#fff; z-index: 2;
}
#q2w-search input {
  width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 13px; outline: none;
  box-sizing: border-box;
}
#q2w-suggestions {
  display:none; max-height:180px; overflow:auto; background:#fff; border:1px solid #eee; border-radius:6px; margin-top:6px;
  width: 100%; box-sizing: border-box;
}
#q2w-suggestions div { padding:6px 10px; cursor:pointer; }
#q2w-suggestions div:hover { background:#f4f4f4; }

#q2w-legend { flex: 1; overflow:auto; padding: 8px 12px 12px; }
.q2w-group { border-bottom: 1px solid #f1f1f1; margin-bottom: 8px; }
.q2w-group-header {
  display:flex; align-items:center; gap:8px; padding: 6px 2px; user-select:none;
}
.q2w-caret { width: 0; height: 0; border-left: 5px solid #888; border-top: 5px solid transparent; border-bottom: 5px solid transparent; transition: transform 0.2s; }
.q2w-group.collapsed .q2w-caret { transform: rotate(-90deg); }
.q2w-title { font-size: 12px; font-weight: 600; color:#333; flex:1; }
.q2w-badge { font-size:11px; color:#555; background:#f4f4f4; border:1px solid #eaeaea; border-radius: 10px; padding: 2px 6px; }
.q2w-group-tools { display:flex; gap:6px; }
.q2w-link {
  font-size:11px; color:#2363eb; cursor:pointer; text-decoration:none; border:1px solid #d8e0fb;
  background:#eef2ff; padding: 1px 6px; border-radius: 10px;
}
.q2w-items { padding: 6px 0 4px 12px; }
.q2w-item { display:flex; align-items:center; gap:8px; padding:4px 2px; border-bottom: 1px dashed #f2f2f2; cursor:pointer; }
.q2w-swatch { width:12px; height:12px; border:1px solid #000; flex: 0 0 auto; }
.q2w-label { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex:1; }
.q2w-count { font-size: 11px; color:#666; }
.q2w-item input[type="checkbox"] { transform: translateY(1px); }

#q2w-footer { padding:8px 12px; border-top:1px solid #eee; font-size:11px; color:#666; display:flex; justify-content:space-between; align-items:center; }

@media (max-width: 960px) {
  #q2w-sidebar { width: 300px; }
  #q2w-controls .inline-controls { gap:6px; }
  #q2w-controls .action-row { gap:6px; }
}
